All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] skbuff: Fix build with SKB extensions disabled
@ 2021-07-08  4:10 Florian Fainelli
  2021-07-08  6:24 ` Roi Dayan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-07-08  4:10 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Paul Blakey, Eric Dumazet, David S. Miller,
	Jakub Kicinski, mika penttila, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Saeed Mahameed, Oz Shlomo,
	Roi Dayan, Vlad Buslov

We will fail to build with CONFIG_SKB_EXTENSIONS disabled after
8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used
skbs") since there is an unconditionally use of skb_ext_find() without
an appropriate stub. Simply build the code conditionally and properly
guard against both COFNIG_SKB_EXTENSIONS as well as
CONFIG_NET_TC_SKB_EXT being disabled.

Fixes: Fixes: 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used skbs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/core/dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 177a5aec0b6b..03c95a0867bb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6010,7 +6010,7 @@ static void gro_list_prepare(const struct list_head *head,
 				       maclen);
 
 		diffs |= skb_get_nfct(p) ^ skb_get_nfct(skb);
-
+#if IS_ENABLED(CONFIG_SKB_EXTENSIONS) && IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
 		if (!diffs) {
 			struct tc_skb_ext *skb_ext = skb_ext_find(skb, TC_SKB_EXT);
 			struct tc_skb_ext *p_ext = skb_ext_find(p, TC_SKB_EXT);
@@ -6019,6 +6019,7 @@ static void gro_list_prepare(const struct list_head *head,
 			if (!diffs && unlikely(skb_ext))
 				diffs |= p_ext->chain ^ skb_ext->chain;
 		}
+#endif
 
 		NAPI_GRO_CB(p)->same_flow = !diffs;
 	}
-- 
2.25.1


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

* Re: [PATCH net] skbuff: Fix build with SKB extensions disabled
  2021-07-08  4:10 [PATCH net] skbuff: Fix build with SKB extensions disabled Florian Fainelli
@ 2021-07-08  6:24 ` Roi Dayan
  2021-07-08  6:45 ` Eric Dumazet
  2021-07-08  7:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Roi Dayan @ 2021-07-08  6:24 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: Paul Blakey, Eric Dumazet, David S. Miller, Jakub Kicinski,
	mika penttila, Alexei Starovoitov, Daniel Borkmann,
	John Fastabend, Saeed Mahameed, Oz Shlomo, Vlad Buslov



On 2021-07-08 7:10 AM, Florian Fainelli wrote:
> We will fail to build with CONFIG_SKB_EXTENSIONS disabled after
> 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used
> skbs") since there is an unconditionally use of skb_ext_find() without
> an appropriate stub. Simply build the code conditionally and properly
> guard against both COFNIG_SKB_EXTENSIONS as well as
> CONFIG_NET_TC_SKB_EXT being disabled.
> 
> Fixes: Fixes: 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used skbs")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   net/core/dev.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 177a5aec0b6b..03c95a0867bb 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6010,7 +6010,7 @@ static void gro_list_prepare(const struct list_head *head,
>   				       maclen);
>   
>   		diffs |= skb_get_nfct(p) ^ skb_get_nfct(skb);
> -
> +#if IS_ENABLED(CONFIG_SKB_EXTENSIONS) && IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
>   		if (!diffs) {
>   			struct tc_skb_ext *skb_ext = skb_ext_find(skb, TC_SKB_EXT);
>   			struct tc_skb_ext *p_ext = skb_ext_find(p, TC_SKB_EXT);
> @@ -6019,6 +6019,7 @@ static void gro_list_prepare(const struct list_head *head,
>   			if (!diffs && unlikely(skb_ext))
>   				diffs |= p_ext->chain ^ skb_ext->chain;
>   		}
> +#endif
>   
>   		NAPI_GRO_CB(p)->same_flow = !diffs;
>   	}
> 

thanks. sorry for missing this.
tested compilation before and after the patch with combination
of the mentioned options to be sure.

Reviewed-by: Roi Dayan <roid@nvidia.com>

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

* Re: [PATCH net] skbuff: Fix build with SKB extensions disabled
  2021-07-08  4:10 [PATCH net] skbuff: Fix build with SKB extensions disabled Florian Fainelli
  2021-07-08  6:24 ` Roi Dayan
@ 2021-07-08  6:45 ` Eric Dumazet
  2021-07-08  7:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2021-07-08  6:45 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: Paul Blakey, Eric Dumazet, David S. Miller, Jakub Kicinski,
	mika penttila, Alexei Starovoitov, Daniel Borkmann,
	John Fastabend, Saeed Mahameed, Oz Shlomo, Roi Dayan,
	Vlad Buslov



On 7/8/21 6:10 AM, Florian Fainelli wrote:
> We will fail to build with CONFIG_SKB_EXTENSIONS disabled after
> 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used
> skbs") since there is an unconditionally use of skb_ext_find() without
> an appropriate stub. Simply build the code conditionally and properly
> guard against both COFNIG_SKB_EXTENSIONS as well as
> CONFIG_NET_TC_SKB_EXT being disabled.
> 
> Fixes: Fixes: 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used skbs")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>

Thanks, I also hit the same bug.

Reviewed-by: Eric Dumazet <edumazet@google.com>


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

* Re: [PATCH net] skbuff: Fix build with SKB extensions disabled
  2021-07-08  4:10 [PATCH net] skbuff: Fix build with SKB extensions disabled Florian Fainelli
  2021-07-08  6:24 ` Roi Dayan
  2021-07-08  6:45 ` Eric Dumazet
@ 2021-07-08  7:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-08  7:20 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, paulb, eric.dumazet, davem, kuba, mika.penttila, ast,
	daniel, john.fastabend, saeedm, ozsh, roid, vladbu

Hello:

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

On Wed,  7 Jul 2021 21:10:51 -0700 you wrote:
> We will fail to build with CONFIG_SKB_EXTENSIONS disabled after
> 8550ff8d8c75 ("skbuff: Release nfct refcount on napi stolen or re-used
> skbs") since there is an unconditionally use of skb_ext_find() without
> an appropriate stub. Simply build the code conditionally and properly
> guard against both COFNIG_SKB_EXTENSIONS as well as
> CONFIG_NET_TC_SKB_EXT being disabled.
> 
> [...]

Here is the summary with links:
  - [net] skbuff: Fix build with SKB extensions disabled
    https://git.kernel.org/netdev/net/c/9615fe36b31d

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] 4+ messages in thread

end of thread, other threads:[~2021-07-08  7:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  4:10 [PATCH net] skbuff: Fix build with SKB extensions disabled Florian Fainelli
2021-07-08  6:24 ` Roi Dayan
2021-07-08  6:45 ` Eric Dumazet
2021-07-08  7:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.