Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2007 14:53:57 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125175 for review
Message-ID:  <200708151453.l7FErviu089304@repoman.freebsd.org>

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

Change 125175 by zec@zec_tpx32 on 2007/08/15 14:53:40

	Clear the M_REMOTE_VNET mbuf flag once it has been used
	for defering the direct netisr dispatch.
	
	While here, do style-fixing on a few asserts.

Affected files ...

.. //depot/projects/vimage/src/sys/net/netisr.c#7 edit

Differences ...

==== //depot/projects/vimage/src/sys/net/netisr.c#7 (text+ko) ====

@@ -143,7 +143,7 @@
 		IF_DEQUEUE(ni->ni_queue, m);
 		if (m == NULL)
 			break;
-		VNET_ASSERT(m->m_pkthdr.rcvif);
+		VNET_ASSERT(m->m_pkthdr.rcvif != NULL);
 		CURVNET_SET(m->m_pkthdr.rcvif->if_vnet);
 		ni->ni_handler(m);
 		CURVNET_RESTORE();
@@ -167,6 +167,7 @@
 		m_freem(m);
 		return;
 	}
+	VNET_ASSERT(m->m_pkthdr.rcvif != NULL)
 	/*
 	 * Do direct dispatch only for MPSAFE netisrs (and
 	 * only when enabled).  Note that when a netisr is
@@ -201,6 +202,15 @@
 		 */
 		ni->ni_handler(m);
 	} else {
+#ifdef VIMAGE
+		/*
+		 * Once direct netisr dispatching is avoided using the 
+		 * M_REMOTE_VNET flag, it should not be observed any
+		 * more, so clear it here in order to avoid further
+		 * defering of direct netisr dispatching.
+		 */
+		m->m_flags &= ~M_REMOTE_VNET;
+#endif
 		isrstat.isrs_deferred++;
 		if (IF_HANDOFF(ni->ni_queue, m, NULL))
 			schednetisr(num);
@@ -227,7 +237,10 @@
 		m_freem(m);
 		return (ENXIO);
 	}
-	VNET_ASSERT(m->m_pkthdr.rcvif)
+	VNET_ASSERT(m->m_pkthdr.rcvif != NULL)
+#ifdef VIMAGE
+	m->m_flags &= ~M_REMOTE_VNET;
+#endif
 	isrstat.isrs_queued++;
 	if (!IF_HANDOFF(ni->ni_queue, m, NULL))
 		return (ENOBUFS);	/* IF_HANDOFF has free'd the mbuf */



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