svn commit: r214297 - stable/8/sys/dev/usb/net

Pyun YongHyeon yongari at FreeBSD.org
Sun Oct 24 21:22:00 UTC 2010


Author: yongari
Date: Sun Oct 24 21:22:00 2010
New Revision: 214297
URL: http://svn.freebsd.org/changeset/base/214297

Log:
  MFC r213423:
    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:
  stable/8/sys/dev/usb/net/if_axe.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/net/if_axe.c
==============================================================================
--- stable/8/sys/dev/usb/net/if_axe.c	Sun Oct 24 21:17:23 2010	(r214296)
+++ stable/8/sys/dev/usb/net/if_axe.c	Sun Oct 24 21:22:00 2010	(r214297)
@@ -862,7 +862,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:
@@ -908,6 +907,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-stable mailing list