Module Name: src
Committed By: ozaki-r
Date: Mon Jan 23 10:19:03 UTC 2017
Modified Files:
src/sys/net: if.c if_bridge.c
src/sys/netinet: in.c
src/sys/netinet6: in6.c
Log Message:
Replace some splnet with splsoftnet
To generate a diff of this commit:
cvs rdiff -u -r1.372 -r1.373 src/sys/net/if.c
cvs rdiff -u -r1.131 -r1.132 src/sys/net/if_bridge.c
cvs rdiff -u -r1.196 -r1.197 src/sys/netinet/in.c
cvs rdiff -u -r1.236 -r1.237 src/sys/netinet6/in6.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.372 src/sys/net/if.c:1.373
--- src/sys/net/if.c:1.372 Fri Jan 20 08:35:33 2017
+++ src/sys/net/if.c Mon Jan 23 10:19:03 2017
@@ -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, stru
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
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,
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);
}
Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.131 src/sys/net/if_bridge.c:1.132
--- src/sys/net/if_bridge.c:1.131 Thu Sep 15 14:40:43 2016
+++ src/sys/net/if_bridge.c Mon Jan 23 10:19:03 2017
@@ -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, 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 c
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 c
break;
}
- s = splnet();
+ s = splsoftnet();
switch (cmd) {
case SIOCGDRVSPEC:
@@ -552,7 +552,7 @@ bridge_ioctl(struct ifnet *ifp, u_long c
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
mc->m_flags &= ~M_PROMISC;
#ifndef NET_MPSAFE
- s = splnet();
+ s = splsoftnet();
#endif
ether_input(dst_if, mc);
#ifndef NET_MPSAFE
Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.196 src/sys/netinet/in.c:1.197
--- src/sys/netinet/in.c:1.196 Mon Jan 16 07:33:36 2017
+++ src/sys/netinet/in.c Mon Jan 23 10:19:03 2017
@@ -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_i
* 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. */
Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.236 src/sys/netinet6/in6.c:1.237
--- src/sys/netinet6/in6.c:1.236 Mon Jan 16 15:44:47 2017
+++ src/sys/netinet6/in6.c Mon Jan 23 10:19:03 2017
@@ -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 c
* 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 cm
break;
}
- s = splnet();
+ s = splsoftnet();
#ifndef NET_MPSAFE
mutex_enter(softnet_lock);
#endif
@@ -782,7 +782,7 @@ in6_control(struct socket *so, u_long cm
* 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
{
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
const struct sockaddr_in6 *sin6, int newhost)
{
int error = 0, ifacount = 0;
- int s = splnet();
+ int s = splsoftnet();
struct ifaddr *ifa;
/*