[alobakin:xdp_hints 25/52] include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), tx_tstamp)) % sizeof_field(typeof(*md), tx_tstamp) == 0"

From: kernel test robot
Date: Sun Jul 03 2022 - 13:57:29 EST


tree: https://github.com/alobakin/linux xdp_hints
head: e9f4215398901c2e3f477da53abc668ce7b7e320
commit: c57c9963021291f6e2c2ce97af1a7c62ae657fec [25/52] net, xdp: add basic generic metadata accessors
config: arm-h3600_defconfig (https://download.01.org/0day-ci/archive/20220704/202207040107.DocyfiR6-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/alobakin/linux/commit/c57c9963021291f6e2c2ce97af1a7c62ae657fec
git remote add alobakin https://github.com/alobakin/linux
git fetch --no-tags alobakin xdp_hints
git checkout c57c9963021291f6e2c2ce97af1a7c62ae657fec
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from include/linux/workqueue.h:9,
from include/linux/bpf.h:10,
from net/bpf/core.c:6:
include/net/xdp_meta.h: In function 'xdp_meta_tx_tstamp_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), tx_tstamp)) % sizeof_field(typeof(*md), tx_tstamp) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:134:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
134 | XDP_META_BUILD_ACC(tx, tstamp, 64);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_rx_tstamp_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), rx_tstamp)) % sizeof_field(typeof(*md), rx_tstamp) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:177:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
177 | XDP_META_BUILD_ACC(rx, tstamp, 64);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_rx_hash_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), rx_hash)) % sizeof_field(typeof(*md), rx_hash) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:178:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
178 | XDP_META_BUILD_ACC(rx, hash, 32);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_rx_csum_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), rx_csum)) % sizeof_field(typeof(*md), rx_csum) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:179:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
179 | XDP_META_BUILD_ACC(rx, csum, 32);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_rx_flags_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), rx_flags)) % sizeof_field(typeof(*md), rx_flags) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:182:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
182 | XDP_META_BUILD_ACC(rx, flags, 32);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_btf_id_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), btf_id)) % sizeof_field(typeof(*md), btf_id) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:194:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
194 | XDP_META_BUILD_ACC(btf, id, 32);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_type_id_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), type_id)) % sizeof_field(typeof(*md), type_id) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:195:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
195 | XDP_META_BUILD_ACC(type, id, 32);
| ^~~~~~~~~~~~~~~~~~
include/net/xdp_meta.h: In function 'xdp_meta_full_id_set':
>> include/linux/build_bug.h:78:41: error: static assertion failed: "(XDP_PACKET_HEADROOM - sizeof(*md) + sizeof_field(typeof(*md), magic_id) + offsetof(typeof(*md), full_id)) % sizeof_field(typeof(*md), full_id) == 0"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
include/net/xdp_meta.h:95:9: note: in expansion of macro 'static_assert'
95 | static_assert((XDP_PACKET_HEADROOM - sizeof(*md) + \
| ^~~~~~~~~~~~~
include/net/xdp_meta.h:196:1: note: in expansion of macro 'XDP_META_BUILD_ACC'
196 | XDP_META_BUILD_ACC(full, id, 64);
| ^~~~~~~~~~~~~~~~~~


vim +78 include/linux/build_bug.h

bc6245e5efd70c Ian Abbott 2017-07-10 60
6bab69c65013be Rasmus Villemoes 2019-03-07 61 /**
6bab69c65013be Rasmus Villemoes 2019-03-07 62 * static_assert - check integer constant expression at build time
6bab69c65013be Rasmus Villemoes 2019-03-07 63 *
6bab69c65013be Rasmus Villemoes 2019-03-07 64 * static_assert() is a wrapper for the C11 _Static_assert, with a
6bab69c65013be Rasmus Villemoes 2019-03-07 65 * little macro magic to make the message optional (defaulting to the
6bab69c65013be Rasmus Villemoes 2019-03-07 66 * stringification of the tested expression).
6bab69c65013be Rasmus Villemoes 2019-03-07 67 *
6bab69c65013be Rasmus Villemoes 2019-03-07 68 * Contrary to BUILD_BUG_ON(), static_assert() can be used at global
6bab69c65013be Rasmus Villemoes 2019-03-07 69 * scope, but requires the expression to be an integer constant
6bab69c65013be Rasmus Villemoes 2019-03-07 70 * expression (i.e., it is not enough that __builtin_constant_p() is
6bab69c65013be Rasmus Villemoes 2019-03-07 71 * true for expr).
6bab69c65013be Rasmus Villemoes 2019-03-07 72 *
6bab69c65013be Rasmus Villemoes 2019-03-07 73 * Also note that BUILD_BUG_ON() fails the build if the condition is
6bab69c65013be Rasmus Villemoes 2019-03-07 74 * true, while static_assert() fails the build if the expression is
6bab69c65013be Rasmus Villemoes 2019-03-07 75 * false.
6bab69c65013be Rasmus Villemoes 2019-03-07 76 */
6bab69c65013be Rasmus Villemoes 2019-03-07 77 #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
6bab69c65013be Rasmus Villemoes 2019-03-07 @78 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
6bab69c65013be Rasmus Villemoes 2019-03-07 79

:::::: The code at line 78 was first introduced by commit
:::::: 6bab69c65013bed5fce9f101a64a84d0385b3946 build_bug.h: add wrapper for _Static_assert

:::::: TO: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://01.org/lkp