Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2017 19:46:00 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313779 - head/sys/dev/iscsi
Message-ID:  <201702151946.v1FJk057003875@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Feb 15 19:46:00 2017
New Revision: 313779
URL: https://svnweb.freebsd.org/changeset/base/313779

Log:
  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.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/iscsi/icl_soft.c

Modified: head/sys/dev/iscsi/icl_soft.c
==============================================================================
--- head/sys/dev/iscsi/icl_soft.c	Wed Feb 15 18:31:09 2017	(r313778)
+++ head/sys/dev/iscsi/icl_soft.c	Wed Feb 15 19:46:00 2017	(r313779)
@@ -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?201702151946.v1FJk057003875>