diff options
| author | Thomas Weißschuh <[email protected]> | 2023-08-23 09:28:38 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2023-08-24 18:24:30 +0000 |
| commit | 5d21d0a65b573507bae774708199328b38dedfe6 (patch) | |
| tree | 68a78d5da1852eac198cb8092876082256893497 /drivers/net/ethernet/intel/igc/igc_main.c | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff) | |
| download | kernel-5d21d0a65b573507bae774708199328b38dedfe6.tar.gz kernel-5d21d0a65b573507bae774708199328b38dedfe6.zip | |
net: generalize calculation of skb extensions length
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 <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions
