iscsid: Disable TCP DDP for connection sockets.

cxgbei is not able to offload PDU processing for a socket using TCP
DDP offload.

Sponsored by:	Chelsio Communications
This commit is contained in:
John Baldwin 2021-09-13 09:57:54 -07:00
parent f63ddf465f
commit 91c62d626d

View File

@ -164,7 +164,7 @@ connection_new(int iscsi_fd, const struct iscsi_daemon_request *request)
#ifdef ICL_KERNEL_PROXY
struct iscsi_daemon_connect idc;
#endif
int error, sockbuf;
int error, optval;
conn = calloc(1, sizeof(*conn));
if (conn == NULL)
@ -275,14 +275,18 @@ connection_new(int iscsi_fd, const struct iscsi_daemon_request *request)
fail(conn, strerror(errno));
log_err(1, "failed to create socket for %s", from_addr);
}
sockbuf = SOCKBUF_SIZE;
optval = SOCKBUF_SIZE;
if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_RCVBUF,
&sockbuf, sizeof(sockbuf)) == -1)
&optval, sizeof(optval)) == -1)
log_warn("setsockopt(SO_RCVBUF) failed");
sockbuf = SOCKBUF_SIZE;
optval = SOCKBUF_SIZE;
if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF,
&sockbuf, sizeof(sockbuf)) == -1)
&optval, sizeof(optval)) == -1)
log_warn("setsockopt(SO_SNDBUF) failed");
optval = 1;
if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_NO_DDP,
&optval, sizeof(optval)) == -1)
log_warn("setsockopt(SO_NO_DDP) failed");
if (conn->conn_conf.isc_dscp != -1) {
int tos = conn->conn_conf.isc_dscp << 2;
if (to_ai->ai_family == AF_INET) {