PERFORCE change 160728 for review
Marko Zec
zec at FreeBSD.org
Fri Apr 17 00:29:47 PDT 2009
http://perforce.freebsd.org/chv.cgi?CH=160728
Change 160728 by zec at zec_amdx2 on 2009/04/17 07:29:34
Populate vnet backpointers in various embedded per-vnet
structs, which are user to set per-vnet-module base pointers
such as INIT_VNET_INET(tp->t_vnet).
At this point the vimage-commit2 branch builds, boots and works
quite happily both as GENERIC as well as with options VIMAGE.
Submitted from: amdx2 8.0-CURRENT /p4/vc2_compile/sys/VIMAGE
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#25 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/raw_ip.c#26 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#47 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#33 edit
.. //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#34 edit
Differences ...
==== //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#25 (text+ko) ====
@@ -162,6 +162,9 @@
INP_INFO_LOCK_INIT(&V_divcbinfo, "div");
LIST_INIT(&V_divcb);
V_divcbinfo.ipi_listhead = &V_divcb;
+#ifdef VIMAGE
+ V_divcbinfo.ipi_vnet = curvnet;
+#endif
/*
* XXX We don't use the hash list for divert IP, but it's easier
* to allocate a one entry hash list than it is to check all
==== //depot/projects/vimage-commit2/src/sys/netinet/raw_ip.c#26 (text+ko) ====
@@ -187,6 +187,9 @@
INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip");
LIST_INIT(&V_ripcb);
+#ifdef VIMAGE
+ V_ripcbinfo.ipi_vnet = curvnet;
+#endif
V_ripcbinfo.ipi_listhead = &V_ripcb;
V_ripcbinfo.ipi_hashbase =
hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, &V_ripcbinfo.ipi_hashmask);
==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#47 (text+ko) ====
@@ -359,6 +359,9 @@
INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp");
LIST_INIT(&V_tcb);
+#ifdef VIMAGE
+ V_tcbinfo.ipi_vnet = curvnet;
+#endif
V_tcbinfo.ipi_listhead = &V_tcb;
hashsize = TCBHASHSIZE;
TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize);
@@ -703,6 +706,9 @@
if (tm == NULL)
return (NULL);
tp = &tm->tcb;
+#ifdef VIMAGE
+ tp->t_vnet = inp->inp_vnet;
+#endif
tp->t_timers = &tm->tt;
/* LIST_INIT(&tp->t_segq); */ /* XXX covered by M_ZERO */
tp->t_maxseg = tp->t_maxopd =
==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#33 (text+ko) ====
@@ -259,6 +259,9 @@
/* Initialize the hash buckets. */
for (i = 0; i < V_tcp_syncache.hashsize; i++) {
+#ifdef VIMAGE
+ V_tcp_syncache.hashbase[i].sch_vnet = curvnet;
+#endif
TAILQ_INIT(&V_tcp_syncache.hashbase[i].sch_bucket);
mtx_init(&V_tcp_syncache.hashbase[i].sch_mtx, "tcp_sc_head",
NULL, MTX_DEF);
==== //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#34 (text+ko) ====
@@ -179,6 +179,9 @@
INP_INFO_LOCK_INIT(&V_udbinfo, "udp");
LIST_INIT(&V_udb);
+#ifdef VIMAGE
+ V_udbinfo.ipi_vnet = curvnet;
+#endif
V_udbinfo.ipi_listhead = &V_udb;
V_udbinfo.ipi_hashbase = hashinit(UDBHASHSIZE, M_PCB,
&V_udbinfo.ipi_hashmask);
More information about the p4-projects
mailing list