Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys apply if_output_lock() to L3 callers which call ifp->if_...
details: https://anonhg.NetBSD.org/src/rev/deb38800d4b3
branches: trunk
changeset: 346031:deb38800d4b3
user: knakahara <knakahara%NetBSD.org@localhost>
date: Mon Jun 20 06:46:37 2016 +0000
description:
apply if_output_lock() to L3 callers which call ifp->if_output() of L2(or L3 tunneling).
diffstat:
sys/dist/pf/net/pf.c | 6 +++---
sys/external/bsd/ipf/netinet/ip_fil_netbsd.c | 8 +++-----
sys/net/agr/if_agr.c | 6 +++---
sys/net/bpf.c | 6 +++---
sys/net/if_ecosubr.c | 6 +++---
sys/net/if_mpls.c | 8 +++-----
sys/net/if_pppoe.c | 8 ++++----
sys/net/if_srt.c | 6 +++---
sys/net/ppp_tty.c | 6 +++---
sys/netatalk/aarp.c | 8 ++++----
sys/netatalk/ddp_output.c | 6 +++---
sys/netinet/if_arp.c | 14 ++++++--------
sys/netinet/ip_carp.c | 6 +++---
sys/netinet/ip_flow.c | 8 +++-----
sys/netinet/ip_output.c | 13 +++----------
sys/netinet6/ip6_flow.c | 8 +++-----
sys/netinet6/nd6.c | 14 ++++----------
17 files changed, 57 insertions(+), 80 deletions(-)
diffs (truncated from 536 to 300 lines):
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/dist/pf/net/pf.c
--- a/sys/dist/pf/net/pf.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/dist/pf/net/pf.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pf.c,v 1.73 2016/06/10 13:27:15 ozaki-r Exp $ */
+/* $NetBSD: pf.c,v 1.74 2016/06/20 06:46:37 knakahara Exp $ */
/* $OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
/*
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.73 2016/06/10 13:27:15 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.74 2016/06/20 06:46:37 knakahara Exp $");
#include "pflog.h"
@@ -5381,7 +5381,7 @@
else if (m0->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT)
udpstat.udps_outhwcsum++;
#endif /* !__NetBSD__ */
- error = (*ifp->if_output)(ifp, m0, dst, NULL);
+ error = if_output_lock(ifp, ifp, m0, dst, NULL);
goto done;
}
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_fil_netbsd.c,v 1.14 2016/06/10 13:27:15 ozaki-r Exp $ */
+/* $NetBSD: ip_fil_netbsd.c,v 1.15 2016/06/20 06:46:37 knakahara Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.14 2016/06/10 13:27:15 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.15 2016/06/20 06:46:37 knakahara Exp $");
#else
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -1228,9 +1228,7 @@
ip->ip_sum = in_cksum(m, hlen);
# endif /* M_CSUM_IPv4 */
- KERNEL_LOCK(1, NULL);
- error = (*ifp->if_output)(ifp, m, dst, rt);
- KERNEL_UNLOCK_ONE(NULL);
+ error = if_output_lock(ifp, ifp, m, dst, rt);
goto done;
}
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/agr/if_agr.c
--- a/sys/net/agr/if_agr.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/agr/if_agr.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_agr.c,v 1.35 2016/06/10 13:27:16 ozaki-r Exp $ */
+/* $NetBSD: if_agr.c,v 1.36 2016/06/20 06:46:37 knakahara Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.35 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.36 2016/06/20 06:46:37 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -209,7 +209,7 @@
m_copydata(m, 0, hdrlen, &dst->sa_data);
m_adj(m, hdrlen);
- error = (*ifp_port->if_output)(ifp_port, m, dst, NULL);
+ error = if_output_lock(ifp_port, ifp_port, m, dst, NULL);
return error;
}
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/bpf.c
--- a/sys/net/bpf.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/bpf.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.198 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: bpf.c,v 1.199 2016/06/20 06:46:37 knakahara Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.198 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.199 2016/06/20 06:46:37 knakahara Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -723,7 +723,7 @@
mc = NULL;
s = splsoftnet();
- error = (*ifp->if_output)(ifp, m, (struct sockaddr *) &dst, NULL);
+ error = if_output_lock(ifp, ifp, m, (struct sockaddr *) &dst, NULL);
if (mc != NULL) {
if (error == 0)
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/if_ecosubr.c
--- a/sys/net/if_ecosubr.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/if_ecosubr.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ecosubr.c,v 1.46 2016/04/20 09:01:04 knakahara Exp $ */
+/* $NetBSD: if_ecosubr.c,v 1.47 2016/06/20 06:46:37 knakahara Exp $ */
/*-
* Copyright (c) 2001 Ben Harris
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.46 2016/04/20 09:01:04 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.47 2016/06/20 06:46:37 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -410,7 +410,7 @@
/* dst->sa_len??? */
dst->sa_family = AF_UNSPEC;
memcpy(dst->sa_data, eh, ECO_HDR_LEN);
- ifp->if_output(ifp, m, dst, NULL);
+ if_output_lock(ifp, ifp, m, dst, NULL);
return;
}
default:
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/if_mpls.c
--- a/sys/net/if_mpls.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/if_mpls.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mpls.c,v 1.23 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: if_mpls.c,v 1.24 2016/06/20 06:46:37 knakahara Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.23 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.24 2016/06/20 06:46:37 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -478,9 +478,7 @@
#ifdef INET
ret = ip_if_output(ifp, m, rt->rt_gateway, rt);
#else
- KERNEL_LOCK(1, NULL);
- ret = (*ifp->if_output)(ifp, m, rt->rt_gateway, rt);
- KERNEL_UNLOCK_ONE(NULL);
+ if_output_lock(ifp, ifp, m, rt->rt_gateway, rt);
#endif
return ret;
break;
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/if_pppoe.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.108 2016/06/10 13:31:44 ozaki-r Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.109 2016/06/20 06:46:37 knakahara Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.108 2016/06/10 13:31:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.109 2016/06/20 06:46:37 knakahara Exp $");
#include "pppoe.h"
@@ -880,7 +880,7 @@
m->m_flags &= ~(M_BCAST|M_MCAST);
sc->sc_sppp.pp_if.if_opackets++;
- return sc->sc_eth_if->if_output(sc->sc_eth_if, m, &dst, NULL);
+ return if_output_lock(sc->sc_eth_if, sc->sc_eth_if, m, &dst, NULL);
}
static int
@@ -1377,7 +1377,7 @@
memcpy(&eh->ether_dhost, dest, ETHER_ADDR_LEN);
m0->m_flags &= ~(M_BCAST|M_MCAST);
- return outgoing_if->if_output(outgoing_if, m0, &dst, NULL);
+ return if_output_lock(outgoing_if, outgoing_if, m0, &dst, NULL);
}
#ifdef PPPOE_SERVER
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/if_srt.c
--- a/sys/net/if_srt.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/if_srt.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,8 +1,8 @@
-/* $NetBSD: if_srt.c,v 1.21 2016/04/28 00:16:56 ozaki-r Exp $ */
+/* $NetBSD: if_srt.c,v 1.22 2016/06/20 06:46:37 knakahara Exp $ */
/* This file is in the public domain. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.21 2016/04/28 00:16:56 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_srt.c,v 1.22 2016/06/20 06:46:37 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -232,7 +232,7 @@
return 0; /* XXX ENETDOWN? */
}
/* XXX is 0 the right last arg here? */
- return (*r->u.dstifp->if_output)(r->u.dstifp,m,&r->dst.sa,0);
+ return if_output_lock(r->u.dstifp, r->u.dstifp, m, &r->dst.sa, 0);
}
static int
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/net/ppp_tty.c
--- a/sys/net/ppp_tty.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/net/ppp_tty.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ppp_tty.c,v 1.60 2016/06/10 13:27:16 ozaki-r Exp $ */
+/* $NetBSD: ppp_tty.c,v 1.61 2016/06/20 06:46:37 knakahara Exp $ */
/* Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp */
/*
@@ -93,7 +93,7 @@
/* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.60 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppp_tty.c,v 1.61 2016/06/20 06:46:37 knakahara Exp $");
#include "ppp.h"
@@ -425,7 +425,7 @@
dst.sa_family = AF_UNSPEC;
bcopy(mtod(m0, u_char *), dst.sa_data, PPP_HDRLEN);
m_adj(m0, PPP_HDRLEN);
- return ((*sc->sc_if.if_output)(&sc->sc_if, m0, &dst, (struct rtentry *)0));
+ return if_output_lock(&sc->sc_if, &sc->sc_if, m0, &dst, (struct rtentry *)0);
}
/*
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/netatalk/aarp.c
--- a/sys/netatalk/aarp.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/netatalk/aarp.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarp.c,v 1.36 2012/01/31 09:53:44 hauke Exp $ */
+/* $NetBSD: aarp.c,v 1.37 2016/06/20 06:46:38 knakahara Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.36 2012/01/31 09:53:44 hauke Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.37 2016/06/20 06:46:38 knakahara Exp $");
#include "opt_mbuftrace.h"
@@ -238,7 +238,7 @@
sa.sa_len = sizeof(struct sockaddr);
sa.sa_family = AF_UNSPEC;
- (*ifp->if_output) (ifp, m, &sa, NULL); /* XXX NULL should be routing */
+ if_output_lock(ifp, ifp, m, &sa, NULL); /* XXX NULL should be routing */
/* information */
}
@@ -429,7 +429,7 @@
sat.sat_len = sizeof(struct sockaddr_at);
sat.sat_family = AF_APPLETALK;
sat.sat_addr = spa;
- (*ifp->if_output)(ifp, aat->aat_hold,
+ if_output_lock(ifp, ifp, aat->aat_hold,
(struct sockaddr *) & sat, NULL); /* XXX */
aat->aat_hold = 0;
}
diff -r a0f1f5eb6225 -r deb38800d4b3 sys/netatalk/ddp_output.c
--- a/sys/netatalk/ddp_output.c Mon Jun 20 06:41:30 2016 +0000
+++ b/sys/netatalk/ddp_output.c Mon Jun 20 06:46:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ddp_output.c,v 1.18 2016/01/20 21:59:19 riastradh Exp $ */
+/* $NetBSD: ddp_output.c,v 1.19 2016/06/20 06:46:38 knakahara Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
*/
Home |
Main Index |
Thread Index |
Old Index