From db3c27bfc4dbe957c8b158519b8aaca83a55b8da Mon Sep 17 00:00:00 2001 From: mikeb Date: Fri, 29 Jul 2016 18:33:12 +0000 Subject: [PATCH] Update TX completion event index when putting a packet on the ring --- sys/dev/pv/if_xnf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index 6131d2c910c..5cdbac6522e 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.26 2016/07/29 18:31:51 mikeb Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.27 2016/07/29 18:33:12 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -505,6 +505,9 @@ xnf_start(struct ifnet *ifp) } if (pkts > 0) { txr->txr_prod = prod; + if (txr->txr_cons_event < txr->txr_cons) + txr->txr_cons_event = txr->txr_cons + + ((txr->txr_prod - txr->txr_cons) >> 1) + 1; bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if (prod - txr->txr_prod_event < prod - oprod) -- 2.20.1