summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-07-08 07:10:13 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-07-08 07:10:13 +0000
commit9d14de50f15bae209d0fb94086f9ecf1d4ad4142 (patch)
treee24a5625fbb85712709a3fcffd3c422adb547cc0 /sys/net
parent3ff18468b901339fd64cc6723531d1f7ec0144e0 (diff)
pull the rx ring accounting out of the mbuf layer now that its all done
via if_rxring things. this effectively deprecates the third argument for MCLGETI and m_clget and makes the mbuf layer no longer care about interfaces and simplifies the allocation paths. the timeout used to measure livelock has been moved to net/if.c. ok mpi@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c29
-rw-r--r--sys/net/if_ethersubr.c4
2 files changed, 23 insertions, 10 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index fd0e8539ca6..86f0b35d513 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.293 2014/07/08 04:02:14 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.294 2014/07/08 07:10:12 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -178,6 +178,8 @@ int if_cloners_count;
struct pool ifaddr_item_pl;
+struct timeout net_tick_to;
+void net_tick(void *);
int net_livelocked(void);
/*
@@ -195,8 +197,10 @@ ifinit()
"ifaddritem", NULL);
timeout_set(&if_slowtim, if_slowtimo, &if_slowtim);
+ timeout_set(&net_tick_to, net_tick, &net_tick_to);
if_slowtimo(&if_slowtim);
+ net_tick(&net_tick_to);
}
static unsigned int if_index = 0;
@@ -429,8 +433,6 @@ if_attach(struct ifnet *ifp)
ifp->if_xflags |= IFXF_NOINET6;
#endif
- m_clinitifp(ifp);
-
if_attachsetup(ifp);
}
@@ -1150,8 +1152,6 @@ if_up(struct ifnet *ifp)
#ifndef SMALL_KERNEL
rt_if_track(ifp);
#endif
-
- m_clinitifp(ifp);
}
/*
@@ -2382,13 +2382,28 @@ ifnewlladdr(struct ifnet *ifp)
splx(s);
}
+int net_ticks;
+u_int net_livelocks;
+
+void
+net_tick(void *null)
+{
+ extern int ticks;
+
+ if (ticks - net_ticks > 1)
+ net_livelocks++;
+
+ net_ticks = ticks;
+
+ timeout_add(&net_tick_to, 1);
+}
+
int
net_livelocked()
{
extern int ticks;
- extern int m_clticks;
- return (ticks - m_clticks > 1);
+ return (ticks - net_ticks > 1);
}
void
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 83551fdebf3..7ab15bbeef3 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.172 2014/04/22 12:07:20 henning Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.173 2014/07/08 07:10:12 dlg Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -488,8 +488,6 @@ ether_input(struct ifnet *ifp0, struct ether_header *eh, struct mbuf *m)
struct ether_header *eh_tmp;
#endif
- m_cluncount(m, 1);
-
/* mark incoming routing table */
m->m_pkthdr.ph_rtableid = ifp->if_rdomain;