You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mlxsw: spectrum_acl_bloom_filter: Workaround for some LLVM versions
JIRA: https://issues.redhat.com/browse/RHEL-94569
commit 4af9939
Author: WangYuli <[email protected]>
Date: Tue Mar 18 18:36:54 2025 +0800
mlxsw: spectrum_acl_bloom_filter: Workaround for some LLVM versions
This is a workaround to mitigate a compiler anomaly.
During LLVM toolchain compilation of this driver on s390x architecture, an
unreasonable __write_overflow_field warning occurs.
Contextually, chunk_index is restricted to 0, 1 or 2. By expanding these
possibilities, the compile warning is suppressed.
Fix follow error with clang-19 when -Werror:
In file included from drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c:5:
In file included from ./include/linux/gfp.h:7:
In file included from ./include/linux/mmzone.h:8:
In file included from ./include/linux/spinlock.h:63:
In file included from ./include/linux/lockdep.h:14:
In file included from ./include/linux/smp.h:13:
In file included from ./include/linux/cpumask.h:12:
In file included from ./include/linux/bitmap.h:13:
In file included from ./include/linux/string.h:392:
./include/linux/fortify-string.h:571:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
571 | __write_overflow_field(p_size_field, size);
| ^
1 error generated.
According to the testing, we can be fairly certain that this is a clang
compiler bug, impacting only clang-19 and below. Clang versions 20 and
21 do not exhibit this behavior.
Link: https://lore.kernel.org/all/[email protected]/
Fixes: 7585cac ("mlxsw: spectrum_acl: Add Bloom filter handling")
Co-developed-by: Zijian Chen <[email protected]>
Signed-off-by: Zijian Chen <[email protected]>
Co-developed-by: Wentao Guan <[email protected]>
Signed-off-by: Wentao Guan <[email protected]>
Suggested-by: Paolo Abeni <[email protected]>
Co-developed-by: Ido Schimmel <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Tested-by: Ido Schimmel <[email protected]>
Tested-by: WangYuli <[email protected]>
Signed-off-by: WangYuli <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Ivan Vecera <[email protected]>
0 commit comments