summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_ipip.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-04-10 13:58:20 +0000
committerdlg <dlg@openbsd.org>2015-04-10 13:58:20 +0000
commit98a920fd7faa5ee5def7da7914ae31dfc8ff4d40 (patch)
treece5a3ec8e7f71d587da0ec2afed163fd21e99a54 /sys/netinet/ip_ipip.c
parentFull-speed isochronous transfers support with opportunistic micro-frames (diff)
downloadwireguard-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/netinet/ip_ipip.c')
-rw-r--r--sys/netinet/ip_ipip.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index d427512beb5..4128e3d3990 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.56 2014/12/19 17:14:40 tedu Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.57 2015/04/10 13:58:20 dlg Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -146,15 +146,14 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp, int proto)
struct sockaddr_in *sin;
struct ifnet *ifp;
struct ifaddr *ifa;
- struct ifqueue *ifq = NULL;
+ struct niqueue *ifq = NULL;
struct ip *ipo;
u_int rdomain;
#ifdef INET6
struct sockaddr_in6 *sin6;
struct ip6_hdr *ip6;
#endif
- int isr;
- int mode, hlen, s;
+ int mode, hlen;
u_int8_t itos, otos;
u_int8_t v;
sa_family_t af;
@@ -352,13 +351,11 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp, int proto)
switch (proto) {
case IPPROTO_IPV4:
ifq = &ipintrq;
- isr = NETISR_IP;
af = AF_INET;
break;
#ifdef INET6
case IPPROTO_IPV6:
ifq = &ip6intrq;
- isr = NETISR_IPV6;
af = AF_INET6;
break;
#endif
@@ -374,23 +371,12 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp, int proto)
pf_pkt_addr_changed(m);
#endif
- s = splnet(); /* isn't it already? */
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
+ if (niq_enqueue(ifq, m) != 0) {
ipipstat.ipips_qfull++;
-
- splx(s);
-
DPRINTF(("ipip_input(): packet dropped because of full "
"queue\n"));
return;
}
-
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
- splx(s);
- return;
}
int