diff options
author | 2016-07-29 18:33:12 +0000 | |
---|---|---|
committer | 2016-07-29 18:33:12 +0000 | |
commit | db3c27bfc4dbe957c8b158519b8aaca83a55b8da (patch) | |
tree | 62f93b65640f716fcee8a82dcc293a41e2cf570e /sys/dev | |
parent | Reduce the amount of sent RX producer notifications; from FreeBSD (diff) | |
download | wireguard-openbsd-db3c27bfc4dbe957c8b158519b8aaca83a55b8da.tar.xz wireguard-openbsd-db3c27bfc4dbe957c8b158519b8aaca83a55b8da.zip |
Update TX completion event index when putting a packet on the ring
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pv/if_xnf.c | 5 |
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) |