diff options
author | 2017-06-09 20:38:48 +0000 | |
---|---|---|
committer | 2017-06-09 20:38:48 +0000 | |
commit | 088d0fa3018ee314ebdf48ca18f1ef44cd8f2aee (patch) | |
tree | 1d25f6737195ef81b732760ed0c13774472e066d | |
parent | - pfsync_input() must grab PF_LOCK (diff) | |
download | wireguard-openbsd-088d0fa3018ee314ebdf48ca18f1ef44cd8f2aee.tar.xz wireguard-openbsd-088d0fa3018ee314ebdf48ca18f1ef44cd8f2aee.zip |
Fill RX ring during init and bail early on send if OACTIVE is set
or IFF_RUNNING is not.
-rw-r--r-- | sys/dev/pv/if_xnf.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index 35188c50bc2..1f2e910136a 100644 --- a/sys/dev/pv/if_xnf.c +++ b/sys/dev/pv/if_xnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xnf.c,v 1.55 2017/06/09 14:36:43 mikeb Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.56 2017/06/09 20:38:48 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -451,6 +451,8 @@ xnf_init(struct xnf_softc *sc) xnf_iff(sc); + xnf_rx_ring_fill(sc); + if (xen_intr_unmask(sc->sc_xih)) { printf("%s: failed to enable interrupts\n", ifp->if_xname); xnf_stop(sc); @@ -493,6 +495,9 @@ xnf_start(struct ifqueue *ifq) int pkts = 0; uint32_t prod, oprod; + if (!(ifp->if_flags & IFF_RUNNING) || ifq_is_oactive(ifq)) + return; + bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0, BUS_DMASYNC_POSTREAD); @@ -902,8 +907,6 @@ xnf_rx_ring_create(struct xnf_softc *sc) sc->sc_rx_ring->rxr_desc[i].rxd_req.rxq_id = i; } - xnf_rx_ring_fill(sc); - return (0); errout: |