diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-04-10 13:58:21 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-04-10 13:58:21 +0000 |
commit | 250513adf3ae568c024bafdf3e845f1276740ad4 (patch) | |
tree | 77683efc78bd0dba266f3daef8e373a90f87e85d /sys/net/if_pppx.c | |
parent | eef7b0919e36bece6c9cf91b19a2f5062a1acaa2 (diff) |
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/net/if_pppx.c')
-rw-r--r-- | sys/net/if_pppx.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index c2ed2f72206..00de01c7498 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.36 2015/02/10 21:56:10 miod Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.37 2015/04/10 13:58:20 dlg Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -317,9 +317,9 @@ pppxwrite(dev_t dev, struct uio *uio, int ioflag) /* struct pppx_dev *pxd = pppx_dev2pxd(dev); */ struct pppx_hdr *th; struct mbuf *top, **mp, *m; - struct ifqueue *ifq; + struct niqueue *ifq; int tlen, mlen; - int isr, s, error = 0; + int error = 0; if (uio->uio_resid < sizeof(*th) || uio->uio_resid > MCLBYTES) return (EMSGSIZE); @@ -381,12 +381,10 @@ pppxwrite(dev_t dev, struct uio *uio, int ioflag) switch (ntohl(th->pppx_proto)) { case AF_INET: ifq = &ipintrq; - isr = NETISR_IP; break; #ifdef INET6 case AF_INET6: ifq = &ip6intrq; - isr = NETISR_IPV6; break; #endif default: @@ -394,16 +392,8 @@ pppxwrite(dev_t dev, struct uio *uio, int ioflag) return (EAFNOSUPPORT); } - s = splnet(); - if (IF_QFULL(ifq)) { - IF_DROP(ifq); - splx(s); - m_freem(top); + if (niq_enqueue(ifq, m) != 0) return (ENOBUFS); - } - IF_ENQUEUE(ifq, top); - schednetisr(isr); - splx(s); return (error); } |