svn commit: r213423 - head/sys/dev/usb/net

Pyun YongHyeon yongari at FreeBSD.org
Mon Oct 4 20:49:39 UTC 2010


Author: yongari
Date: Mon Oct  4 20:49:38 2010
New Revision: 213423
URL: http://svn.freebsd.org/changeset/base/213423

Log:
  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.

Modified:
  head/sys/dev/usb/net/if_axe.c

Modified: head/sys/dev/usb/net/if_axe.c
==============================================================================
--- head/sys/dev/usb/net/if_axe.c	Mon Oct  4 20:13:21 2010	(r213422)
+++ head/sys/dev/usb/net/if_axe.c	Mon Oct  4 20:49:38 2010	(r213423)
@@ -912,7 +912,6 @@ axe_bulk_write_callback(struct usb_xfer 
 	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:
 			 */


More information about the svn-src-head mailing list