svn commit: r301897 - head/sys/dev/cxgbe/iw_cxgbe

Navdeep Parhar np at FreeBSD.org
Tue Jun 14 21:02:38 UTC 2016


Author: np
Date: Tue Jun 14 21:02:36 2016
New Revision: 301897
URL: https://svnweb.freebsd.org/changeset/base/301897

Log:
  iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN.
  Release the hold on ep->com immediately after sending the RST.  This
  fixes a bug that sometimes leaves userspace iWARP tools hung when the
  user presses ^C.
  
  Submitted by:	Krishnamraju Eraparaju @ Chelsio
  Approved by:	re (gjb@)
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==============================================================================
--- head/sys/dev/cxgbe/iw_cxgbe/cm.c	Tue Jun 14 20:58:05 2016	(r301896)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.c	Tue Jun 14 21:02:36 2016	(r301897)
@@ -760,7 +760,7 @@ process_socket_event(struct c4iw_ep *ep)
 	}
 
 	/* peer close */
-	if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state < CLOSING) {
+	if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) {
 		process_peer_close(ep);
 		return;
 	}
@@ -1223,9 +1223,23 @@ static int send_abort(struct c4iw_ep *ep
 
 	CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep);
 	abort_socket(ep);
-	err = close_socket(&ep->com, 0);
+
+	/*
+	 * Since socket options were set as l_onoff=1 and l_linger=0 in in
+	 * abort_socket, invoking soclose here sends a RST (reset) to the peer.
+	 */
+	err = close_socket(&ep->com, 1);
 	set_bit(ABORT_CONN, &ep->com.history);
 	CTR2(KTR_IW_CXGBE, "%s:abE %p", __func__, ep);
+
+	/*
+	 * TBD: iw_cgbe driver should receive ABORT reply for every ABORT
+	 * request it has sent. But the current TOE driver is not propagating
+	 * this ABORT reply event (via do_abort_rpl) to iw_cxgbe. So as a work-
+	 * around de-refer 'ep' (which was refered before sending ABORT request)
+	 * here instead of doing it in abort_rpl() handler of iw_cxgbe driver.
+	 */
+	c4iw_put_ep(&ep->com);
 	return err;
 }
 


More information about the svn-src-all mailing list