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: akozy...@mellanox.com
> Cc: sta...@dpdk.org
>
> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
> Signed-off-by: Viacheslav Ovsiienko <viachesl...@mellanox.com>
Acked-by: Matan Azrad <ma...@mellanox.com>