[PATCH v7 2/5] net/mlx5: remove redundant MAC address index checks
Raslan Darawsheh
rasland at nvidia.com
Mon Sep 21 10:31:23 CEST 2026
Hi David,
🤖 This review was drafted with assistance from Claude (Anthropic) and reviewed by me before posting.
In mlx5_os_mac_addr_remove() (drivers/net/mlx5/linux/mlx5_os.c), this
patch drops both the netlink `index` arg and the Linux bounds guard:
- if (index < MLX5_MAX_MAC_ADDRESSES)
- BITFIELD_RESET(priv->mac_own, index);
+ BITFIELD_RESET(priv->mac_own, index);
but the Windows counterpart (windows/mlx5_os.c) still has an equivalent
check, so the two backends diverge in defensiveness after this patch.
The check is indeed redundant given mlx5_mac.c's index validation before
calling into the OS helper -- but for consistency the Windows-side check
should be dropped too, rather than left as the odd one out. Could you
remove it there as well in the next version?
--
Raslan Darawsheh
More information about the dev
mailing list