diff options
author | mav <mav@FreeBSD.org> | 2014-11-22 15:09:18 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-11-22 15:09:18 +0000 |
commit | 2efae2e6b18d927420b0efb91643ae5aaecb550a (patch) | |
tree | aeb65e65f9fc0f17e3b1102476294ff7d9c3f021 /usr.sbin/ctld/ctld.c | |
parent | bc2cba33a9b7b0a543aa63d3146154bd5eb8ce22 (diff) | |
download | FreeBSD-src-2efae2e6b18d927420b0efb91643ae5aaecb550a.zip FreeBSD-src-2efae2e6b18d927420b0efb91643ae5aaecb550a.tar.gz |
For both iSCSI initiator and target increase socket buffer sizes before
establishing connection.
This is a workaround for Chelsio TOE driver, that does not update socket
buffer size in hardware after connection established, and unless that is
done beforehand, kernel code will stuck, attempting to send/receive full
PDU at once.
MFC after: 1 week
Diffstat (limited to 'usr.sbin/ctld/ctld.c')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index ca55063..2eca2d2 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1602,7 +1602,7 @@ conf_apply(struct conf *oldconf, struct conf *newconf) struct portal *oldp, *newp; struct isns *oldns, *newns; pid_t otherpid; - int changed, cumulated_error = 0, error; + int changed, cumulated_error = 0, error, sockbuf; int one = 1; if (oldconf->conf_debug != newconf->conf_debug) { @@ -1899,6 +1899,16 @@ conf_apply(struct conf *oldconf, struct conf *newconf) cumulated_error++; continue; } + sockbuf = SOCKBUF_SIZE; + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_RCVBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_RCVBUF) failed " + "for %s", newp->p_listen); + sockbuf = SOCKBUF_SIZE; + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_SNDBUF, + &sockbuf, sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_SNDBUF) failed " + "for %s", newp->p_listen); error = setsockopt(newp->p_socket, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (error != 0) { |