From aa3ae742c325e5f14f864ae148650f705ca554fb Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 16 Oct 2003 16:21:25 +0000 Subject: Drop dummynet lock when calling back into the network stack to deliver packets. This eliminates a LOR with Giant that caused outbound pipes to fail. Supported by: FreeBSD Foundation --- sys/netinet/ip_dummynet.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/netinet/ip_dummynet.c') diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 23497b6..7353865 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -429,6 +429,8 @@ transmit_event(struct dn_pipe *pipe) { 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 @@ transmit_event(struct dn_pipe *pipe) */ 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 @@ transmit_event(struct dn_pipe *pipe) break ; } free(pkt, M_DUMMYNET); + DUMMYNET_LOCK(); } /* if there are leftover packets, put into the heap for next event */ if ( (pkt = pipe->head) ) -- cgit v1.1