From owner-freebsd-usb@FreeBSD.ORG Sat Oct 2 00:40:36 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0ED106564A; Sat, 2 Oct 2010 00:40:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id DB0E28FC13; Sat, 2 Oct 2010 00:40:35 +0000 (UTC) Received: by pxi17 with SMTP id 17so1110963pxi.13 for ; Fri, 01 Oct 2010 17:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:mime-version:content-type :content-disposition:user-agent; bh=vL6pug+UrNO91XIhiQkkbqBXFnLstcVAQODC8sjVTU0=; b=e0im0NWYU2f2bI4X3DAttJHeUm6R7+mSdIAb9WHJcB+3Tl79BLz0I5fbRSEzjF8hDB 6UjuGOVQGOThJ+PXWzu7lutetmdLsKxC1v3mhMigFMY6p2X6ZY/InwyhawjR4nfshY9L yfBVuMhmu9IJEQotVyv0PGxutBu5Qw7dHN8wA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mime-version :content-type:content-disposition:user-agent; b=c/+QoqqsFR3zwa/Fz6T46p0HRNg0kckRO7Dg/43UKaZvMhRwJN2AArIHBLtoNeiO1J DrytgwcVapKz//QoNyY0VnjNUloyDk+UXGAAcP2lTEObjFJFDw63pCrzauVe3rCr1KTg V0+PMpj4NodiLKmgZfJUseDOFO8eMl+wUq0VU= Received: by 10.142.201.1 with SMTP id y1mr632548wff.345.1285978313573; Fri, 01 Oct 2010 17:11:53 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id o16sm1954809wfh.19.2010.10.01.17.11.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 01 Oct 2010 17:11:52 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 1 Oct 2010 17:11:00 -0700 From: Pyun YongHyeon Date: Fri, 1 Oct 2010 17:11:00 -0700 To: freebsd-usb@FreeBSD.org Message-ID: <20101002001100.GL10521@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Hans Petter Selasky Subject: Network TX/RX fairness is not honored by USB stack X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 00:40:36 -0000 Hi, I don't know how long it had been there but it seems current USB stack does not honor fairness of TX/RX on USB ethernet controller. Unidirectional performance test(UDP) or most-unidirectional performance(TCP) test works well without problems. However if heavy TX/RX traffic hits controller at the same time either TX or RX is not served at all. I'm under the impression that whenever TX work is done it seems USB reschedules next pending TX again instead of processing RX such that RX is starved to death. This can be easily reproduced on two hosts with the netperf performance test. Whenever both hosts send tiny UDP datagrams to the other host either TX or RX packet counters are not increasing until the end of the UDP torture test. The number of EHCI interrupt is about 8K/s while test is in progress so I think it reached its maximum processing limit. After netperf testing, it can still process TX/RX packets even though it dropped too many RX packets. But these dropped packets are not counted so netstat(1) shows 0 dropped frames even though it lost millions of packets. Hans, do you have any idea what's going on here? You can use the following netperf command on both hosts after running netserver. %netperf -c -H ip_addr_of_other_host -tUDP_STREAM -l 300 -- -m 1 Another odd thing I noticed is number of interrupts does not go down to 0 after the testing. It constantly generates 1k/s interrupts after that. The only way I stop that interrupts was to down the ue0 interface with "ifconfig ue0 down" command.