PERFORCE change 129854 for review
Marko Zec
zec at FreeBSD.org
Fri Nov 30 16:35:49 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=129854
Change 129854 by zec at zec_tpx32 on 2007/12/01 00:35:47
In ng_iface, mark mbufs with M_REMOTE_VNET and / or switch the
per-thread vnet context if crossing a vnet boundary.
Affected files ...
.. //depot/projects/vimage/src/sys/netgraph/ng_iface.c#5 edit
Differences ...
==== //depot/projects/vimage/src/sys/netgraph/ng_iface.c#5 (text+ko) ====
@@ -464,6 +464,14 @@
/* Send packet. If hook is not connected,
mbuf will get freed. */
+#ifdef VIMAGE
+ if (ifp->if_vnet != priv->node->nd_vnet) {
+ m->m_flags |= M_REMOTE_VNET;
+ CURVNET_SET_QUIET(priv->node->nd_vnet);
+ NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
+ CURVNET_RESTORE();
+ } else
+#endif
NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
/* Update stats. */
@@ -756,6 +764,12 @@
ifp->if_ipackets++;
ifp->if_ibytes += m->m_pkthdr.len;
+#ifdef VIMAGE
+ /* Mark up the mbuf if crossing vnet boundary */
+ if (ifp->if_vnet != NG_HOOK_NODE(hook)->nd_vnet)
+ m->m_flags |= M_REMOTE_VNET;
+#endif
+
/* Note receiving interface */
m->m_pkthdr.rcvif = ifp;
More information about the p4-projects
mailing list