From owner-svn-src-head@freebsd.org Sun Sep 24 08:53:04 2017 Return-Path: Delivered-To: svn-src-head@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 A3907E23224; Sun, 24 Sep 2017 08:53:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 692066EC35; Sun, 24 Sep 2017 08:53:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A86722601A9; Sun, 24 Sep 2017 10:52:59 +0200 (CEST) Subject: Re: svn commit: r323942 - head/sys/net To: Stephen Hurd , "Bjoern A. Zeeb" Cc: Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201709230135.v8N1ZE6S063264@repo.freebsd.org> <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net> <89d68ff8-84ed-83a6-4e77-9a321babe2fe@sasktel.net> From: Hans Petter Selasky Message-ID: <3601ee57-2bf5-036a-a3d1-a4795847d0ec@selasky.org> Date: Sun, 24 Sep 2017 10:50:29 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <89d68ff8-84ed-83a6-4e77-9a321babe2fe@sasktel.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 08:53:04 -0000 On 09/24/17 01:46, Stephen Hurd wrote: > Bjoern A. Zeeb wrote: >> On 23 Sep 2017, at 6:32, Stephen Hurd wrote: >> >>> Bjoern A. Zeeb wrote: >>>> On 23 Sep 2017, at 1:35, Stephen Hurd wrote: >>>> >>>>> Author: shurd >>>>> Date: Sat Sep 23 01:35:14 2017 >>>>> New Revision: 323942 >>>>> URL: https://svnweb.freebsd.org/changeset/base/323942 >>>>> >>>>> Log: >>>>>    Chain mbufs before passing to if_input() >>>>> >>>>>    Build a list of mbufs to pass to if_input() after LRO. Results in >>>>>    12% small packet forwarding rate improvement. >>>> forwarding seems a confusing word here.. >>> >>> The test was small (64 byte frames) received on one interface, then >>> sent out on a different one using the net.inet.ip.forwarding sysctl >>> (controlled via the gateway_enable setting in rc.conf). >> >> Then this makes no sense as we don’t do LRO if forwarding is enabled >> on the machine; >> https://svnweb.freebsd.org/base/head/sys/netinet/tcp_lro.c?annotate=317390#l645 >> > > Basically, it changed from this: > > foreach (mbuf in rx) { >   if (lro && tcp_lro_rx(mbuf) == 0) >     continue; >   if_input(mbuf) > } > > To this: > > prev_mbuf = first_mbuf = NULL; > foreach (mbuf in rx) { >   if (lro && tcp_lro_rx(mbuf) == 0) >     continue; >   if (prev_mbuf) { >     prev_mbuf->m_nextpkt = mbuf; >     prev_mbuf = mbuf; >   } >   else { >     first_mbuf = prev_mbuf = mbuf; >   } > } > > if (first_mbuf) >   if_input(first_mbuf); > > So while before it called if_input() for each separate mbuf that was not > LROed, it now builds a chain of mbufs that were not LROed, and makes a > single call to if_input() with the whole chain.  For cases like packet > forwarding where no packets are LROed, performance is better. > Can such a similar logic be applied inside TCP LRO aswell? --HPS