]> www.infradead.org Git - users/willy/pagecache.git/commit
net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
authorCarolina Jubran <cjubran@nvidia.com>
Mon, 10 Mar 2025 22:01:44 +0000 (00:01 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 13 Mar 2025 12:11:15 +0000 (13:11 +0100)
commite92df790d07a8eea873efcb84776e7b71f81c7d5
tree7e97723f3d5e4fd68f23121fdbf8f6fe5ef0a9b9
parent4b8eeed4fb105770ce6dc84a2c6ef953c7b71cbb
net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices

mlx5_eswitch_get_vepa returns -EPERM if the device lacks
eswitch_manager capability, blocking mlx5e_bridge_getlink from
retrieving VEPA mode. Since mlx5e_bridge_getlink implements
ndo_bridge_getlink, returning -EPERM causes bridge link show to fail
instead of skipping devices without this capability.

To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when
mlx5_eswitch_get_vepa fails, ensuring the command continues processing
other devices while ignoring those without the necessary capability.

Fixes: 4b89251de024 ("net/mlx5: Support ndo bridge_setlink and getlink")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/1741644104-97767-7-git-send-email-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c