From: mikeb Date: Fri, 9 Jun 2017 20:38:48 +0000 (+0000) Subject: Fill RX ring during init and bail early on send if OACTIVE is set X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=088d0fa3018ee314ebdf48ca18f1ef44cd8f2aee;p=openbsd Fill RX ring during init and bail early on send if OACTIVE is set or IFF_RUNNING is not. --- 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: