diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-04-28 22:15:59 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-04-28 22:15:59 +0000 |
commit | 18fddbc0ffa78e2efee3b7db27bfe5c5f8c46545 (patch) | |
tree | 62f22d322f0aa70d58dfb4b7448324845a27e611 /sys/net/if.c | |
parent | 33d544b49816a3e9c53b23a441cbbb44ca3e7104 (diff) |
Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.
This redefines the ifp <-> bridge relationship. No lock can be
currently used across the multiples contexts where the bridge has
tentacles to protect a pointer, use an interface index.
Tested by various, ok dlg@, visa@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 9285372af00..8b7d7075cdf 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.580 2019/04/22 03:26:16 dlg Exp $ */ +/* $OpenBSD: if.c,v 1.581 2019/04/28 22:15:57 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -695,12 +695,10 @@ if_enqueue(struct ifnet *ifp, struct mbuf *m) #endif #if NBRIDGE > 0 - if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) { + if (ifp->if_bridgeidx && (m->m_flags & M_PROTO1) == 0) { int error; - KERNEL_LOCK(); - error = bridge_output(ifp, m, NULL, NULL); - KERNEL_UNLOCK(); + error = bridge_enqueue(ifp, m); return (error); } #endif @@ -1194,7 +1192,7 @@ if_isconnected(const struct ifnet *ifp0, unsigned int ifidx) connected = 1; #if NBRIDGE > 0 - if (SAME_BRIDGE(ifp0->if_bridgeport, ifp->if_bridgeport)) + if (ifp0->if_bridgeidx == ifp->if_bridgeidx) connected = 1; #endif #if NCARP > 0 |