Skip to content

Commit

Permalink
skbuff: Fix build with SKB extensions disabled
Browse files Browse the repository at this point in the history
commit 9615fe3 upstream.

We will fail to build with CONFIG_SKB_EXTENSIONS disabled after
8550ff8 ("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: 8550ff8 ("skbuff: Release nfct refcount on napi stolen or re-used skbs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ffainelli authored and gregkh committed Jul 28, 2021
1 parent ba28765 commit c9f8e17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/dev.c
Expand Up @@ -5872,7 +5872,7 @@ static struct list_head *gro_list_prepare(struct napi_struct *napi,
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);
Expand All @@ -5881,6 +5881,7 @@ static struct list_head *gro_list_prepare(struct napi_struct *napi,
if (!diffs && unlikely(skb_ext))
diffs |= p_ext->chain ^ skb_ext->chain;
}
#endif

NAPI_GRO_CB(p)->same_flow = !diffs;
}
Expand Down

0 comments on commit c9f8e17

Please sign in to comment.