From owner-svn-src-all@freebsd.org Tue Jun 14 21:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E28EB72692; Tue, 14 Jun 2016 21:02:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BD427B8; Tue, 14 Jun 2016 21:02:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EL2bOZ016382; Tue, 14 Jun 2016 21:02:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EL2bXb016381; Tue, 14 Jun 2016 21:02:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606142102.u5EL2bXb016381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 14 Jun 2016 21:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301897 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 21:02:38 -0000 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; }