summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2018-09-26 11:50:42 +0000
committermpi <mpi@openbsd.org>2018-09-26 11:50:42 +0000
commitb81d780792d795a16da2001df3c53e3f7911d190 (patch)
tree97e64cb1bd7f3ba1cc6eaed67feb45f911b280ab /sys/net/if.c
parentAdd variables for setup and cleanup of regression tests. (diff)
downloadwireguard-openbsd-b81d780792d795a16da2001df3c53e3f7911d190.tar.xz
wireguard-openbsd-b81d780792d795a16da2001df3c53e3f7911d190.zip
Move bridge input/output paths outside of the KERNEL_LOCK().
Tested by Hrvoje Popovski who measured a 30% improvement of forwarded packets in the best case. ok visa@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 78d7d3f3af6..98063c8862c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.564 2018/09/11 10:23:40 krw Exp $ */
+/* $OpenBSD: if.c,v 1.565 2018/09/26 11:50:42 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -692,12 +692,8 @@ if_enqueue(struct ifnet *ifp, struct mbuf *m)
#endif
#if NBRIDGE > 0
- if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) {
- KERNEL_LOCK();
- error = bridge_output(ifp, m, NULL, NULL);
- KERNEL_UNLOCK();
- return (error);
- }
+ if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0)
+ return (bridge_output(ifp, m, NULL, NULL));
#endif
#if NPF > 0
@@ -963,11 +959,8 @@ if_netisr(void *unused)
}
#endif
#if NBRIDGE > 0
- if (n & (1 << NETISR_BRIDGE)) {
- KERNEL_LOCK();
+ if (n & (1 << NETISR_BRIDGE))
bridgeintr();
- KERNEL_UNLOCK();
- }
#endif
#if NSWITCH > 0
if (n & (1 << NETISR_SWITCH)) {