Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Pull if_drain routine out of m_reclaim
details: https://anonhg.NetBSD.org/src/rev/f53e9266afa2
branches: trunk
changeset: 334026:f53e9266afa2
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Nov 27 03:15:51 2014 +0000
description:
Pull if_drain routine out of m_reclaim
It's if-specific and should be in if.c.
No functional change.
diffstat:
sys/kern/uipc_mbuf.c | 10 +++-------
sys/net/if.c | 15 +++++++++++++--
sys/net/if.h | 3 ++-
sys/rump/librump/rumpnet/net_stub.c | 6 ++++--
4 files changed, 22 insertions(+), 12 deletions(-)
diffs (119 lines):
diff -r 254e51ce4ac9 -r f53e9266afa2 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c Thu Nov 27 01:44:59 2014 +0000
+++ b/sys/kern/uipc_mbuf.c Thu Nov 27 03:15:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.158 2014/02/25 18:30:11 pooka Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.159 2014/11/27 03:15:51 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158 2014/02/25 18:30:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.159 2014/11/27 03:15:51 ozaki-r Exp $");
#include "opt_mbuftrace.h"
#include "opt_nmbclusters.h"
@@ -543,7 +543,6 @@
{
struct domain *dp;
const struct protosw *pr;
- struct ifnet *ifp;
int s;
KERNEL_LOCK(1, NULL);
@@ -554,10 +553,7 @@
if (pr->pr_drain)
(*pr->pr_drain)();
}
- IFNET_FOREACH(ifp) {
- if (ifp->if_drain)
- (*ifp->if_drain)(ifp);
- }
+ if_drain_all();
splx(s);
mbstat.m_drain++;
KERNEL_UNLOCK_ONE(NULL);
diff -r 254e51ce4ac9 -r f53e9266afa2 sys/net/if.c
--- a/sys/net/if.c Thu Nov 27 01:44:59 2014 +0000
+++ b/sys/net/if.c Thu Nov 27 03:15:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.298 2014/11/26 09:53:53 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.299 2014/11/27 03:15:51 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.298 2014/11/26 09:53:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.299 2014/11/27 03:15:51 ozaki-r Exp $");
#include "opt_inet.h"
@@ -2324,6 +2324,17 @@
return rc;
}
+void
+if_drain_all(void)
+{
+ struct ifnet *ifp;
+
+ IFNET_FOREACH(ifp) {
+ if (ifp->if_drain)
+ (*ifp->if_drain)(ifp);
+ }
+}
+
static void
sysctl_sndq_setup(struct sysctllog **clog, const char *ifname,
struct ifaltq *ifq)
diff -r 254e51ce4ac9 -r f53e9266afa2 sys/net/if.h
--- a/sys/net/if.h Thu Nov 27 01:44:59 2014 +0000
+++ b/sys/net/if.h Thu Nov 27 03:15:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.179 2014/11/26 09:38:42 ozaki-r Exp $ */
+/* $NetBSD: if.h,v 1.180 2014/11/27 03:15:51 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -968,6 +968,7 @@
extern struct ifnet *lo0ifp;
ifnet_t * if_byindex(u_int);
+void if_drain_all(void);
/*
* ifq sysctl support
diff -r 254e51ce4ac9 -r f53e9266afa2 sys/rump/librump/rumpnet/net_stub.c
--- a/sys/rump/librump/rumpnet/net_stub.c Thu Nov 27 01:44:59 2014 +0000
+++ b/sys/rump/librump/rumpnet/net_stub.c Thu Nov 27 03:15:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: net_stub.c,v 1.18 2014/05/18 14:03:26 rmind Exp $ */
+/* $NetBSD: net_stub.c,v 1.19 2014/11/27 03:15:51 ozaki-r Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.18 2014/05/18 14:03:26 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.19 2014/11/27 03:15:51 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/protosw.h>
@@ -61,7 +61,9 @@
__weak_alias(ieee8023ad_lacp_input,rumpnet_stub);
__weak_alias(ieee8023ad_marker_input,rumpnet_stub);
+/* if */
struct ifnet_head ifnet_list;
+__weak_alias(if_drain_all,rumpnet_stub);
int
compat_ifconf(u_long cmd, void *data)
Home |
Main Index |
Thread Index |
Old Index