summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-02-05 10:34:53 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-02-05 10:34:53 +0000
commit60bcac65ef6f91e18690176faa44f38f5f0fb007 (patch)
tree8f1c27c120bc42018a76a4df40ec5c40667c9d53 /sys/dev/pv
parentcfa4a11bbd6611d56cfe420867c78827d023e406 (diff)
Simple moderation of Tx completion notifications
Follow FreeBSD and schedule the next Tx completion event to fire when about half of the packet segments scheduled for transmission are consumed.
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/if_xnf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c
index cf935b4be54..64188624573 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.16 2016/01/29 18:49:06 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.17 2016/02/05 10:34:52 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
@@ -663,7 +663,8 @@ xnf_txeof(struct xnf_softc *sc)
if (pkts > 0) {
sc->sc_tx_cons = cons;
- txr->txr_cons_event = cons + 1;
+ txr->txr_cons_event = cons +
+ ((txr->txr_prod - cons) >> 1) + 1;
bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
pkts = 0;