apply if_start_lock() to L2 callers which call ifp->if_start() of device derivers

This commit is contained in:
knakahara 2016-06-20 08:30:58 +00:00
parent 910b5ef147
commit 69c0ff04b9
8 changed files with 29 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_cbq.c,v 1.29 2016/04/20 08:58:48 knakahara Exp $ */
/* $NetBSD: altq_cbq.c,v 1.30 2016/06/20 08:30:58 knakahara Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.29 2016/04/20 08:58:48 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.30 2016/06/20 08:30:58 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -592,7 +592,7 @@ cbqrestart(struct ifaltq *ifq)
ifp = ifq->altq_ifp;
if (ifp->if_start &&
cbqp->cbq_qlen > 0 && (ifp->if_flags & IFF_OACTIVE) == 0)
(*ifp->if_start)(ifp);
if_start_lock(ifp);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_subr.c,v 1.31 2016/05/12 02:24:16 ozaki-r Exp $ */
/* $NetBSD: altq_subr.c,v 1.32 2016/06/20 08:30:58 knakahara Exp $ */
/* $KAME: altq_subr.c,v 1.24 2005/04/13 03:44:25 suz Exp $ */
/*
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_subr.c,v 1.31 2016/05/12 02:24:16 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_subr.c,v 1.32 2016/06/20 08:30:58 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -366,7 +366,7 @@ tbr_timeout(void *arg)
active++;
if (!IFQ_IS_EMPTY(&ifp->if_snd) && ifp->if_start != NULL) {
int _s = splnet();
(*ifp->if_start)(ifp);
if_start_lock(ifp);
splx(_s);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_pmf.c,v 1.37 2015/02/13 13:26:50 maxv Exp $ */
/* $NetBSD: kern_pmf.c,v 1.38 2016/06/20 08:30:58 knakahara Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.37 2015/02/13 13:26:50 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.38 2016/06/20 08:30:58 knakahara Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -911,7 +911,7 @@ pmf_class_network_resume(device_t dev, const pmf_qual_t *qual)
ifp->if_flags &= ~IFF_RUNNING;
if ((*ifp->if_init)(ifp) != 0)
aprint_normal_ifnet(ifp, "resume failed\n");
(*ifp->if_start)(ifp);
if_start_lock(ifp);
}
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.342 2016/06/20 06:41:30 ozaki-r Exp $ */
/* $NetBSD: if.c,v 1.343 2016/06/20 08:30:58 knakahara 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.342 2016/06/20 06:41:30 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.343 2016/06/20 08:30:58 knakahara Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -2787,7 +2787,7 @@ if_transmit(struct ifnet *ifp, struct mbuf *m)
ifp->if_omcasts++;
if ((ifp->if_flags & IFF_OACTIVE) == 0)
(*ifp->if_start)(ifp);
if_start_lock(ifp);
out:
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ecosubr.c,v 1.47 2016/06/20 06:46:37 knakahara Exp $ */
/* $NetBSD: if_ecosubr.c,v 1.48 2016/06/20 08:30:58 knakahara Exp $ */
/*-
* Copyright (c) 2001 Ben Harris
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.47 2016/06/20 06:46:37 knakahara Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.48 2016/06/20 08:30:58 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -782,7 +782,7 @@ eco_inputidle(struct ifnet *ifp)
break;
}
ec->ec_state = ECO_IDLE;
ifp->if_start(ifp);
if_start_lock(ifp);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_spppsubr.c,v 1.142 2016/06/10 13:27:16 ozaki-r Exp $ */
/* $NetBSD: if_spppsubr.c,v 1.143 2016/06/20 08:30:59 knakahara Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.142 2016/06/10 13:27:16 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.143 2016/06/20 08:30:59 knakahara Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -832,7 +832,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
* framing according to RFC 1333.
*/
if (!(ifp->if_flags & IFF_OACTIVE))
(*ifp->if_start)(ifp);
if_start_lock(ifp);
ifp->if_obytes += m->m_pkthdr.len + sp->pp_framebytes;
}
splx(s);
@ -1214,7 +1214,7 @@ sppp_cisco_send(struct sppp *sp, int type, int32_t par1, int32_t par2)
} else
IF_ENQUEUE(&sp->pp_cpq, m);
if (! (ifp->if_flags & IFF_OACTIVE))
(*ifp->if_start)(ifp);
if_start_lock(ifp);
ifp->if_obytes += m->m_pkthdr.len + sp->pp_framebytes;
}
@ -1279,7 +1279,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
} else
IF_ENQUEUE(&sp->pp_cpq, m);
if (! (ifp->if_flags & IFF_OACTIVE))
(*ifp->if_start)(ifp);
if_start_lock(ifp);
ifp->if_obytes += m->m_pkthdr.len + sp->pp_framebytes;
}
@ -4715,7 +4715,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
} else
IF_ENQUEUE(&sp->pp_cpq, m);
if (! (ifp->if_flags & IFF_OACTIVE))
(*ifp->if_start)(ifp);
if_start_lock(ifp);
ifp->if_obytes += m->m_pkthdr.len + 3;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ieee80211_output.c,v 1.54 2016/05/16 09:53:59 ozaki-r Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.55 2016/06/20 08:30:59 knakahara Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $");
#endif
#ifdef __NetBSD__
__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.54 2016/05/16 09:53:59 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.55 2016/06/20 08:30:59 knakahara Exp $");
#endif
#ifdef _KERNEL_OPT
@ -221,7 +221,7 @@ ieee80211_mgmt_output(struct ieee80211com *ic, struct ieee80211_node *ni,
ic->ic_mgt_timer = timer;
ifp->if_timer = 1;
}
(*ifp->if_start)(ifp);
if_start_lock(ifp);
return 0;
}
@ -268,7 +268,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni)
wh->i_fc[1] & IEEE80211_FC1_PWR_MGT ? "ena" : "dis");
IF_ENQUEUE(&ic->ic_mgtq, m); /* cheat */
(*ifp->if_start)(ifp);
if_start_lock(ifp);
return 0;
}
@ -1362,7 +1362,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni,
ieee80211_chan2ieee(ic, ic->ic_curchan));
IF_ENQUEUE(&ic->ic_mgtq, m);
(*ic->ic_ifp->if_start)(ic->ic_ifp);
if_start_lock(ic->ic_ifp);
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ieee80211_proto.c,v 1.31 2015/08/24 22:21:26 pooka Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.32 2016/06/20 08:30:59 knakahara Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_proto.c,v 1.23 2005/08/10 16:22:29 sam Exp $");
#endif
#ifdef __NetBSD__
__KERNEL_RCSID(0, "$NetBSD: ieee80211_proto.c,v 1.31 2015/08/24 22:21:26 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: ieee80211_proto.c,v 1.32 2016/06/20 08:30:59 knakahara Exp $");
#endif
/*
@ -1121,7 +1121,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg
if (ic->ic_opmode == IEEE80211_M_STA)
ieee80211_notify_node_join(ic, ni,
arg == IEEE80211_FC0_SUBTYPE_ASSOC_RESP);
(*ifp->if_start)(ifp); /* XXX not authorized yet */
if_start_lock(ifp); /* XXX not authorized yet */
break;
}
/*