Re: [PATCH 1/1] net: fix skb_ext_total_length() BUILD_BUG_ON with CONFIG_GCOV_PROFILE_ALL

From: Thomas Weißschuh

Date: Tue Mar 31 2026 - 03:10:25 EST


On 2026-03-30 19:23:01+0200, Konstantin Khorenko wrote:

(...)

> Thus we can probably use this hack and create the following patch instead:
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 0e217041958a..47c7f0ab6e84 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -5145,7 +5145,7 @@ static const u8 skb_ext_type_len[] = {
> #endif
> };
>
> -static __always_inline unsigned int skb_ext_total_length(void)
> +static __always_inline __no_profile unsigned int skb_ext_total_length(void)
> {
> unsigned int l = SKB_EXT_CHUNKSIZEOF(struct skb_ext);
> int i;
> @@ -5159,9 +5159,7 @@ static __always_inline unsigned int skb_ext_total_length(void)
> static void skb_extensions_init(void)
> {
> BUILD_BUG_ON(SKB_EXT_NUM > 8);
> -#if !IS_ENABLED(CONFIG_KCOV_INSTRUMENT_ALL)
> BUILD_BUG_ON(skb_ext_total_length() > 255);
> -#endif
>
> skbuff_ext_cache = kmem_cache_create("skbuff_ext_cache",
> SKB_EXT_ALIGN_VALUE * skb_ext_total_length(),
>
>
> Tomas, do you want me to send the v2 patch with that solution?

Yeah, I think this should have been the correct solution from beginning.
If you send this patch feel free to add my Reviewed-by.


Thomas