From owner-freebsd-stable@freebsd.org Wed Aug 19 07:30:23 2015 Return-Path: Delivered-To: freebsd-stable@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 86E7D9BD560; Wed, 19 Aug 2015 07:30:23 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51A5E1AB8; Wed, 19 Aug 2015 07:30:23 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by pdob1 with SMTP id b1so22219525pdo.2; Wed, 19 Aug 2015 00:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=qogDhQRuOFK/8Y4NwWfjhcQYE5bkkvb9vv4hdO8b688=; b=uBtsrv+nlh9+jpt1qEuc/lfvyHHI1MeApda4eX6HpBMMavTPwtPe+aC/Ir8H07nAsA agR/lb+IWyL/MDRccbRCzKE6pab6UX4MHU2xVLFlJ1MbBSYlRF6pDsF0/fjEHr/Ofymx 0iHNveprCGI2PeiKuT9b0Dya3CD5AAN2RwIq2ABSJ5zIFG56pMCTnB9q0NDtVWhh7nGB Zemq9Nm7e5V38NhSAApf7q5H1De9vW9G+L2/1YJQWIEb7AdJgCoJduCNE+vm8Zj/lQaA OzPmFzXpnkFssRIwSnEM9Bwmfjwi3xJEuussCv/U9vVF47ymT4k4YbQVFGMGySOow5/l ubdw== X-Received: by 10.70.44.228 with SMTP id h4mr21767238pdm.45.1439969422805; Wed, 19 Aug 2015 00:30:22 -0700 (PDT) Received: from pyunyh@gmail.com ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id gw3sm20428044pbc.46.2015.08.19.00.30.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Aug 2015 00:30:21 -0700 (PDT) From: Yonghyeon PYUN X-Google-Original-From: "Yonghyeon PYUN" Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 19 Aug 2015 16:30:10 +0900 Date: Wed, 19 Aug 2015 16:30:10 +0900 To: Rick Macklem Cc: Hans Petter Selasky , Daniel Braniss , FreeBSD Net , Christopher Forgeron , FreeBSD stable , Slawa Olhovchenkov Subject: Re: ix(intel) vs mlxen(mellanox) 10Gb performance Message-ID: <20150819073010.GA964@michelle.fasterthan.com> Reply-To: pyunyh@gmail.com References: <1D52028A-B39F-4F9B-BD38-CB1D73BF5D56@cs.huji.ac.il> <17871443-E105-4434-80B1-6939306A865F@cs.huji.ac.il> <473274181.23263108.1439814072514.JavaMail.zimbra@uoguelph.ca> <7F892C70-9C04-4468-9514-EDBFE75CF2C6@cs.huji.ac.il> <805850043.24018217.1439848150695.JavaMail.zimbra@uoguelph.ca> <9D8B0503-E8FA-43CA-88F0-01F184F84D9B@cs.huji.ac.il> <1721122651.24481798.1439902381663.JavaMail.zimbra@uoguelph.ca> <55D331A5.9050601@selasky.org> <805386587.25297673.1439935465127.JavaMail.zimbra@uoguelph.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <805386587.25297673.1439935465127.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 07:30:23 -0000 On Tue, Aug 18, 2015 at 06:04:25PM -0400, Rick Macklem wrote: > Hans Petter Selasky wrote: > > On 08/18/15 14:53, Rick Macklem wrote: > > > If this is just a test machine, maybe you could test with these lines (at > > > about #880) > > > in sys/netinet/tcp_output.c commented out? (It looks to me like this will > > > disable TSO > > > for almost all the NFS writes.) > > > - around line #880 in sys/netinet/tcp_output.c: > > > /* > > > * In case there are too many small fragments > > > * don't use TSO: > > > */ > > > if (len <= max_len) { > > > len = max_len; > > > sendalot = 1; > > > tso = 0; > > > } > > > > > > This was added along with the other stuff that did the > > > if_hw_tsomaxsegcount, etc and I > > > never noticed it until now (not my patch). > > > > FYI: > > > > These lines are needed by other hardware, like the mlxen driver. If you > > remove them mlxen will start doing m_defrag(). I believe if you set the > > correct parameters in the "struct ifnet" for the TSO size/count limits > > this problem will go away. If you print the "len" and "max_len" and also > > the cases where TSO limits are reached, you'll see what parameter is > > triggering it and needs to be increased. > > > Well, if the driver isn't setting if_hw_tsomaxsegcount correctly, then it > is the driver that needs to be fixed. > Having the above code block disable TSO for all of the NFS writes, including > the ones that set if_hw_tsomaxsegcount correctly doesn't make sense to me. > If the driver authors don't set these, the drivers do lots of m_defrag() > calls. I have posted more than once to freebsd-net@ asking the driver authors > to set these and some now have. (I can't do it, because I don't have the > hardware to test it with.) > Thanks for reminder. I have generated a diff against HEAD. https://people.freebsd.org/~yongari/tso.param.diff The diff restores optimal TSO parameters which were lost in r271946 for drivers that relied on sane default values. I'll commit it after some testing. > I do think that most/all of them don't subtract 1 for the tcp/ip header and > I don't think they should be expected to, since the driver isn't supposed to > worry about the protocol at that level. I agree. > --> I think tcp_output() should subtract one from the if_hw_tsomaxsegcount > provided by the driver to handle this, since it chooses to count mbufs > (the while() loop at around line #825 in sys/netinet/tcp_output.c.) > before it prepends the tcp/ip header mbuf. > > rick > > > --HPS