From owner-svn-src-all@FreeBSD.ORG Thu Nov 15 19:45:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7622CB91; Thu, 15 Nov 2012 19:45:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 405BD8FC08; Thu, 15 Nov 2012 19:45:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFJj5cr045862; Thu, 15 Nov 2012 19:45:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFJj5NE045860; Thu, 15 Nov 2012 19:45:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201211151945.qAFJj5NE045860@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 15 Nov 2012 19:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243098 - stable/9/sys/dev/cxgbe/tom X-SVN-Group: stable-9 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.14 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: Thu, 15 Nov 2012 19:45:05 -0000 Author: np Date: Thu Nov 15 19:45:04 2012 New Revision: 243098 URL: http://svnweb.freebsd.org/changeset/base/243098 Log: MFC r242666, r242671. r242666: Remove the tid from the software table (and bump down the in-use counter) when the syncache doesn't want the driver to reply to an incoming SYN. This fixes a harmless bug where tids_in_use would go out of sync with the hardware counter. r242671: Make sure the inp hasn't been dropped before trying to access its socket and tcpcb. Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 15 19:27:11 2012 (r243097) +++ stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 15 19:45:04 2012 (r243098) @@ -982,7 +982,6 @@ do_abort_req(struct sge_iq *iq, const st struct sge_wrq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; - struct socket *so; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1008,7 +1007,6 @@ do_abort_req(struct sge_iq *iq, const st INP_WLOCK(inp); tp = intotcpcb(inp); - so = inp->inp_socket; CTR6(KTR_CXGBE, "%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d", @@ -1026,10 +1024,16 @@ do_abort_req(struct sge_iq *iq, const st } toep->flags |= TPF_ABORT_SHUTDOWN; - so_error_set(so, abort_status_to_errno(tp, cpl->status)); - tp = tcp_close(tp); - if (tp == NULL) - INP_WLOCK(inp); /* re-acquire */ + if ((inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) == 0) { + struct socket *so = inp->inp_socket; + + if (so != NULL) + so_error_set(so, abort_status_to_errno(tp, + cpl->status)); + tp = tcp_close(tp); + if (tp == NULL) + INP_WLOCK(inp); /* re-acquire */ + } final_cpl_received(toep); done: Modified: stable/9/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 15 19:27:11 2012 (r243097) +++ stable/9/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 15 19:45:04 2012 (r243098) @@ -1202,6 +1202,7 @@ do_pass_accept_req(struct sge_iq *iq, co if (m) m->m_pkthdr.rcvif = ifp; + remove_tid(sc, synqe->tid); release_synqe(synqe); /* about to exit function */ free(wr, M_CXGBE); REJECT_PASS_ACCEPT();