summaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-04-23 10:53:46 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-04-23 10:53:46 +0000
commit250e7be45ba4dbf5a3034ecc9e0bcdb748a6495b (patch)
tree2515aacbf01398cc89f3aa6de5f59cf7e3167f9d /sys/net/if_gre.c
parent21cf63c60b9496a046688e4dd5e3ca0c4133e13d (diff)
a first cut at converting some virtual ethernet interfaces to if_vinput
this let's input processing bypass ifiqs. there's a performance benefit from this, and it will let me tweak the backpressure detection mechanism that ifiqs use without impacting on a stack of virtual interfaces. ive tested all of these except mpw, which i will end up testing soon anyway.
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 2549906d100..ee4798b8124 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.148 2019/04/22 00:38:05 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.149 2019/04/23 10:53:45 dlg Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -729,6 +729,7 @@ egre_clone_create(struct if_clone *ifc, int unit)
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
+ if_counters_alloc(ifp);
if_attach(ifp);
ether_ifattach(ifp);
@@ -804,6 +805,7 @@ nvgre_clone_create(struct if_clone *ifc, int unit)
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
+ if_counters_alloc(ifp);
if_attach(ifp);
ether_ifattach(ifp);
@@ -866,6 +868,7 @@ eoip_clone_create(struct if_clone *ifc, int unit)
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
+ if_counters_alloc(ifp);
if_attach(ifp);
ether_ifattach(ifp);
@@ -1310,7 +1313,6 @@ static int
egre_input(const struct gre_tunnel *key, struct mbuf *m, int hlen, uint8_t otos)
{
struct egre_softc *sc;
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
NET_ASSERT_LOCKED();
sc = RBT_FIND(egre_tree, &egre_tree, (const struct egre_softc *)key);
@@ -1335,8 +1337,7 @@ egre_input(const struct gre_tunnel *key, struct mbuf *m, int hlen, uint8_t otos)
gre_l2_prio(&sc->sc_tunnel, m, otos);
- ml_enqueue(&ml, m);
- if_input(&sc->sc_ac.ac_if, &ml);
+ if_vinput(&sc->sc_ac.ac_if, m);
return (0);
}
@@ -1559,7 +1560,6 @@ nvgre_input(const struct gre_tunnel *key, struct mbuf *m, int hlen,
uint8_t otos)
{
struct nvgre_softc *sc;
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
if (ISSET(m->m_flags, M_MCAST|M_BCAST))
sc = nvgre_mcast_find(key, m->m_pkthdr.ph_ifidx);
@@ -1587,8 +1587,7 @@ nvgre_input(const struct gre_tunnel *key, struct mbuf *m, int hlen,
pf_pkt_addr_changed(m);
#endif
- ml_enqueue(&ml, m);
- if_input(&sc->sc_ac.ac_if, &ml);
+ if_vinput(&sc->sc_ac.ac_if, m);
return (0);
}
@@ -4188,7 +4187,6 @@ static struct mbuf *
eoip_input(struct gre_tunnel *key, struct mbuf *m,
const struct gre_header *gh, uint8_t otos, int iphlen)
{
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct eoip_softc *sc;
struct gre_h_key_eoip *eoiph;
int hlen, len;
@@ -4240,8 +4238,7 @@ eoip_input(struct gre_tunnel *key, struct mbuf *m,
pf_pkt_addr_changed(m);
#endif
- ml_enqueue(&ml, m);
- if_input(&sc->sc_ac.ac_if, &ml);
+ if_vinput(&sc->sc_ac.ac_if, m);
return (NULL);