From: Alexander Lobakin <alobakin@dlink.ru>
To: David Miller <davem@davemloft.net>
Cc: ecree@solarflare.com, jiri@mellanox.com, edumazet@google.com,
idosch@mellanox.com, pabeni@redhat.com, petrm@mellanox.com,
sd@queasysnail.net, f.fainelli@gmail.com,
jaswinder.singh@linaro.org, manishc@marvell.com,
GR-Linux-NIC-Dev@marvell.com, johannes.berg@intel.com,
emmanuel.grumbach@intel.com, luciano.coelho@intel.com,
linuxwifi@intel.com, kvalo@codeaurora.org,
netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next] net: core: allow fast GRO for skbs with Ethernet header in head
Date: Sun, 17 Nov 2019 12:52:24 +0300 [thread overview]
Message-ID: <5622418d39ce3ebc3d526d3e16c8546b@dlink.ru> (raw)
In-Reply-To: <20191116.130101.268806870571558138.davem@davemloft.net>
David Miller wrote 17.11.2019 00:01:
> From: Alexander Lobakin <alobakin@dlink.ru>
> Date: Fri, 15 Nov 2019 12:11:35 +0300
>
>> Commit 78d3fd0b7de8 ("gro: Only use skb_gro_header for completely
>> non-linear packets") back in May'09 (v2.6.31-rc1) has changed the
>> original condition '!skb_headlen(skb)' to
>> 'skb->mac_header == skb->tail' in gro_reset_offset() saying: "Since
>> the drivers that need this optimisation all provide completely
>> non-linear packets" (note that this condition has become the current
>> 'skb_mac_header(skb) == skb_tail_pointer(skb)' later with commmit
>> ced14f6804a9 ("net: Correct comparisons and calculations using
>> skb->tail and skb-transport_header") without any functional changes).
>>
>> For now, we have the following rough statistics for v5.4-rc7:
>> 1) napi_gro_frags: 14
>> 2) napi_gro_receive with skb->head containing (most of) payload: 83
>> 3) napi_gro_receive with skb->head containing all the headers: 20
>> 4) napi_gro_receive with skb->head containing only Ethernet header: 2
>>
>> With the current condition, fast GRO with the usage of
>> NAPI_GRO_CB(skb)->frag0 is available only in the [1] case.
>> Packets pushed by [2] and [3] go through the 'slow' path, but
>> it's not a problem for them as they already contain all the needed
>> headers in skb->head, so pskb_may_pull() only moves skb->data.
>>
>> The layout of skbs in the fourth [4] case at the moment of
>> dev_gro_receive() is identical to skbs that have come through [1],
>> as napi_frags_skb() pulls Ethernet header to skb->head. The only
>> difference is that the mentioned condition is always false for them,
>> because skb_put() and friends irreversibly alter the tail pointer.
>> They also go through the 'slow' path, but now every single
>> pskb_may_pull() in every single .gro_receive() will call the *really*
>> slow __pskb_pull_tail() to pull headers to head. This significantly
>> decreases the overall performance for no visible reasons.
> ...
>> Signed-off-by: Alexander Lobakin <alobakin@dlink.ru>
>
> Applied to net-next, thanks.
Thank you!
Regards,
ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ
prev parent reply other threads:[~2019-11-17 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 9:11 [PATCH v2 net-next] net: core: allow fast GRO for skbs with Ethernet header in head Alexander Lobakin
2019-11-16 21:01 ` David Miller
2019-11-17 9:52 ` Alexander Lobakin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5622418d39ce3ebc3d526d3e16c8546b@dlink.ru \
--to=alobakin@dlink.ru \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=edumazet@google.com \
--cc=emmanuel.grumbach@intel.com \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jaswinder.singh@linaro.org \
--cc=jiri@mellanox.com \
--cc=johannes.berg@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwifi@intel.com \
--cc=luciano.coelho@intel.com \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@mellanox.com \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).