From owner-svn-src-head@freebsd.org Thu Jan 21 00:42:49 2016 Return-Path: Delivered-To: svn-src-head@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 6E158A89259; Thu, 21 Jan 2016 00:42:49 +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 3EAE91CAE; Thu, 21 Jan 2016 00:42:49 +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 u0L0gmUn091984; Thu, 21 Jan 2016 00:42:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0L0gmAK091983; Thu, 21 Jan 2016 00:42:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201601210042.u0L0gmAK091983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 21 Jan 2016 00:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294474 - 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 00:42:49 -0000 Author: np Date: Thu Jan 21 00:42:48 2016 New Revision: 294474 URL: https://svnweb.freebsd.org/changeset/base/294474 Log: iw_cxgbe: fix a couple of problems int the RDMA_TERMINATE handler. a) Look for the CPL in the payload buffer instead of the descriptor. b) Retrieve the socket associated with the tid with the inpcb lock held. Submitted by: Krishnamraju Eraparaju @ Chelsio 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 Wed Jan 20 23:55:39 2016 (r294473) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Jan 21 00:42:48 2016 (r294474) @@ -2365,15 +2365,18 @@ static int fw6_cqe_handler(struct adapte static int terminate(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { - struct adapter *sc = iq->adapter; - - const struct cpl_rdma_terminate *rpl = (const void *)(rss + 1); - unsigned int tid = GET_TID(rpl); + const struct cpl_rdma_terminate *cpl = mtod(m, const void *); + unsigned int tid = GET_TID(cpl); struct c4iw_qp_attributes attrs; struct toepcb *toep = lookup_tid(sc, tid); - struct socket *so = inp_inpcbtosocket(toep->inp); - struct c4iw_ep *ep = so->so_rcv.sb_upcallarg; + struct socket *so; + struct c4iw_ep *ep; + + INP_WLOCK(toep->inp); + so = inp_inpcbtosocket(toep->inp); + ep = so->so_rcv.sb_upcallarg; + INP_WUNLOCK(toep->inp); CTR2(KTR_IW_CXGBE, "%s:tB %p %d", __func__, ep);