From owner-freebsd-net@freebsd.org Wed Aug 19 12:22:39 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A83D19BC36F; Wed, 19 Aug 2015 12:22:39 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0B1A410A9; Wed, 19 Aug 2015 12:22:38 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:Vxk/qxbJTY/CfjipoofHFNv/LSx+4OfEezUN459isYplN5qZpcuybnLW6fgltlLVR4KTs6sC0LqN9fy+EjBfqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7v0p8OYP1oArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIZoGJ/3dKUgTLFeEC9ucyVsvJWq5lH/Sl6v730HGl0bjgZFGUD+4RXzRZTg+n/6rvFVwySeNNb1XPYzQzv0vIlxTxq9siYMNHYc+WrUjsF1xPZBpRuqpBhyxqbJZ46IOf5mfuXWdIVJFiJ6Qs9NWnkZUcuHZIwVAr9EZL4Aog== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AnAgCWc9RV/61jaINdg29pBoMfuiQBCYFtCoUxSgKBehQBAQEBAQEBAYEJgh2CBwEBBAEBASArIAsQAgEIGAICDRkCAicBCSYCBAgHBAEcBIgNDblVlhsBAQEBAQEBAQEBAQEBAQEBARcEgSKKMYQyBgEBHDQHgmmBQwWVI4UEhQcxg3sVlGqDZgImhBkiMwd/CBcjgQQBAQE X-IronPort-AV: E=Sophos;i="5.15,709,1432612800"; d="scan'208";a="231624929" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 19 Aug 2015 08:22:37 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 1DFE315F574; Wed, 19 Aug 2015 08:22:37 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oGHvcUGKoy3Z; Wed, 19 Aug 2015 08:22:36 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 76F4315F577; Wed, 19 Aug 2015 08:22:36 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aicDNu_ZdPFR; Wed, 19 Aug 2015 08:22:36 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 5630215F574; Wed, 19 Aug 2015 08:22:36 -0400 (EDT) Date: Wed, 19 Aug 2015 08:22:36 -0400 (EDT) From: Rick Macklem To: Hans Petter Selasky Cc: pyunyh@gmail.com, FreeBSD stable , FreeBSD Net , Slawa Olhovchenkov , Christopher Forgeron Message-ID: <160577762.25683294.1439986956328.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <55D43615.1030401@selasky.org> References: <1D52028A-B39F-4F9B-BD38-CB1D73BF5D56@cs.huji.ac.il> <9D8B0503-E8FA-43CA-88F0-01F184F84D9B@cs.huji.ac.il> <1721122651.24481798.1439902381663.JavaMail.zimbra@uoguelph.ca> <55D333D6.5040102@selasky.org> <1325951625.25292515.1439934848268.JavaMail.zimbra@uoguelph.ca> <55D429A4.3010407@selasky.org> <20150819074212.GB964@michelle.fasterthan.com> <55D43615.1030401@selasky.org> Subject: Re: ix(intel) vs mlxen(mellanox) 10Gb performance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.10] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF34 (Win)/8.0.9_GA_6191) Thread-Topic: ix(intel) vs mlxen(mellanox) 10Gb performance Thread-Index: 3tLtiaT//pF56x9z31ShK3tEdfsYmQ== X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 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, 19 Aug 2015 12:22:39 -0000 Hans Petter Selasky wrote: > On 08/19/15 09:42, Yonghyeon PYUN wrote: > > On Wed, Aug 19, 2015 at 09:00:52AM +0200, Hans Petter Selasky wrote: > >> On 08/18/15 23:54, Rick Macklem wrote: > >>> Ouch! Yes, I now see that the code that counts the # of mbufs is before > >>> the > >>> code that adds the tcp/ip header mbuf. > >>> > >>> In my opinion, this should be fixed by setting if_hw_tsomaxsegcount to > >>> whatever > >>> the driver provides - 1. It is not the driver's responsibility to know if > >>> a tcp/ip > >>> header mbuf will be added and is a lot less confusing that expecting the > >>> driver > >>> author to know to subtract one. (I had mistakenly thought that > >>> tcp_output() had > >>> added the tc/ip header mbuf before the loop that counts mbufs in the > >>> list. > >>> Btw, > >>> this tcp/ip header mbuf also has leading space for the MAC layer header.) > >>> > >> > >> Hi Rick, > >> > >> Your question is good. With the Mellanox hardware we have separate > >> so-called inline data space for the TCP/IP headers, so if the TCP stack > >> subtracts something, then we would need to add something to the limit, > >> because then the scatter gather list is only used for the data part. > >> > > > > I think all drivers in tree don't subtract 1 for > > if_hw_tsomaxsegcount. Probably touching Mellanox driver would be > > simpler than fixing all other drivers in tree. > > > >> Maybe it can be controlled by some kind of flag, if all the three TSO > >> limits should include the TCP/IP/ethernet headers too. I'm pretty sure > >> we want both versions. > >> > > > > Hmm, I'm afraid it's already complex. Drivers have to tell almost > > the same information to both bus_dma(9) and network stack. > > Don't forget that not all drivers in the tree set the TSO limits before > if_attach(), so possibly the subtraction of one TSO fragment needs to go > into ip_output() .... > I think setting them before a call to ether_ifattach() should be required and any driver that doesn't do that needs to be fixed. Also, I notice that "32 * MCLBYTES - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)" is getting written as "65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)" which obscures the reason it is the default. It probably isn't the correct default for any driver that sets if_hw_tsomaxsegcount, but is close to IP_MAXPACKET, so the breakage is mostly theoretical. rick > --HPS > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >