From owner-svn-src-head@freebsd.org Sun Sep 24 00:10:14 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 9CE3AE14FA8; Sun, 24 Sep 2017 00:10:14 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail142c7.megamailservers.com (mail542c7.megamailservers.com [209.235.141.42]) (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 22BB33FCE; Sun, 24 Sep 2017 00:10:13 +0000 (UTC) (envelope-from shurd@sasktel.net) X-Authenticated-User: hurds.sasktel.net X-VIP: 69.49.109.87 Received: from [192.168.0.33] (ip72-194-73-141.oc.oc.cox.net [72.194.73.141]) (authenticated bits=0) by mail142c7.megamailservers.com (8.14.9/8.13.1) with ESMTP id v8NNkkIM027188; Sat, 23 Sep 2017 19:46:49 -0400 Subject: Re: svn commit: r323942 - head/sys/net To: "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> From: Stephen Hurd Message-ID: <89d68ff8-84ed-83a6-4e77-9a321babe2fe@sasktel.net> Date: Sat, 23 Sep 2017 16:46:46 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CTCH-RefID: str=0001.0A020201.59C6F26A.007E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.2 cv=F7AnTupN c=1 sm=1 tr=0 a=l4Y+EJuLrT/8f1z5FvEQ1g==:117 a=l4Y+EJuLrT/8f1z5FvEQ1g==:17 a=IkcTkHD0fZMA:10 a=6I5d2MoRAAAA:8 a=GtM8sYFC6DhVkiSUIvIA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 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 00:10:14 -0000 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.