Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2007 00:35:48 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 129854 for review
Message-ID:  <200712010035.lB10ZmXt029975@repoman.freebsd.org>

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

Change 129854 by zec@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;
 



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