Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Oct 2010 21:22:00 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214297 - stable/8/sys/dev/usb/net
Message-ID:  <201010242122.o9OLM0UY040466@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:
 			 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010242122.o9OLM0UY040466>