summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/net/if_axe.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-10-04 20:49:38 +0000
committeryongari <yongari@FreeBSD.org>2010-10-04 20:49:38 +0000
commite6d97121eaa093c2b3f9ab09c5f2a56ae39b806f (patch)
tree9fc1ec924d04684c530ea835e0f0f2d4d7a999c9 /sys/dev/usb/net/if_axe.c
parent3bbacb240e75ca4266dba7678b9250f24179b689 (diff)
downloadFreeBSD-src-e6d97121eaa093c2b3f9ab09c5f2a56ae39b806f.zip
FreeBSD-src-e6d97121eaa093c2b3f9ab09c5f2a56ae39b806f.tar.gz
Move updating TX packet counter to the inside of send loop. axe(4)
controllers combine multiple TX requests into single one if there is room in TX buffer of controller. Updating TX packet counter at the end of TX completion resulted in incorrect TX packet counter as axe(4) thought it sent 1 packet. There is no easy way to know how many combined TX were completed in the callback. Because this change updates TX packet counter before actual transmission, it may not be ideal one. But I believe it's better than showing fake 8kpps under high TX load. With this change, TX shows 221kpps on Linksus USB200M.
Diffstat (limited to 'sys/dev/usb/net/if_axe.c')
-rw-r--r--sys/dev/usb/net/if_axe.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c
index 8f32dca..5e62f9a 100644
--- a/sys/dev/usb/net/if_axe.c
+++ b/sys/dev/usb/net/if_axe.c
@@ -912,7 +912,6 @@ axe_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error)
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
DPRINTFN(11, "transfer complete\n");
- ifp->if_opackets++;
/* FALLTHROUGH */
case USB_ST_SETUP:
tr_setup:
@@ -958,6 +957,17 @@ tr_setup:
pos += m->m_pkthdr.len;
/*
+ * XXX
+ * Update TX packet counter here. This is not
+ * correct way but it seems that there is no way
+ * to know how many packets are sent at the end
+ * of transfer because controller combines
+ * multiple writes into single one if there is
+ * room in TX buffer of controller.
+ */
+ ifp->if_opackets++;
+
+ /*
* if there's a BPF listener, bounce a copy
* of this frame to him:
*/
OpenPOWER on IntegriCloud