PERFORCE change 38147 for review

Sam Leffler sam at FreeBSD.org
Tue Sep 16 14:33:48 PDT 2003


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

Change 38147 by sam at sam_ebb on 2003/09/16 14:33:07

	o must make mutex recursive due to the tangled path that ICMP
	  packets take
	o remove bogus Giant assert; we get called from everywhere and
	  cannot assume (for the moment) whether or not Giant is held

Affected files ...

.. //depot/projects/netperf/sys/netinet/ip_dummynet.c#8 edit

Differences ...

==== //depot/projects/netperf/sys/netinet/ip_dummynet.c#8 (text+ko) ====

@@ -165,8 +165,13 @@
 #endif
 
 static struct mtx dummynet_mtx;
+/*
+ * NB: Recursion is needed to deal with re-entry via ICMP.  That is,
+ *     a packet may be dispatched via ip_input from dummynet_io and
+ *     re-enter through ip_output.  Yech.
+ */
 #define	DUMMYNET_LOCK_INIT() \
-	mtx_init(&dummynet_mtx, "dummynet", NULL, MTX_DEF)
+	mtx_init(&dummynet_mtx, "dummynet", NULL, MTX_DEF | MTX_RECURSE)
 #define	DUMMYNET_LOCK_DESTROY()	mtx_destroy(&dummynet_mtx)
 #define	DUMMYNET_LOCK()		mtx_lock(&dummynet_mtx)
 #define	DUMMYNET_UNLOCK()	mtx_unlock(&dummynet_mtx)
@@ -1125,8 +1130,6 @@
     is_pipe = (fwa->rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_PIPE;
 #endif
 
-    mtx_assert(&Giant, MA_NOTOWNED);
-
     pipe_nr &= 0xffff ;
 
     DUMMYNET_LOCK();


More information about the p4-projects mailing list