git: 90f0f8dab2d5 - stable/13 - iscsid: Disable TCP DDP for connection sockets.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 29 Oct 2021 23:58:44 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=90f0f8dab2d534f17a8f71635e09a8d14fed8ccf commit 90f0f8dab2d534f17a8f71635e09a8d14fed8ccf Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2021-10-29 23:38:06 +0000 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 (cherry picked from commit 91c62d626d0e9995da9dc424120a4f1b0b987eea) --- usr.sbin/iscsid/iscsid.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c index 797a7561f79c..db8b5d4f5e4c 100644 --- a/usr.sbin/iscsid/iscsid.c +++ b/usr.sbin/iscsid/iscsid.c @@ -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) {