From owner-freebsd-net@FreeBSD.ORG Wed Sep 4 22:03:14 2013 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BCA9B50E for ; Wed, 4 Sep 2013 22:03:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48D652989 for ; Wed, 4 Sep 2013 22:03:14 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id y10so994785wgg.0 for ; Wed, 04 Sep 2013 15:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=aCkVyWzpNb580w9ooyeoDrdsINsyg05aSOsAqX8PyfE=; b=rBFPPiwCmS54ImdhPvbkyqbkThbnCFouWkaToytc3BH/dK2CibUBwL+k25YSXNfLNS 19ZE5LNKJTJ1PLQ+rxw3r9t0dJnY/5fZMUG94WZrSmzosZia8Ey3ppIitsSL3NwIx2Lv NW8ro0TrW2Z0rBX9z3DO53aaZ1WW5VXwlNDIBzxHecr5Nzf5dJ3fjB2RrBfZgIe8J/JT vi6Ee6MrOuwdScHvQuN4i0HympQci+O8hWkTVLfMVvvpOb702xqe8qs+gLY0j3wMrKoZ lZtqn8DTl9poRBI4eo7HSzKzHOyvqI6BI1u6PHJ6lYYr9LLhdcsyOSN1LBLN42Akg0Pi 9Kkw== MIME-Version: 1.0 X-Received: by 10.194.175.193 with SMTP id cc1mr57690wjc.54.1378332192706; Wed, 04 Sep 2013 15:03:12 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.146.2 with HTTP; Wed, 4 Sep 2013 15:03:12 -0700 (PDT) In-Reply-To: <979862494.17918795.1378299005617.JavaMail.root@uoguelph.ca> References: <20130903192734.GA19406@albert.catwhisker.org> <979862494.17918795.1378299005617.JavaMail.root@uoguelph.ca> Date: Wed, 4 Sep 2013 15:03:12 -0700 X-Google-Sender-Auth: AOTdP_iy6E8KxivJo6Td3gzB_rQ Message-ID: Subject: Re: TSO and FreeBSD vs Linux From: Adrian Chadd To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Net , David Wolfskill X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2013 22:03:14 -0000 Hiya, David - can you put together a minimal test case that others can reproduce? I have a bunch of gige intel NICs that I can try this with when I'm back in the office. Thanks, -adrian On 4 September 2013 05:50, Rick Macklem wrote: > David Wolfskill wrote: > > On Wed, Aug 21, 2013 at 07:12:38PM +0200, Andre Oppermann wrote: > > > On 13.08.2013 19:29, Julian Elischer wrote: > > > > I have been tracking down a performance embarrassment on AMAZON > > > > EC2 and have found it I think. > > > > Our OS cousins over at Linux land have implemented some > > > > interesting behaviour when TSO is in use. > > > > > > There used to be a different problem with EC2 and FreeBSD TSO. The > > > Xen hypervisor > > > doesn't like large 64K TSO bursts we generate, the drivers drops > > > the whole TSO chain, > > > TCP gets upset and turns off TSO alltogether leaving the connection > > > going at one > > > packet a time as in the old days. > > > ... > > > > My apologies for jumping in so late -- I'm not subscribed to -net@. > > > > At work, I received a new desktop machine a few months ago; here's a > > recent history of what it has been running: > > > > FreeBSD 9.2-PRERELEASE #4 r254801M/254827:902501: Sun Aug 25 > > 05:15:29 PDT 2013 root@dwolf-fbsd:/usr/obj/usr/src/sys/DWOLF > > amd64 > > FreeBSD 9.2-PRERELEASE #5 r255066M/255091:902503: Sat Aug 31 > > 11:58:53 PDT 2013 root@dwolf-fbsd:/usr/obj/usr/src/sys/DWOLF > > amd64 > > FreeBSD 9.2-PRERELEASE #5 r255104M/255115:902503: Sun Sep 1 > > 05:02:12 PDT 2013 root@dwolf-fbsd:/usr/obj/usr/src/sys/DWOLF > > amd64 > > > > Now, I like to have a "private playground" for doing things with > > machines, so I make use of both em(4) NICs on the machine: em0 > > connects > > to the rest of the work network; em1 is connected to a switch I > > brought > > in from home, and to which I connect "other things" (such as my > > laptop). > > And because I'm fairly comfortable with them, I use IPFW & natd. For > > some folks here, none of that should come as a surprise. :-}) > > > > For reference, the em(4) devices in question are: > > > > em0@pci0:0:25:0: class=0x020000 card=0x060d15d9 > > chip=0x10ef8086 rev=0x06 hdr=0x00 > > vendor = 'Intel Corporation' > > device = '82578DM Gigabit Network Connection' > > > > and > > > > em1@pci0:3:0:0: class=0x020000 card=0x060d15d9 chip=0x10d38086 > > rev=0x00 hdr=0x00 > > vendor = 'Intel Corporation' > > device = '82574L Gigabit Network Connection' > > > > > > > > I noticed that when I tried to write files to NFS, I could write > > small > > files OK, but larger ones seemed to ... hang. > > > > Note: We don't use jumbo frames. (Work IT is convinced that they > > don't help. I'm trying to better-understand their reasoning.) > > > > Further poking around showed that (under the above conditions): > > * natd CPU% was climbing as more of the file was copied, up to 2^21 > > bytes. (At that point, nothing further was saved on NFS.) > > * dhcpd CPU% was also climbing. I tried killing that, but doing so > > didn't affect the other results. (Killing natd made connectivity > > cease, given the IPFW rules in effect.) > > * Performing a tcpdump while trying to copy a file of length > > 117709618 > > showed lots of TCP retransmissions. In fact, I'd hazard that every > > TCP > > packet was getting retransmitted. > > * "ifconfig -v em0" showed flags TSO4 & VLAN_HWTSO turned on. > > * "sysctl net.inet.tcp.tso" showed "1" -- enabled. > > > > As soon as I issued "sudo net.inet.tcp.tso=0" ... the copy worked > > without > > a hitch or a whine. And I was able to copy all 117709618 bytes, not > > just > > 2097152 (2^21). > > > > Is the above expected? It came rather as a surprise to me. > > > Not surprising to me, I'm afraid. When there are serious NFS problems > like this, it is often caused by a network fabric issue and broken > TSO is at the top of the list w.r.t. cause. > > rick > > > Peace, > > david > > -- > > David H. Wolfskill david@catwhisker.org > > Taliban: Evil cowards with guns afraid of truth from a 14-year old > > girl. > > > > See http://www.catwhisker.org/~david/publickey.gpg for my public key. > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >