Replace some splnet with splsoftnet

This commit is contained in:
ozaki-r 2017-01-23 10:19:03 +00:00
parent e9b008839d
commit c26964ba3f
4 changed files with 29 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.372 2017/01/20 08:35:33 ozaki-r Exp $ */
/* $NetBSD: if.c,v 1.373 2017/01/23 10:19:03 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.372 2017/01/20 08:35:33 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.373 2017/01/23 10:19:03 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -526,7 +526,7 @@ if_activate_sadl(struct ifnet *ifp, struct ifaddr *ifa0,
struct ifaddr *ifa;
int bound = curlwp_bind();
s = splnet();
s = splsoftnet();
if_deactivate_sadl(ifp);
@ -567,7 +567,7 @@ if_free_sadl(struct ifnet *ifp)
KASSERT(ifp->if_sadl != NULL);
s = splnet();
s = splsoftnet();
rtinit(ifa, RTM_DELETE, 0);
ifa_remove(ifp, ifa);
if_deactivate_sadl(ifp);
@ -1126,7 +1126,7 @@ if_attachdomain1(struct ifnet *ifp)
struct domain *dp;
int s;
s = splnet();
s = splsoftnet();
/* address family dependent data region */
memset(ifp->if_afdata, 0, sizeof(ifp->if_afdata));
@ -1148,7 +1148,7 @@ if_deactivate(struct ifnet *ifp)
{
int s;
s = splnet();
s = splsoftnet();
ifp->if_output = if_nulloutput;
ifp->_if_input = if_nullinput;
@ -2450,7 +2450,7 @@ if_slowtimo(void *arg)
if (__predict_false(slowtimo == NULL))
return;
s = splnet();
s = splsoftnet();
if (ifp->if_timer != 0 && --ifp->if_timer == 0)
(*slowtimo)(ifp);
@ -2720,12 +2720,12 @@ ifioctl_common(struct ifnet *ifp, u_long cmd, void *data)
case SIOCSIFFLAGS:
ifr = data;
if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
s = splnet();
s = splsoftnet();
if_down(ifp);
splx(s);
}
if (ifr->ifr_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) {
s = splnet();
s = splsoftnet();
if_up(ifp);
splx(s);
}
@ -3026,7 +3026,7 @@ doifioctl(struct socket *so, u_long cmd, void *data, struct lwp *l)
if (((oif_flags ^ ifp->if_flags) & IFF_UP) != 0) {
if ((ifp->if_flags & IFF_UP) != 0) {
int s = splnet();
int s = splsoftnet();
if_up(ifp);
splx(s);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_bridge.c,v 1.131 2016/09/15 14:40:43 christos Exp $ */
/* $NetBSD: if_bridge.c,v 1.132 2017/01/23 10:19:03 ozaki-r Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.131 2016/09/15 14:40:43 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.132 2017/01/23 10:19:03 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_bridge_ipf.h"
@ -205,7 +205,7 @@ __CTASSERT(offsetof(struct ifbifconf, ifbic_buf) == offsetof(struct ifbaconf, if
#define ACQUIRE_GLOBAL_LOCKS() do { \
KERNEL_LOCK(1, NULL); \
mutex_enter(softnet_lock); \
__s = splnet(); \
__s = splsoftnet(); \
} while (0)
#define RELEASE_GLOBAL_LOCKS() do { \
splx(__s); \
@ -456,7 +456,7 @@ bridge_clone_destroy(struct ifnet *ifp)
struct bridge_iflist *bif;
int s;
s = splnet();
s = splsoftnet();
bridge_stop(ifp, 1);
@ -509,7 +509,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
const struct bridge_control *bc = NULL; /* XXXGCC */
int s, error = 0;
/* Authorize command before calling splnet(). */
/* Authorize command before calling splsoftnet(). */
switch (cmd) {
case SIOCGDRVSPEC:
case SIOCSDRVSPEC:
@ -535,7 +535,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break;
}
s = splnet();
s = splsoftnet();
switch (cmd) {
case SIOCGDRVSPEC:
@ -552,7 +552,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
break;
}
/* BC_F_SUSER is checked above, before splnet(). */
/* BC_F_SUSER is checked above, before splsoftnet(). */
if ((bc->bc_flags & (BC_F_XLATEIN|BC_F_XLATEOUT)) == 0
&& (ifd->ifd_len != bc->bc_argsize
@ -1548,7 +1548,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa,
mc->m_flags &= ~M_PROMISC;
#ifndef NET_MPSAFE
s = splnet();
s = splsoftnet();
#endif
ether_input(dst_if, mc);
#ifndef NET_MPSAFE

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.196 2017/01/16 07:33:36 ryo Exp $ */
/* $NetBSD: in.c,v 1.197 2017/01/23 10:19:03 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.196 2017/01/16 07:33:36 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.197 2017/01/23 10:19:03 ozaki-r Exp $");
#include "arp.h"
@ -1132,7 +1132,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia,
* if this is its first address,
* and to validate the address if necessary.
*/
s = splnet();
s = splsoftnet();
error = if_addr_init(ifp, &ia->ia_ifa, true);
splx(s);
/* Now clear the try tentative flag, it's job is done. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.236 2017/01/16 15:44:47 christos Exp $ */
/* $NetBSD: in6.c,v 1.237 2017/01/23 10:19:03 ozaki-r Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.236 2017/01/16 15:44:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.237 2017/01/23 10:19:03 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -705,7 +705,7 @@ in6_control1(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
* make (ia == NULL) or update (ia != NULL) the interface
* address structure, and link it to the list.
*/
int s = splnet();
int s = splsoftnet();
error = in6_update_ifa1(ifp, ifra, &ia, &psref, 0);
splx(s);
if (error)
@ -766,7 +766,7 @@ in6_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
break;
}
s = splnet();
s = splsoftnet();
#ifndef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
@ -782,7 +782,7 @@ in6_control(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
* Update parameters of an IPv6 interface address.
* If necessary, a new entry is created and linked into address chains.
* This function is separated from in6_control().
* XXX: should this be performed under splnet()?
* XXX: should this be performed under splsoftnet()?
*/
static int
in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra,
@ -1322,7 +1322,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, int flags)
{
int rc, s;
s = splnet();
s = splsoftnet();
rc = in6_update_ifa1(ifp, ifra, NULL, NULL, flags);
splx(s);
return rc;
@ -1362,7 +1362,7 @@ in6_purgeaddr(struct ifaddr *ifa)
static void
in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
{
int s = splnet();
int s = splsoftnet();
mutex_enter(&in6_ifaddr_lock);
IN6_ADDRLIST_WRITER_REMOVE(ia);
@ -1707,7 +1707,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
const struct sockaddr_in6 *sin6, int newhost)
{
int error = 0, ifacount = 0;
int s = splnet();
int s = splsoftnet();
struct ifaddr *ifa;
/*