diff options
author | 2015-04-10 13:58:20 +0000 | |
---|---|---|
committer | 2015-04-10 13:58:20 +0000 | |
commit | 98a920fd7faa5ee5def7da7914ae31dfc8ff4d40 (patch) | |
tree | ce5a3ec8e7f71d587da0ec2afed163fd21e99a54 /sys/netinet6/ip6_input.c | |
parent | Full-speed isochronous transfers support with opportunistic micro-frames (diff) | |
download | wireguard-openbsd-98a920fd7faa5ee5def7da7914ae31dfc8ff4d40.tar.xz wireguard-openbsd-98a920fd7faa5ee5def7da7914ae31dfc8ff4d40.zip |
replace the use of ifqueues for most input queues serviced by netisr
with niqueues.
this change is so big because there's a lot of code that takes
pointers to different input queues (eg, ether_input picks between
ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through
to code to enqueue packets against the pointer. if i changed only
one of the input queues id have to add sepearate code paths, one
for ifqueues and one for niqueues in each of these places
by flipping all these input queues at once i can keep the currently
common code common.
testing by mpi@ sthen@ and rafael zalamena
ok mpi@ sthen@ claudio@ henning@
Diffstat (limited to 'sys/netinet6/ip6_input.c')
-rw-r--r-- | sys/netinet6/ip6_input.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index f4c9351a704..9643cdb61dd 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.140 2015/03/14 03:38:52 jsg Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.141 2015/04/10 13:58:20 dlg Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -113,7 +113,7 @@ #endif struct in6_ifaddrhead in6_ifaddr; -struct ifqueue ip6intrq; +struct niqueue ip6intrq = NIQUEUE_INITIALIZER(IFQ_MAXLEN, NETISR_IPV6); struct ip6stat ip6stat; @@ -144,7 +144,6 @@ ip6_init(void) pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW && pr->pr_protocol < IPPROTO_MAX) ip6_protox[pr->pr_protocol] = pr - inet6sw; - IFQ_SET_MAXLEN(&ip6intrq, IFQ_MAXLEN); TAILQ_INIT(&in6_ifaddr); ip6_randomid_init(); nd6_init(); @@ -168,17 +167,10 @@ ip6_init2(void *dummy) void ip6intr(void) { - int s; struct mbuf *m; - for (;;) { - s = splnet(); - IF_DEQUEUE(&ip6intrq, m); - splx(s); - if (m == NULL) - return; + while ((m = niq_dequeue(&ip6intrq)) != NULL) ip6_input(m); - } } extern struct route_in6 ip6_forward_rt; @@ -1452,7 +1444,7 @@ ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, } return (error); case IPV6CTL_IFQUEUE: - return (sysctl_ifq(name + 1, namelen - 1, + return (sysctl_niq(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, &ip6intrq)); default: if (name[0] < IPV6CTL_MAXID) |