net/mlx5e: Unblock setting vid 0 for VF in case PF isn't eswitch manager
authorMaor Dickman <maord@nvidia.com>
Thu, 9 Dec 2021 12:03:01 +0000 (14:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:55 +0000 (11:04 +0100)
commit4e2e5a033e93ec8805f2584e900a6bea4016ef5b
treecee21ba9850e333bb431eabe9f4de1e0207abe6f
parentd24e3a126b2ea91e69f34c9487c6cddde84fa5b9
net/mlx5e: Unblock setting vid 0 for VF in case PF isn't eswitch manager

[ Upstream commit 7846665d3504812acaebf920d1141851379a7f37 ]

When using libvirt to passthrough VF to VM it will always set the VF vlan
to 0 even if user didn’t request it, this will cause libvirt to fail to
boot in case the PF isn't eswitch owner.

Example of such case is the DPU host PF which isn't eswitch manager, so
any attempt to passthrough VF of it using libvirt will fail.

Fix it by not returning error in case set VF vlan is called with vid 0.

Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c