svn commit: r331599 - projects/bsd_rdma_4_9_stable_11/sys/dev/cxgbe/iw_cxgbe

Navdeep Parhar np at FreeBSD.org
Mon Mar 26 22:39:49 UTC 2018


Author: np
Date: Mon Mar 26 22:39:48 2018
New Revision: 331599
URL: https://svnweb.freebsd.org/changeset/base/331599

Log:
  Use soupcall_set/clear because listen-only sockets are available in
  FreeBSD 12+ only.
  
  Sponsored by:	Chelsio Communications

Modified:
  projects/bsd_rdma_4_9_stable_11/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: projects/bsd_rdma_4_9_stable_11/sys/dev/cxgbe/iw_cxgbe/cm.c
==============================================================================
--- projects/bsd_rdma_4_9_stable_11/sys/dev/cxgbe/iw_cxgbe/cm.c	Mon Mar 26 22:31:29 2018	(r331598)
+++ projects/bsd_rdma_4_9_stable_11/sys/dev/cxgbe/iw_cxgbe/cm.c	Mon Mar 26 22:39:48 2018	(r331599)
@@ -846,31 +846,20 @@ setiwsockopt(struct socket *so)
 static void
 init_iwarp_socket(struct socket *so, void *arg)
 {
-	if (SOLISTENING(so)) {
-		SOLISTEN_LOCK(so);
-		solisten_upcall_set(so, c4iw_so_upcall, arg);
-		so->so_state |= SS_NBIO;
-		SOLISTEN_UNLOCK(so);
-	} else {
-		SOCKBUF_LOCK(&so->so_rcv);
-		soupcall_set(so, SO_RCV, c4iw_so_upcall, arg);
-		so->so_state |= SS_NBIO;
-		SOCKBUF_UNLOCK(&so->so_rcv);
-	}
+
+	SOCKBUF_LOCK(&so->so_rcv);
+	soupcall_set(so, SO_RCV, c4iw_so_upcall, arg);
+	so->so_state |= SS_NBIO;
+	SOCKBUF_UNLOCK(&so->so_rcv);
 }
 
 static void
 uninit_iwarp_socket(struct socket *so)
 {
-	if (SOLISTENING(so)) {
-		SOLISTEN_LOCK(so);
-		solisten_upcall_set(so, NULL, NULL);
-		SOLISTEN_UNLOCK(so);
-	} else {
-		SOCKBUF_LOCK(&so->so_rcv);
-		soupcall_clear(so, SO_RCV);
-		SOCKBUF_UNLOCK(&so->so_rcv);
-	}
+
+	SOCKBUF_LOCK(&so->so_rcv);
+	soupcall_clear(so, SO_RCV);
+	SOCKBUF_UNLOCK(&so->so_rcv);
 }
 
 static void


More information about the svn-src-projects mailing list