summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-07-29 18:33:13 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-07-29 18:33:13 +0000
commit9e9280f3669c9e5a87e75810d95f7612381d6676 (patch)
tree94ca31f61850ae045c3dd71f1cebf585f7c8703d /sys/dev/pv
parent0f36f8f47a65d4caa94e5ecc03882feda4da6813 (diff)
Update TX completion event index when putting a packet on the ring
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/if_xnf.c5
1 files changed, 4 insertions, 1 deletions
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)