diff options
author | Martin Pelikan <pelikan@cvs.openbsd.org> | 2015-02-10 02:57:33 +0000 |
---|---|---|
committer | Martin Pelikan <pelikan@cvs.openbsd.org> | 2015-02-10 02:57:33 +0000 |
commit | 9e47418cfd89ae9c4f1c237733926be7fefb1f9e (patch) | |
tree | 03dcc98e69ef0d70fa596e6583091d6ab771df0f /sys/dev | |
parent | d0cab85122d0f41b8aeb032b2107548aa717e0cf (diff) |
convert VMXNET drivers to ml_enqueue + if_input
ok dlg reyk
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_vic.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/if_vmx.c | 15 |
2 files changed, 11 insertions, 17 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index 93601170dca..e89b0b29254 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.83 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_vic.c,v 1.84 2015/02/10 02:57:32 pelikan Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -814,6 +814,7 @@ vic_rx_proc(struct vic_softc *sc, int q) struct ifnet *ifp = &sc->sc_ac.ac_if; struct vic_rxdesc *rxd; struct vic_rxbuf *rxb; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; int len, idx; @@ -865,18 +866,14 @@ vic_rx_proc(struct vic_softc *sc, int q) ifp->if_ipackets++; -#if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); -#endif - - ether_input_mbuf(ifp, m); + ml_enqueue(&ml, m); -nextp: + nextp: if_rxr_put(&sc->sc_rxq[q].ring, 1); VIC_INC(sc->sc_data->vd_rx[q].nextidx, sc->sc_nrxbuf); } + if_input(ifp, &ml); vic_rx_fill(sc, q); bus_dmamap_sync(sc->sc_dmat, sc->sc_dma_map, 0, sc->sc_dma_size, diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c index 21bd8b21c6d..0d0c065bc12 100644 --- a/sys/dev/pci/if_vmx.c +++ b/sys/dev/pci/if_vmx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vmx.c,v 1.23 2015/02/09 11:06:52 pelikan Exp $ */ +/* $OpenBSD: if_vmx.c,v 1.24 2015/02/10 02:57:32 pelikan Exp $ */ /* * Copyright (c) 2013 Tsubai Masanari @@ -687,6 +687,7 @@ vmxnet3_rxintr(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rq) struct vmxnet3_rxdesc *rxd; struct vmxnet3_rxcompdesc *rxcd; struct ifnet *ifp = &sc->sc_arpcom.ac_if; + struct mbuf_list ml = MBUF_LIST_INITIALIZER(); struct mbuf *m; int idx, len; u_int slots; @@ -736,10 +737,7 @@ vmxnet3_rxintr(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rq) goto skip_buffer; } - ifp->if_ipackets++; - vmxnet3_rx_csum(rxcd, m); - m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; if (letoh32(rxcd->rxc_word2 & VMXNET3_RXC_VLAN)) { m->m_flags |= M_VLANTAG; @@ -747,11 +745,7 @@ vmxnet3_rxintr(struct vmxnet3_softc *sc, struct vmxnet3_rxqueue *rq) VMXNET3_RXC_VLANTAG_S) & VMXNET3_RXC_VLANTAG_M); } -#if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN); -#endif - ether_input_mbuf(ifp, m); + ml_enqueue(&ml, m); skip_buffer: #ifdef VMXNET3_STAT @@ -771,6 +765,9 @@ skip_buffer: } } + ifp->if_ipackets += ml_len(&ml); + if_input(ifp, &ml); + /* XXX Should we (try to) allocate buffers for ring 2 too? */ ring = &rq->cmd_ring[0]; for (slots = if_rxr_get(&ring->rxr, NRXDESC); slots > 0; slots--) { |