diff mbox series

[net] skbuff: Fix build with SKB extensions disabled

Message ID 20210708041051.17851-1-f.fainelli@gmail.com (mailing list archive)
State Accepted
Commit 9615fe36b31d926f1c5107013b772dc226a6a7ca
Delegated to: Netdev Maintainers
Headers show
Series [net] skbuff: Fix build with SKB extensions disabled | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 5 maintainers not CCed: andriin@fb.com ap420073@gmail.com alobakin@pm.me atenart@kernel.org weiwan@google.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes fail Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/header_inline success Link

Commit Message

Florian Fainelli July 8, 2021, 4:10 a.m. UTC
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(-)

Comments

Roi Dayan July 8, 2021, 6:24 a.m. UTC | #1
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>
Eric Dumazet July 8, 2021, 6:45 a.m. UTC | #2
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>
patchwork-bot+netdevbpf@kernel.org July 8, 2021, 7:20 a.m. UTC | #3
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
diff mbox series

Patch

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;
 	}