summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-02-05 10:34:52 +0000
committermikeb <mikeb@openbsd.org>2016-02-05 10:34:52 +0000
commit5d887499c3e293d4043a3051ca5a272ceed1eed4 (patch)
tree4d6faa7994aa38ad5c5b572a1f13478dfb9ef01a
parentSilence warnings from static analyzers; found by jsg@ (diff)
downloadwireguard-openbsd-5d887499c3e293d4043a3051ca5a272ceed1eed4.tar.xz
wireguard-openbsd-5d887499c3e293d4043a3051ca5a272ceed1eed4.zip
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.
-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;