Skip to contentSkip to conversation

skbuff: Fix build with SKB extensions disabled

PATCH Applied Florian Fainelli 4 participants 4 messages Jul 8, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skbuff: Fix build with SKB extensions disabled

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")
---
 net/core/dev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/dev.c +2 -1
index 177a5aec0b6b..03c95a0867bb 100644
@@ -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;
 	}
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Florian Fainelli

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")
---
  net/core/dev.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
net/core/dev.c +1 -1
index 177a5aec0b6b..03c95a0867bb 100644
@@ -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);

net/core/dev.c static void gro_list_prepare(const struct list_head *head, · line 6025

Quoted 7 lines
net/core/dev.c +1 -0
@@ -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 on v1 1/1
#2 lore raw
In reply to Florian Fainelli
Quoted 11 lines · Florian Fainelli

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

---

Thanks, I also hit the same bug.

#3 lore raw
In reply to Florian Fainelli
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

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

Quoted 8 lines · 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