Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2008 15:44:29 GMT
From:      Steve Wise <swise@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 135724 for review
Message-ID:  <200802191544.m1JFiTSt062090@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=135724

Change 135724 by swise@swise:vic10:iwarp on 2008/02/19 15:44:09

	Set SO_NO_DDP for rdma sockets.

Affected files ...

.. //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c#4 edit
.. //depot/projects/iwarp/sys/kern/uipc_socket.c#4 edit

Differences ...

==== //depot/projects/iwarp/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c#4 (text+ko) ====

@@ -647,6 +647,11 @@
 		goto err;
 	}
 
+	if (ep->com.so->so_rcv.sb_mb) {
+		printf("%s data after soreceive called! so %p sb_mb %p top %p\n", 
+			__FUNCTION__, ep->com.so, ep->com.so->so_rcv.sb_mb, top);
+	}
+		
 	m = top;
 	do {
 		/*
@@ -1282,6 +1287,9 @@
 static int create_sock(struct iwch_ep_common *epc)
 {
 	int err;
+	struct sockopt sopt;
+	int on=1;
+
 	err = socreate(AF_INET, &epc->so, SOCK_STREAM, IPPROTO_TCP, 
 		epc->thread->td_ucred, epc->thread);
 	if (err)
@@ -1290,6 +1298,19 @@
 	epc->so->so_upcallarg = epc;
 	epc->so->so_rcv.sb_flags |= SB_UPCALL;
 	epc->so->so_state |= SS_NBIO;
+
+	PDBG("%s ep %p so %p state %s\n", __FUNCTION__, ep, ep->com.so, states[ep->com.state]);
+
+	sopt.sopt_dir = SOPT_SET;
+	sopt.sopt_level = SOL_SOCKET;
+	sopt.sopt_name = SO_NO_DDP;
+	sopt.sopt_val = (caddr_t)&on;
+	sopt.sopt_valsize = sizeof on;
+	sopt.sopt_td = NULL;
+	err = sosetopt(epc->so, &sopt);
+	if (err) 
+		printf("%s can't set SO_NO_DDP err %d\n", __FUNCTION__, err);
+
 	return 0;
 }
 
@@ -1526,8 +1547,9 @@
 	default:
 		if (ep->com.so->so_rcv.sb_cc) 
 			printf("%s Unexpected streaming data."
-			       " ep %p state %d so %p\n",
-			       __FUNCTION__, ep, state_read(&ep->com), ep->com.so);
+			       " ep %p state %d so %p so_state %x so_rcv.sb_cc %u so_rcv.sb_mb %p\n",
+			       __FUNCTION__, ep, state_read(&ep->com), ep->com.so, ep->com.so->so_state,
+			       ep->com.so->so_rcv.sb_cc, ep->com.so->so_rcv.sb_mb);
 		break;
 	}
 	return;

==== //depot/projects/iwarp/sys/kern/uipc_socket.c#4 (text+ko) ====

@@ -2015,6 +2015,8 @@
 		case SO_TIMESTAMP:
 		case SO_BINTIME:
 		case SO_NOSIGPIPE:
+		case SO_NO_DDP:
+		case SO_NO_OFFLOAD:
 			error = sooptcopyin(sopt, &optval, sizeof optval,
 					    sizeof optval);
 			if (error)



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