summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-07 22:02:59 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-04-07 22:02:59 +0000
commit39e23352646717ff7a344588aaba5b502fba84ac (patch)
treeaefe56fa7886b920f5e9ad5cfee4ca69a6817591 /sys
parent76cc7ea5f7843a41aa3eeb252823072cc413274c (diff)
Remove kernel locks from the ARP input path. Caller if_netisr()
grabs the exclusive netlock and that is sufficent for in_arpinput() and arpcache(). with kn@; OK mvs@; tested by Hrvoje Popovski
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c7
-rw-r--r--sys/netinet/if_ether.c11
2 files changed, 5 insertions, 13 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index dbd9890531f..ab0ec63c61a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.686 2023/04/05 19:35:23 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.687 2023/04/07 22:02:58 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -927,11 +927,8 @@ if_netisr(void *unused)
atomic_clearbits_int(&netisr, n);
#if NETHER > 0
- if (n & (1 << NETISR_ARP)) {
- KERNEL_LOCK();
+ if (n & (1 << NETISR_ARP))
arpintr();
- KERNEL_UNLOCK();
- }
#endif
if (n & (1 << NETISR_IP))
ipintr();
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 46aa3c26acb..56146365e5f 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.260 2023/04/05 21:51:47 bluhm Exp $ */
+/* $OpenBSD: if_ether.c,v 1.261 2023/04/07 22:02:58 bluhm Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -609,12 +609,7 @@ in_arpinput(struct ifnet *ifp, struct mbuf *m)
"address %s\n", addr, ether_sprintf(ea->arp_sha));
itaddr = isaddr;
} else if (rt != NULL) {
- int error;
-
- KERNEL_LOCK();
- error = arpcache(ifp, ea, rt);
- KERNEL_UNLOCK();
- if (error)
+ if (arpcache(ifp, ea, rt))
goto out;
}
@@ -656,7 +651,7 @@ arpcache(struct ifnet *ifp, struct ether_arp *ea, struct rtentry *rt)
time_t uptime;
int changed = 0;
- KERNEL_ASSERT_LOCKED();
+ NET_ASSERT_LOCKED_EXCLUSIVE();
KASSERT(sdl != NULL);
/*