diff options
| author | Sepherosa Ziehau <sephe@FreeBSD.org> | 2016-12-01 03:27:16 +0000 |
|---|---|---|
| committer | Sepherosa Ziehau <sephe@FreeBSD.org> | 2016-12-01 03:27:16 +0000 |
| commit | 85e4ae1e13f54066f031aba3ae71e252dc410c21 (patch) | |
| tree | 9f66c64c7e6b81cbc8e3fe28c96ceeff9710ec56 /sys/dev | |
| parent | 71462f56520b31953924bec34d9b7b1711ad620b (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/hyperv/netvsc/if_hn.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index f8d296780afff..8e28a4a18c3e5 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_inet.h" +#include "opt_hn.h" #include <sys/param.h> #include <sys/bus.h> @@ -1428,10 +1429,12 @@ hn_txdesc_put(struct hn_tx_ring *txr, struct hn_txdesc *txd) txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); -#else +#else /* HN_USE_TXDESC_BUFRING */ +#ifdef HN_DEBUG atomic_add_int(&txr->hn_txdesc_avail, 1); - buf_ring_enqueue(txr->hn_txdesc_br, txd); #endif + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif /* !HN_USE_TXDESC_BUFRING */ return 1; } @@ -1457,8 +1460,10 @@ hn_txdesc_get(struct hn_tx_ring *txr) if (txd != NULL) { #ifdef HN_USE_TXDESC_BUFRING +#ifdef HN_DEBUG atomic_subtract_int(&txr->hn_txdesc_avail, 1); #endif +#endif /* HN_USE_TXDESC_BUFRING */ KASSERT(txd->m == NULL && txd->refs == 0 && STAILQ_EMPTY(&txd->agg_list) && txd->chim_index == HN_NVS_CHIM_IDX_INVALID && @@ -3467,9 +3472,11 @@ hn_tx_ring_create(struct hn_softc *sc, int id) if (txr->hn_tx_sysctl_tree != NULL) { child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); +#ifdef HN_DEBUG SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); +#endif #ifdef HN_IFSTART_SUPPORT if (!hn_use_if_start) #endif |
