Now that if_start() will take the KERNEL_LOCK itself if the driver is
not marked as IFXF_MPSAFE if_enqueue() is almost mpsafe.
The missing piece is addressed by the diff below. We want to ensure
bridge_output() is called with the KERNEL_LOCK() held.
ok?
Index: net/if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.420
diff -u -p -r1.420 if.c
--- net/if.c 3 Dec 2015 16:27:32 -0000 1.420
+++ net/if.c 4 Dec 2015 10:28:30 -0000
@@ -626,8 +626,12 @@ if_enqueue(struct ifnet *ifp, struct mbu
unsigned short mflags;
#if NBRIDGE > 0
- if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0)
- return (bridge_output(ifp, m, NULL, NULL));
+ if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) {
+ KERNEL_LOCK();
+ error = bridge_output(ifp, m, NULL, NULL);
+ KERNEL_UNLOCK();
+ return (error);
+ }
#endif
length = m->m_pkthdr.len;