svn commit: r294474 - head/sys/dev/cxgbe/iw_cxgbe
Navdeep Parhar
np at FreeBSD.org
Thu Jan 21 00:42:49 UTC 2016
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);
More information about the svn-src-all
mailing list