Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: fix GRO skb truesize update
@ 2021-08-04 19:07 Paolo Abeni
  2021-08-04 19:29 ` Mat Martineau
  2021-08-05 10:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Abeni @ 2021-08-04 19:07 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Jakub Kicinski, Mat Martineau

commit 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock
reference") introduces a serious regression at the GRO layer setting
the wrong truesize for stolen-head skbs.

Restore the correct truesize: SKB_DATA_ALIGN(...) instead of
SKB_TRUESIZE(...)

Reported-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Fixes: 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock reference")
Signed-off-by: Paolo Abeni <pabeni@redhat.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 97ed77a86bb0..02a603556408 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4375,7 +4375,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
 		memcpy(frag + 1, skbinfo->frags, sizeof(*frag) * skbinfo->nr_frags);
 		/* We dont need to clear skbinfo->nr_frags here */
 
-		new_truesize = SKB_TRUESIZE(sizeof(struct sk_buff));
+		new_truesize = SKB_DATA_ALIGN(sizeof(struct sk_buff));
 		delta_truesize = skb->truesize - new_truesize;
 		skb->truesize = new_truesize;
 		NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD;
-- 
2.26.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: fix GRO skb truesize update
  2021-08-04 19:07 [PATCH net-next] net: fix GRO skb truesize update Paolo Abeni
@ 2021-08-04 19:29 ` Mat Martineau
  2021-08-05 10:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Mat Martineau @ 2021-08-04 19:29 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: netdev, David S. Miller, Jakub Kicinski

On Wed, 4 Aug 2021, Paolo Abeni wrote:

> commit 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock
> reference") introduces a serious regression at the GRO layer setting
> the wrong truesize for stolen-head skbs.
>
> Restore the correct truesize: SKB_DATA_ALIGN(...) instead of
> SKB_TRUESIZE(...)
>
> Reported-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> Fixes: 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock reference")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>

With this patch I'm no longer seeing the WARN_ON_ONCE() fire in 
skb_try_coalesce(). Thanks Paolo!

Tested-by: Mat Martineau <mathew.j.martineau@linux.intel.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 97ed77a86bb0..02a603556408 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -4375,7 +4375,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
> 		memcpy(frag + 1, skbinfo->frags, sizeof(*frag) * skbinfo->nr_frags);
> 		/* We dont need to clear skbinfo->nr_frags here */
>
> -		new_truesize = SKB_TRUESIZE(sizeof(struct sk_buff));
> +		new_truesize = SKB_DATA_ALIGN(sizeof(struct sk_buff));
> 		delta_truesize = skb->truesize - new_truesize;
> 		skb->truesize = new_truesize;
> 		NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD;
> --

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: fix GRO skb truesize update
  2021-08-04 19:07 [PATCH net-next] net: fix GRO skb truesize update Paolo Abeni
  2021-08-04 19:29 ` Mat Martineau
@ 2021-08-05 10:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-05 10:40 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: netdev, davem, kuba, mathew.j.martineau

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed,  4 Aug 2021 21:07:00 +0200 you wrote:
> commit 5e10da5385d2 ("skbuff: allow 'slow_gro' for skb carring sock
> reference") introduces a serious regression at the GRO layer setting
> the wrong truesize for stolen-head skbs.
> 
> Restore the correct truesize: SKB_DATA_ALIGN(...) instead of
> SKB_TRUESIZE(...)
> 
> [...]

Here is the summary with links:
  - [net-next] net: fix GRO skb truesize update
    https://git.kernel.org/netdev/net-next/c/af352460b465

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-05 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 19:07 [PATCH net-next] net: fix GRO skb truesize update Paolo Abeni
2021-08-04 19:29 ` Mat Martineau
2021-08-05 10:40 ` patchwork-bot+netdevbpf

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).