[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230824090819.GG3523530@kernel.org>
Date: Thu, 24 Aug 2023 11:08:19 +0200
From: Simon Horman <horms@...nel.org>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Robert Marko <robimarko@...il.com>
Subject: Re: [PATCH net-next v2] net: generalize calculation of skb
extensions length
On Wed, Aug 23, 2023 at 11:28:38AM +0200, Thomas Weißschuh wrote:
> Remove the necessity to modify skb_ext_total_length() when new extension
> types are added.
> Also reduces the line count a bit.
>
> With optimizations enabled the function is folded down to the same
> constant value as before during compilation.
> This has been validated on x86 with GCC 6.5.0 and 13.2.1.
> Also a similar construct has been validated on godbolt.org with GCC 5.1.
> In any case the compiler has to be able to evaluate the construct at
> compile-time for the BUILD_BUG_ON() in skb_extensions_init().
>
> Even if not evaluated at compile-time this function would only ever
> be executed once at run-time, so the overhead would be very minuscule.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists