APPLIED: [Focal][SRU][PATCH 1/1] net/mlx5e: Unblock setting vid 0 for VF in case PF isn't eswitch manager
Stefan Bader
stefan.bader at canonical.com
Wed Jan 26 16:46:50 UTC 2022
On 25.01.22 09:54, Po-Hsu Lin wrote:
> From: Maor Dickman <maord at nvidia.com>
>
> BugLink: https://bugs.launchpad.net/bugs/1957753
>
> 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 at nvidia.com>
> Reviewed-by: Roi Dayan <roid at nvidia.com>
> Signed-off-by: Saeed Mahameed <saeedm at nvidia.com>
> (backported from commit 7846665d3504812acaebf920d1141851379a7f37)
> [PHLin: apply change in eswitch.c accordingly before the split b55b3538]
> Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
> ---
Applied to focal:linux/master-next. Thanks.
-Stefan
> drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> index ce31474..9d37617 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> @@ -2071,7 +2071,7 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
> int err;
>
> if (!ESW_ALLOWED(esw))
> - return -EPERM;
> + return vlan ? -EPERM : 0;
>
> if (vlan || qos)
> set_flags = SET_VLAN_STRIP | SET_VLAN_INSERT;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20220126/4719a115/attachment.sig>
More information about the kernel-team
mailing list