diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-12-19 08:36:51 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-12-19 08:36:51 +0000 |
commit | 347b9bada49618963c84880ec8c3c23c96aa0017 (patch) | |
tree | d431218ec3017a484e7de695c002a79a0e68cc86 /sys/netinet/ip_icmp.c | |
parent | c22be17b5bebb223df391aa82dfc7704004aafa7 (diff) |
Introduce the NET_LOCK() a rwlock used to serialize accesses to the parts
of the network stack that are not yet ready to be executed in parallel or
where new sleeping points are not possible.
This first pass replace all the entry points leading to ip_output(). This
is done to not introduce new sleeping points when trying to acquire ART's
write lock, needed when a new L2 entry is created via the RT_RESOLVE.
Inputs from and ok bluhm@, ok dlg@
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index d5507922af0..56df4adc6d0 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.157 2016/11/28 14:14:39 mpi Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.158 2016/12/19 08:36:49 mpi Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -884,7 +884,7 @@ icmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, if (namelen != 1) return (ENOTDIR); - s = splsoftnet(); + NET_LOCK(s); switch (name[0]) { case ICMPCTL_REDIRTIMEOUT: @@ -921,7 +921,7 @@ icmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, error = ENOPROTOOPT; break; } - splx(s); + NET_UNLOCK(s); return (error); } @@ -1052,7 +1052,7 @@ icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r) { struct ifnet *ifp; - splsoftassert(IPL_SOFTNET); + NET_ASSERT_LOCKED(); ifp = if_get(rt->rt_ifidx); if (ifp == NULL) @@ -1102,7 +1102,7 @@ icmp_redirect_timeout(struct rtentry *rt, struct rttimer *r) { struct ifnet *ifp; - splsoftassert(IPL_SOFTNET); + NET_ASSERT_LOCKED(); ifp = if_get(rt->rt_ifidx); if (ifp == NULL) |