Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148845630
D8674.id22605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D8674.id22605.diff
View Options
Index: sys/conf/options
===================================================================
--- sys/conf/options
+++ sys/conf/options
@@ -996,3 +996,6 @@
EVDEV_SUPPORT opt_evdev.h
EVDEV_DEBUG opt_evdev.h
UINPUT_DEBUG opt_evdev.h
+
+# Hyper-V network driver
+HN_DEBUG opt_hn.h
Index: sys/dev/hyperv/netvsc/if_hn.c
===================================================================
--- sys/dev/hyperv/netvsc/if_hn.c
+++ sys/dev/hyperv/netvsc/if_hn.c
@@ -57,6 +57,7 @@
#include "opt_inet6.h"
#include "opt_inet.h"
+#include "opt_hn.h"
#include <sys/param.h>
#include <sys/bus.h>
@@ -1428,10 +1429,12 @@
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 @@
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 @@
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
Index: sys/modules/hyperv/netvsc/Makefile
===================================================================
--- sys/modules/hyperv/netvsc/Makefile
+++ sys/modules/hyperv/netvsc/Makefile
@@ -5,7 +5,7 @@
KMOD= hv_netvsc
SRCS= hn_nvs.c hn_rndis.c if_hn.c
-SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h
+SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h
CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 21, 12:08 PM (16 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30053590
Default Alt Text
D8674.id22605.diff (2 KB)
Attached To
Mode
D8674: hyperv/hn: Add HN_DEBUG kernel option.
Attached
Detach File
Event Timeline
Log In to Comment