Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 2 Jan 2003 07:56:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 2 Jan 2003 07:56:11 -0500 Received: from elin.scali.no ([62.70.89.10]:2052 "EHLO elin.scali.no") by vger.kernel.org with ESMTP id ; Thu, 2 Jan 2003 07:56:03 -0500 Date: Thu, 2 Jan 2003 14:06:41 +0100 (CET) From: Steffen Persvold X-X-Sender: sp@sp-laptop.isdn.scali.no To: linux-kernel@vger.kernel.org, cc: netdev@oss.sgi.com Subject: One-way Gigabit Ethernet TCP performance with Jumbo frames In-Reply-To: <3E142D85.71FFA06C@digeo.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463794943-2128730964-1041512801=:18738" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 24306 Lines: 420 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463794943-2128730964-1041512801=:18738 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi all, Lately I've been testing out two Gigabit Ethernet adapters on Pentium 4 Xeon platforms; onboard Intel 82544GC (e1000 driver) and onboard Broadcom BCM5701 (tg3 driver), and I'm experiencing some wierd behaviour on one-way tests (ping-ping). The machines I'm testing is connected back to back (i.e no switch) and are fairly fast systems (Dual Xeon 2.4 GHz, 1GB memory) configured to use Jumbo frames (9000 bytes). With ping-pong traffic (the attached program run with -bo, or NetPipe default) the bandwidth performance is close to wire speed (123 MByte/sec) and the ping-pong/2 latency is ~30us with both GbE devices. But, when running a one-way test (where one machine only sends, and the other only receives, i.e ping-ping) there is a serious dip in the performance curve at ~768 bytes and the bandwidth levels out at approx 60 MByte/sec (about half of peak) regadless of application and GbE device. However, if the benchmark applications are started at 2048 bytes (and not 0 which is default), or the MTU is set to standard 1500 bytes, there is no such "dip" in the performance curve. Is there a new "silly window" syndrome going on here ? Both applications use TCP_NODELAY. I'll appreciate any feedback, and I'm happy to assist in the debugging process testing out patches etc. PS Attached you'll find a yet another "bandwidth" program which measures TCP performance i three ways; ping-ping (one-way), ping-pong, and exchange (two way). Should compile fine with gcc -O2, and you must start a server process (-Ts) on one machine and a client process (-Tc -s ) on the other machine. DS Best regards, -- Steffen Persvold | Scali AS mailto:sp@scali.com | http://www.scali.com Tel: (+47) 2262 8950 | Olaf Helsets vei 6 Fax: (+47) 2262 8951 | N0621 Oslo, NORWAY ---1463794943-2128730964-1041512801=:18738 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="bandwidth.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="bandwidth.c" I2RlZmluZSBNT0RVTEUgICAgIkJBTkRXSURUSCINCiNkZWZpbmUgTU9EVUxF X0lEICJAKCMpJElkOiBiYW5kd2lkdGguYyx2IDEuNyAyMDAyLzEyLzI2IDEz OjUxOjQ0IHNwIEV4cCAkIg0KDQovKiBDb3B5cmlnaHQgTm90aWNlIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0NCi8vDQovLyBiYW5kd2lkdGguYzogcG9pbnQtdG8tcG9pbnQg cGVyZm9ybWFuY2UgYmVuY2htYXJrDQovLw0KLy8gQ29weXJpZ2h0IChDKSAy MDAxICBTY2FsaSBBUyAgIA0KLy8NCi8vIFRoaXMgcHJvZ3JhbSBpcyBmcmVl IHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9k aWZ5DQovLyBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFs IFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieQ0KLy8gdGhlIEZyZWUg U29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZ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AgICAgcHJpbnRmKCIlMTRzICUxNHMgJTE0cyAlMTRzICUxNHNc biIsDQoJICAgICAiKGJ5dGVzKSIsICIoY291bnQpIiwgIihzZWNvbmRzKSIs ICIoTWJ5dGVzL3MpIiwgIih1c2VjKSIpOw0KICAgICAgcHJpbnRmKCItLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuIik7DQogICB9DQp9DQoNCnN0 YXRpYyB2b2lkDQptZWFzdXJlKGJlbmNoX3JvdXRfdCByb3V0LCBpbnQgc2Nh bGUsIGludCBzeikgew0KICAgaW50IGksIGl0ZXIgPSAwOw0KICAgc3RhdGlj IGludCBwcmV2X2l0ZXIgPSAwOw0KICAgc3RhdGljIGJlbmNoX3JvdXRfdCBw cmV2X3JvdXQgPSBOVUxMOw0KICAgY2hhciAgICAgICAgICAgICAgICpwMSA9 IChjaGFyICopKGFsaWduID8gdmFsbG9jIDogbWFsbG9jKShzeiksDQoJCSAg ICAgICpwMiA9IChjaGFyICopKGFsaWduID8gdmFsbG9jIDogbWFsbG9jKShz eik7DQogICBkb3VibGUgICAgICAgICAgICAgIHQsIHRtaW4sIHM7DQogICAN CiAgIGlmICh0b3VjaF90eF9pbml0aWFsbHkpIG1lbXNldChwMSwgMCwgc3op Ow0KDQogICAvKg0KICAgICogT25seSBzcGVuZCB0aW1lIGNhbGN1bGF0aW5n IGEgbmV3IGl0ZXJhdGlvbiBjb3VudCBpZg0KICAgICogICAgMSkgd2UgaGF2 ZSBhIG5ldyB0ZXN0IGZ1bmN0aW9uDQogICAgKiAgICAgICBvcg0KICAgICog ICAgMikgd2UgYXJlIG5vdCBkb3duIHRvIG1pbl9pdGVyIG51bWJlciBvZiBp dGVyYXRpb25zIHlldA0KICAgICovDQoNCiAgIGlmIChwcmV2X3JvdXQgIT0g cm91dCB8fCBwcmV2X2l0ZXIgPiBtaW5faXRlcikgew0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AgLXMgPHNlcnZl cj4gIDogU2VydmVyIHRvIGNvbm5lY3QgdG8uIERlZmF1bHQgbG9jYWxob3N0 LlxuIg0KICAgICAgIiAgICAgLWEgICAgICAgICAgIDogRm9yY2UgcGFnZS1h bGlnbmVkIGJ1ZmZlciBhbGxvY2F0aW9uLiBEZWZhdWx0IG9mZi5cbiINCiAg ICAgICIgICAgIC1iIDxpfG98eD4gICA6IEJlbmNobWFyayB0byBydW4sIHBJ bmctcEluZywgcGluZy1wT25nLCBvciBlWGNoYW5nZS5cbiINCiAgICAgICIg ICAgICAgICAgICAgICAgICAgIERlZmF1bHQgYWxsLlxuIg0KICAgICAgIiAg ICAgLW0gPGludD4gICAgIDogTWluaW11bSBtZXNzYWdlIGxlbmd0aC4gRGVm YXVsdCAwLlxuIg0KICAgICAgIiAgICAgLU0gPGludD4gICAgIDogTWF4aW11 bSBtZXNzYWdlIGxlbmd0aC4gRGVmYXVsdCAxNk0uXG4iDQogICAgICAiICAg ICAtdCA8ZmxvYXQ+ICAgOiBTcGVjaWZpZXMgdGhlIGdvYWwgZm9yIHRoZSBl bGFwc2VkIHRpbWUgdXNlZCBwZXIgdGVzdC5cbiINCiAgICAgICIgICAgICAg ICAgICAgICAgICAgIERlZmF1bHQgJS4xZlxuIg0KICAgICAgIiAgICAgLVYg ICAgICAgICAgIDogUHJpbnRzIHZlcnNpb24uXG4iDQogICAgICAiICAgICAt eiA8bWFzaz4gICAgOiBCdWZmZXIgaW5pdGlhbGl6YXRpb24vdG91Y2guIERl ZmF1bHQgMS5cbiINCiAgICAgICIgICAgICAgICBtYXNrJjEgICA6IEluaXRp YWwgaW5pdGlhbGl6YXRpb24gb2Ygc2VuZCBidWZmZXIuXG4iDQogICAgICAi ICAgICAgICAgbWFzayYyICAgOiBJbml0aWFsaXphdGlvbiBvZiBzZW5kIGJ1 ZmZlciBiZWZvcmUgZXZlcnkgc2VuZC5cbiINCiAgICAgICIgICAgICAgICBt YXNrJjQgICA6IFJlYWQgcmVjZW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IC8qIGZpbmQgY2xvY2sgcmVzb2x1dGlvbiAqLw0KICAgZm9yIChqPTAs IGJlc3RfdHJlcz0xZTY7IGo8MTA7ICsraikgew0KICAgICAgZm9yICh0MT1i d193dGltZSgpOyAodDI9Yndfd3RpbWUoKSkgPT0gdDE7KTsNCiAgICAgIHQy ID0gdDIgLSB0MTsNCiAgICAgIA0KICAgICAgYndfc2VuZHJlY3YoJnQyLCAm dHJlcywgc2l6ZW9mKGRvdWJsZSkpOw0KICAgICAgdHJlcyA9ICh0cmVzICsg dDIpIC8gMjsNCiAgICAgIGlmICh0cmVzIDwgYmVzdF90cmVzKSBiZXN0X3Ry ZXM9dHJlczsNCiAgIH0NCiAgIHRyZXMgPSBiZXN0X3RyZXM7DQoNCiAgIGlm IChtZSA9PSAwKSB7DQogICAgICBpbnQgaW50YVsxNl07DQogICAgICBpbnRh WzBdID0gdG91Y2hfdHhfaW5pdGlhbGx5Ow0KICAgICAgaW50YVsxXSA9IHRv dWNoX3R4X2Fsd2F5czsNCiAgICAgIGludGFbMl0gPSB0b3VjaF9yeDsNCiAg ICAgIGludGFbM10gPSBhbGlnbjsNCiAgICAgIGludGFbNF0gPSBiZW5jaF9t YXNrOw0KICAgICAgaW50YVs1XSA9IG1zZ19taW47DQogICAgICBpbnRhWzZd ID0gbXNnX21heDsNCiAgICAgIGJ3X3NlbmQoaW50YSwgNyAqIHNpemVvZihp bnQpKTsNCiAgICAgIGJ3X3NlbmQoJnRnb2FsLCBzaXplb2YoZG91YmxlKSk7 DQogICB9IGVsc2Ugew0KICAgICAgaW50IGludGFbMTZdOw0KICAgICAgYndf cmVjdihpbnRhLCA3ICogc2l6ZW9mKGludCkpOw0KICAgICAgYndfcmVjdigm dGdvYWwsIHNpemVvZihkb3VibGUpKTsNCiAgICAgIHRvdWNoX3R4X2luaXRp YWxseSA9IGludGFbMF07DQogICAgICB0b3VjaF90eF9hbHdheXMgPSBpbnRh WzFdOw0KICAgICAgdG91Y2hfcnggPSBpbnRhWzJdOw0KICAgICAgYWxpZ24g PSBpbnRhWzNdOw0KICAgICAgYmVuY2hfbWFzayA9IGludGFbNF07DQogICAg ICBtc2dfbWluID0gaW50YVs1XTsNCiAgICAgIG1zZ19tYXggPSBpbnRhWzZd Ow0KICAgfQ0KICANCiAgIC8qIGlmIG5vIGJlbmNobWFya3MgaGF2ZSBiZWVu IHNwZWNpZmllZCwgd2UgZGVmYXVsdCB0byBhbGwgKi8NCiAgIGlmICghYmVu Y2hfbWFzaykgYmVuY2hfbWFzayA9IERPX1BJTkdfUElOR3xET19QSU5HX1BP Tkd8RE9fRVhDSEFOR0U7DQoNCiAgIGlmIChtZSA9PSAwKQ0KICAgICAgcHJp bnRmKCJSZXNvbHV0aW9uICh1c2VjKTogJWZcbiIsIHRyZXMqMWU2KTsNCiAg IA0KICAgZm9yIChqPTA7IGJlbmNoW2pdLmJlbmNoOyArK2opIHsNCg0KICAg ICAgaWYgKCEoYmVuY2hfbWFzayAmIGJlbmNoW2pdLm1hc2spKSBjb250aW51 ZTsNCgkgIA0KICAgICAgcHJpbnRfaGVhZGVyKGJlbmNoW2pdLm1uZW0pOw0K ICAgICAgaW5jID0gbXNnX21pbiA+PiAyOw0KICAgICAgZm9yIChzej1tc2df bWluOyBzeiA8PSBtc2dfbWF4OyBzeis9aW5jKSB7DQoJIGlmIChzeiA8IDQp IHsNCgkgICAgaW5jID0gMTsNCgkgfSBlbHNlIHsNCgkgICAgaWYgKCEoc3og JiBpbmMpKSBpbmMrPWluYzsgLyogR290IHRoaXM/ICovDQoJIH0NCg0KCSBt ZWFzdXJlKGJlbmNoW2pdLmJlbmNoLCBiZW5jaFtqXS5zY2FsZSwgc3opOw0K ICAgICAgfQ0KICAgICAgaWYgKG1lID09IDApIHByaW50ZigiXG5cbiIpOw0K ICAgfQ0KDQogICBid19leGl0KDApOw0KDQogICByZXR1cm4gMDsNCn0NCg== ---1463794943-2128730964-1041512801=:18738-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/