Date: Wed, 1 Mar 2017 04:24:30 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314465 - stable/11/sys/dev/iscsi Message-ID: <201703010424.v214OU21019010@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Mar 1 04:24:30 2017 New Revision: 314465 URL: https://svnweb.freebsd.org/changeset/base/314465 Log: MFC r313779: Fix handling of negative sbspace() return values. I found that at least with Chelsio NICs TOE sockets quite often report negative sbspace() values. Using unsigned variable to store it resulted in attempts to aggregate too much data in one sosend() call, that caused errors and following connection termination. Modified: stable/11/sys/dev/iscsi/icl_soft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iscsi/icl_soft.c ============================================================================== --- stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:24 2017 (r314464) +++ stable/11/sys/dev/iscsi/icl_soft.c Wed Mar 1 04:24:30 2017 (r314465) @@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic, { struct icl_pdu *request, *request2; struct socket *so; - size_t available, size, size2; + long available, size, size2; int coalesced, error; ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic, if (available < size) { #if 1 ICL_DEBUG("no space to send; " - "have %zd, need %zd", + "have %ld, need %ld", available, size); #endif so->so_snd.sb_lowat = size; @@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic, } #if 0 if (coalesced > 1) { - ICL_DEBUG("coalesced %d PDUs into %zd bytes", + ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size); } #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703010424.v214OU21019010>