PERFORCE change 147511 for review

Marko Zec zec at FreeBSD.org
Sat Aug 16 08:21:44 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=147511

Change 147511 by zec at zec_tpx32 on 2008/08/16 08:21:37

	Unbreax cxgb build, the joys of option VIMAGE landing in
	opt_global.h (but it went much smoother than I anticipated!)

Affected files ...

.. //depot/projects/vimage/src/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c#2 edit
.. //depot/projects/vimage/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#7 edit

Differences ...

==== //depot/projects/vimage/src/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c#2 (text+ko) ====

@@ -53,7 +53,9 @@
 #include <sys/taskqueue.h>
 #include <sys/proc.h>
 #include <sys/eventhandler.h>
+#include <sys/vimage.h>
 
+#include <net/vnet.h>
 #include <net/if.h>
 #include <net/if_var.h>
 
@@ -237,9 +239,12 @@
 
 	/* Register existing TOE interfaces by walking the ifnet chain */
 	IFNET_RLOCK();
-	TAILQ_FOREACH(ifp, &ifnet, if_link) {
+	VNET_ITERLOOP_BEGIN();
+	INIT_VNET_NET(curvnet);
+	TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
 		(void)ifaddr_event_handler(NULL, ifp);
 	}
+	VNET_ITERLOOP_END();
 	IFNET_RUNLOCK();
 	return 0;
 }

==== //depot/projects/vimage/src/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#7 (text+ko) ====

@@ -48,10 +48,12 @@
 #include <sys/syslog.h>
 #include <sys/protosw.h>
 #include <sys/priv.h>
+#include <sys/vimage.h>
 
 #include <net/if.h>
 #include <net/route.h>
 
+#include <netinet/vinet.h>
 #include <netinet/in.h>
 #include <netinet/in_pcb.h>
 #include <netinet/in_systm.h>
@@ -262,6 +264,7 @@
 static inline void
 make_tx_data_wr(struct socket *so, struct mbuf *m, int len, struct mbuf *tail)
 {
+	INIT_VNET_INET(so->so_vnet);
 	struct tcpcb *tp = so_sototcpcb(so);
 	struct toepcb *toep = tp->t_toe;
 	struct tx_data_wr *req;
@@ -289,8 +292,8 @@
  
 		/* Sendbuffer is in units of 32KB.
 		 */
-		if (tcp_do_autosndbuf && snd->sb_flags & SB_AUTOSIZE) 
-			req->param |= htonl(V_TX_SNDBUF(tcp_autosndbuf_max >> 15));
+		if (V_tcp_do_autosndbuf && snd->sb_flags & SB_AUTOSIZE) 
+			req->param |= htonl(V_TX_SNDBUF(V_tcp_autosndbuf_max >> 15));
 		else {
 			req->param |= htonl(V_TX_SNDBUF(snd->sb_hiwat >> 15));
 		}
@@ -1223,6 +1226,7 @@
 static unsigned long
 select_rcv_wnd(struct toedev *dev, struct socket *so)
 {
+	INIT_VNET_INET(so->so_vnet);
 	struct tom_data *d = TOM_DATA(dev);
 	unsigned int wnd;
 	unsigned int max_rcv_wnd;
@@ -1230,8 +1234,8 @@
 
 	rcv = so_sockbuf_rcv(so);
 	
-	if (tcp_do_autorcvbuf)
-		wnd = tcp_autorcvbuf_max;
+	if (V_tcp_do_autorcvbuf)
+		wnd = V_tcp_autorcvbuf_max;
 	else
 		wnd = rcv->sb_hiwat;
 
@@ -3768,6 +3772,7 @@
 static void
 socket_act_establish(struct socket *so, struct mbuf *m)
 {
+	INIT_VNET_INET(so->so_vnet);
 	struct cpl_act_establish *req = cplhdr(m);
 	u32 rcv_isn = ntohl(req->rcv_isn);	/* real RCV_ISN + 1 */
 	struct tcpcb *tp = so_sototcpcb(so);
@@ -3817,7 +3822,7 @@
 #endif
 
 	toep->tp_state = tp->t_state;
-	tcpstat.tcps_connects++;
+	V_tcpstat.tcps_connects++;
 				
 }
 


More information about the p4-projects mailing list