Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Sep 2017 16:46:46 -0700
From:      Stephen Hurd <shurd@sasktel.net>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        Stephen Hurd <shurd@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r323942 - head/sys/net
Message-ID:  <89d68ff8-84ed-83a6-4e77-9a321babe2fe@sasktel.net>
In-Reply-To: <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net>
References:  <201709230135.v8N1ZE6S063264@repo.freebsd.org> <B28D9879-4ECF-43E4-9A58-51F616CEC4BE@lists.zabbadoz.net> <283397c7-a01e-3776-7ed3-b64d68003d0b@sasktel.net> <6F5DC92C-2CF6-4A33-9663-BFECB7DB65F2@lists.zabbadoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?89d68ff8-84ed-83a6-4e77-9a321babe2fe>