PERFORCE change 39765 for review

Sam Leffler sam at FreeBSD.org
Wed Oct 15 20:43:43 PDT 2003


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

Change 39765 by sam at sam_ebb on 2003/10/15 20:43:00

	Workaround a LOR between Giant and the dummynet lock
	by dropping the dummynet lock each time we re-enter
	the network stack.  This can be removed when the stack
	no longer depends on Giant.

Affected files ...

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

Differences ...

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

@@ -429,6 +429,8 @@
 {
     struct dn_pkt *pkt ;
 
+    DUMMYNET_LOCK_ASSERT();
+
     while ( (pkt = pipe->head) && DN_KEY_LEQ(pkt->output_time, curr_time) ) {
 	/*
 	 * first unlink, then call procedures, since ip_input() can invoke
@@ -436,6 +438,8 @@
 	 */
 	pipe->head = DN_NEXT(pkt) ;
 
+	/* XXX: drop the lock for now to avoid LOR's */
+	DUMMYNET_UNLOCK();
 	/*
 	 * The actual mbuf is preceded by a struct dn_pkt, resembling an mbuf
 	 * (NOT A REAL one, just a small block of malloc'ed memory) with
@@ -496,6 +500,7 @@
 	    break ;
 	}
 	free(pkt, M_DUMMYNET);
+	DUMMYNET_LOCK();
     }
     /* if there are leftover packets, put into the heap for next event */
     if ( (pkt = pipe->head) )


More information about the p4-projects mailing list