diff options
| author | Sepherosa Ziehau <sephe@FreeBSD.org> | 2016-04-27 04:51:28 +0000 |
|---|---|---|
| committer | Sepherosa Ziehau <sephe@FreeBSD.org> | 2016-04-27 04:51:28 +0000 |
| commit | ff1c886a595278c6b9b4fcb2971162fae14f6231 (patch) | |
| tree | b0a7ce74a82f69256a81399064e3edaf34d9efa7 /sys/dev | |
| parent | 1f3d62ab98989277f8d6058f653b75e15b0b6dce (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/hyperv/netvsc/hv_net_vsc.h | 3 | ||||
| -rw-r--r-- | sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c | 20 |
2 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_net_vsc.h b/sys/dev/hyperv/netvsc/hv_net_vsc.h index 3dbd6ef15a7a..39588ea304fa 100644 --- a/sys/dev/hyperv/netvsc/hv_net_vsc.h +++ b/sys/dev/hyperv/netvsc/hv_net_vsc.h @@ -1185,7 +1185,8 @@ struct hn_tx_ring { #endif int hn_txdesc_cnt; int hn_txdesc_avail; - int hn_has_txeof; + u_short hn_has_txeof; + u_short hn_txdone_cnt; int hn_sched_tx; void (*hn_txeof)(struct hn_tx_ring *); diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 87b9894e2c0d..76c90d7a023e 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -155,6 +155,8 @@ __FBSDID("$FreeBSD$"); #define HN_DIRECT_TX_SIZE_DEF 128 +#define HN_EARLY_TXEOF_THRESH 8 + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; @@ -793,6 +795,13 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(&txd->refs, 1); } +static __inline void +hn_txeof(struct hn_tx_ring *txr) +{ + txr->hn_has_txeof = 0; + txr->hn_txeof(txr); +} + static void hn_tx_done(struct hv_vmbus_channel *chan, void *xpkt) { @@ -811,6 +820,13 @@ hn_tx_done(struct hv_vmbus_channel *chan, void *xpkt) txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); + + ++txr->hn_txdone_cnt; + if (txr->hn_txdone_cnt >= HN_EARLY_TXEOF_THRESH) { + txr->hn_txdone_cnt = 0; + if (txr->hn_oactive) + hn_txeof(txr); + } } void @@ -831,8 +847,8 @@ netvsc_channel_rollup(struct hv_vmbus_channel *chan) if (txr == NULL || !txr->hn_has_txeof) return; - txr->hn_has_txeof = 0; - txr->hn_txeof(txr); + txr->hn_txdone_cnt = 0; + hn_txeof(txr); } /* |
