mlxsw: spectrum_cnt: Fix 64-bit division in mlxsw_sp_counter_resources_register
Subsystems (3)
PATCH 1/1 mlxsw: spectrum_cnt: Fix 64-bit division in mlxsw_sp_counter_resources_register
When building arm32 allyesconfig:
ld.lld: error: undefined symbol: __aeabi_uldivmod
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
spectrum_cnt.c
net/ethernet/mellanox/mlxsw/spectrum_cnt.o:(mlxsw_sp_counter_resources_register) in archivedrivers/built-in.a
did you mean:__aeabi_uidivmod
defined in: arch/arm/lib/lib.a(lib1funcs.o)
pool_size and bank_size are u64; use div64_u64 so that 32-bit platforms do not error.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c +1 -1
@@ -303,7 +303,7 @@ int mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core) }/* Check config is valid, no bank over subscription */ -if (WARN_ON (total_bank_config > pool_size / bank_size +1 )) +if (WARN_ON (total_bank_config >div64_u64 (pool_size, bank_size) +1 ))return -EINVAL ;return 0 ;
Signature · 1 line
2.26.0.rc1
Quoted 8 lines · Fri, Mar 20, 2020 at 03:16:38AM CET, [email protected] wrote:
When building arm32 allyesconfig:
ld.lld: error: undefined symbol:
__aeabi_uldivmodQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
spectrum_cnt.c
net/ethernet/mellanox/mlxsw/spectrum_cnt.o:(mlxsw_sp_counter_resources_register) in archivedrivers/built-in.a
did you mean:__aeabi_uidivmod
defined in: arch/arm/lib/lib.a(lib1funcs.o)
Quoted 5 lines
pool_sizeandbank_sizeare u64; usediv64_u64so that 32-bit platforms do not error.Fixes ab8c4cc60420 ("mlxsw: spectrum_cnt: Move config validation along with resource register")Signed-off-by Nathan Chancellor <[email protected]>
Thanks!
From: Nathan Chancellor <[email protected]>
Date: Thu, 19 Mar 2020 19:16:38 -0700
Quoted 8 lines
When building arm32 allyesconfig:
ld.lld: error: undefined symbol:
__aeabi_uldivmodQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
referenced by
spectrum_cnt.c
net/ethernet/mellanox/mlxsw/spectrum_cnt.o:(mlxsw_sp_counter_resources_register) in archivedrivers/built-in.a
did you mean:__aeabi_uidivmod
defined in: arch/arm/lib/lib.a(lib1funcs.o)
Quoted 5 lines
pool_sizeandbank_sizeare u64; usediv64_u64so that 32-bit platforms do not error.Fixes ab8c4cc60420 ("mlxsw: spectrum_cnt: Move config validation along with resource register")Signed-off-by Nathan Chancellor <[email protected]>
Applied to net-next.
Please be clear about the intended target GIT tree for your changes in the Subject line in the future, thank you.