Date: Mon, 4 Oct 2010 20:49:39 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r213423 - head/sys/dev/usb/net Message-ID: <201010042049.o94Knd5h026976@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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: */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010042049.o94Knd5h026976>