lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0726/1039] net/mlx5e: Unblock setting vid 0 for VF in case PF isnt eswitch manager
    Date
    From: Maor Dickman <maord@nvidia.com>

    [ 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 | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
    index df277a6cddc0b..0c4c743ca31e1 100644
    --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
    +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
    @@ -431,7 +431,7 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
    int err = 0;

    if (!mlx5_esw_allowed(esw))
    - return -EPERM;
    + return vlan ? -EPERM : 0;

    if (vlan || qos)
    set_flags = SET_VLAN_STRIP | SET_VLAN_INSERT;
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-24 23:41    [W:2.378 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site