Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jul 2016 20:39:32 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303507 - head/sys/ofed/drivers/infiniband/ulp/sdp
Message-ID:  <201607292039.u6TKdWkA057835@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Fri Jul 29 20:39:32 2016
New Revision: 303507
URL: https://svnweb.freebsd.org/changeset/base/303507

Log:
  sdp: Use the PCB as the rx completion handler argument.
  
  The generic socket may be detached from the PCB before the completion
  queue is drained and destroyed, so this change closes a race condition
  in connection teardown.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c

Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Fri Jul 29 20:36:01 2016	(r303506)
+++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Fri Jul 29 20:39:32 2016	(r303507)
@@ -665,13 +665,10 @@ sdp_process_rx(struct sdp_sock *ssk)
 static void
 sdp_rx_irq(struct ib_cq *cq, void *cq_context)
 {
-	struct socket *sk = cq_context;
-	struct sdp_sock *ssk = sdp_sk(sk);
+	struct sdp_sock *ssk;
 
-	if (cq != ssk->rx_ring.cq) {
-		sdp_dbg(sk, "cq = %p, ssk->cq = %p\n", cq, ssk->rx_ring.cq);
-		return;
-	}
+	ssk = cq_context;
+	KASSERT(cq == ssk->rx_ring.cq, ("%s: mismatched cq on %p", ssk));
 
 	SDPSTATS_COUNTER_INC(rx_int_count);
 
@@ -728,7 +725,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk,
 	}
 
 	rx_cq = ib_create_cq(device, sdp_rx_irq, sdp_rx_cq_event_handler,
-			  ssk->socket, SDP_RX_SIZE, 0);
+	    ssk, SDP_RX_SIZE, 0);
 
 	if (IS_ERR(rx_cq)) {
 		rc = PTR_ERR(rx_cq);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607292039.u6TKdWkA057835>