* [PATCH net-next] gso: Support frag_list splitting with head_frag
@ 2017-04-07 23:07 ilant
2017-04-12 17:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: ilant @ 2017-04-07 23:07 UTC (permalink / raw)
To: netdev
Cc: Alexander Duyck, Eric Dumazet, Steffen Klassert, Boris Pismenny,
Ilan Tayari
From: Ilan Tayari <ilant@mellanox.com>
A driver may use build_skb() for received packets.
These SKBs then have a head_frag.
Since commit d7e8883cfcf4 ("net: make GRO aware of
skb->head_frag"), GRO may build frag_list SKBs out of
head_frag received SKBs.
In such a case, the chained SKBs end up with a head_frag.
Commit 07b26c9454a2 ("gso: Support partial splitting at
the frag_list pointer") adds partial segmentation of frag_list
SKB chains into individual SKBs.
However, this is not done if the chained SKBs have any
linear part, because the device may not be able to DMA
the private linear buffer.
A chained frag_list SKB with head_frag is wrongfully
detected in this case as having a private linear part
and thus falls back to software GSO, while in fact the
linear part is backed by a DMA page just like any other frag.
This causes low performance when forwarding those packets
that were built with build_skb()
Allow partial segmentation at the frag_list pointer for
chained SKBs with head_frag.
Note that such SKBs can only be created by GRO, when applied
to received packets with head_frag.
Also note that this change only affects the data path that
performs the partial segmentation at frag_list pointer, and
not any of the other more common data paths.
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
---
net/core/skbuff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 9f781092fda9..5d9a11eafbf5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3093,7 +3093,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
* containing the same amount of data.
*/
skb_walk_frags(head_skb, iter) {
- if (skb_headlen(iter))
+ if (skb_headlen(iter) && !iter->head_frag)
goto normal;
len -= iter->len;
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] gso: Support frag_list splitting with head_frag
2017-04-07 23:07 [PATCH net-next] gso: Support frag_list splitting with head_frag ilant
@ 2017-04-12 17:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-12 17:54 UTC (permalink / raw)
To: ilant; +Cc: netdev, alexander.h.duyck, eric.dumazet, steffen.klassert, borisp
From: <ilant@mellanox.com>
Date: Sat, 8 Apr 2017 02:07:08 +0300
> From: Ilan Tayari <ilant@mellanox.com>
>
> A driver may use build_skb() for received packets.
> These SKBs then have a head_frag.
>
> Since commit d7e8883cfcf4 ("net: make GRO aware of
> skb->head_frag"), GRO may build frag_list SKBs out of
> head_frag received SKBs.
> In such a case, the chained SKBs end up with a head_frag.
>
> Commit 07b26c9454a2 ("gso: Support partial splitting at
> the frag_list pointer") adds partial segmentation of frag_list
> SKB chains into individual SKBs.
> However, this is not done if the chained SKBs have any
> linear part, because the device may not be able to DMA
> the private linear buffer.
>
> A chained frag_list SKB with head_frag is wrongfully
> detected in this case as having a private linear part
> and thus falls back to software GSO, while in fact the
> linear part is backed by a DMA page just like any other frag.
>
> This causes low performance when forwarding those packets
> that were built with build_skb()
>
> Allow partial segmentation at the frag_list pointer for
> chained SKBs with head_frag.
>
> Note that such SKBs can only be created by GRO, when applied
> to received packets with head_frag.
> Also note that this change only affects the data path that
> performs the partial segmentation at frag_list pointer, and
> not any of the other more common data paths.
>
> Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Applied, thank you for the detailed commit message.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-12 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-07 23:07 [PATCH net-next] gso: Support frag_list splitting with head_frag ilant
2017-04-12 17:54 ` David Miller
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).