Skip to content
  • Bodong Wang's avatar
    net/mlx5: E-Switch, Fix the check of legal vport · 5d9986a3
    Bodong Wang authored
    The check of legal vport is to ensure the vport number falls between
    0 and total number of vports. Along with the introduction of uplink
    rep, enabled vports are not consecutive any more.
    Therefore, rely on the eswitch vport getter function to check if it's
    a valid vport.
    
    As the getter function relies on eswitch, add the check of vport
    group manager and validation the presence of eswitch structure.
    Remove the redundant check in the function calls.
    
    Since the vport array will be allocated once eswitch is initialized
    and will be kept alive if eswitch presents, no need to protect it with
    the state lock.
    
    Fixes: 5ae51620
    
     ("net/mlx5: E-Switch, Assign a different position for uplink rep and vport")
    Signed-off-by: default avatarBodong Wang <bodong@mellanox.com>
    Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    5d9986a3