[dpdk-dev] [PATCH v2] common/mlx5: fix bogus assert
Matan Azrad
matan at mellanox.com
Sun May 17 14:02:59 CEST 2020
From: Viacheslav Ovsiienko
> The MLX5 device supports up to MLX5_MAX_MAC_ADDRESSES (256) MAC
> addresses.
> The code flushes all MAC devices.
>
> If DPDK is compiled with MLX5_DEBUG this would an assert.
> PANIC in mlx5_nl_mac_addr_flush():
> line 775 assert "(size_t)(i) < sizeof(mac_own) * 8" failed
>
> The root cause is that mac_own is a pointer and is being used as a bitmap
> array. The sizeof(mac_own) would therefore be 64 but the number of
> entries to be flushed would be 256.
>
> There is a whole set of asserts in MLX5 netlink code with the same bug; that
> should just be changed into proper error checks.
>
> Fixes: 8e46d4e18f09 ("common/mlx5: improve assert control")
> Cc: akozyrev at mellanox.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
More information about the dev
mailing list