Skip to content

Commit 8635062

Browse files
dickmanmaorjfvogel
authored andcommitted
net/mlx5: E-Switch, change VFs default admin state to auto in switchdev
This change change VFs default admin state to auto in switchdev causing the VF link to follow the uplink link instead of the VF representor. Signed-off-by: Maor Dickman <[email protected]> Orabug: 34477072 This is an out of tree patch to fix VF link propagation problem reported on UEK7. There is a requirement to propagate link up/down events to all the VFs of a given PF. The driver feature has been removed by vendor as regular driver update process. Thus, to fulfil the requirement, a change has been proposed by nic vendor where the representor link state is set to Up without confirming with the device firmware. The change set the vport link-state to auto. This change is been maintained as an out of tree patch. Tested-by: Gerald Gibson <[email protected]> Reviewed-by: Qing Huang <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> (cherry picked from commit a272d4ffdc6e68fd6726b71b849eae2f2af012a7) Signed-off-by: Jack Vogel <[email protected]>
1 parent ce77b75 commit 8635062

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -431,20 +431,14 @@ void mlx5e_remove_sqs_fwd_rules(struct mlx5e_priv *priv)
431431
static int mlx5e_rep_open(struct net_device *dev)
432432
{
433433
struct mlx5e_priv *priv = netdev_priv(dev);
434-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
435-
struct mlx5_eswitch_rep *rep = rpriv->rep;
436434
int err;
437435

438436
mutex_lock(&priv->state_lock);
439437
err = mlx5e_open_locked(dev);
440438
if (err)
441439
goto unlock;
442440

443-
if (!mlx5_modify_vport_admin_state(priv->mdev,
444-
MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
445-
rep->vport, 1,
446-
MLX5_VPORT_ADMIN_STATE_UP))
447-
netif_carrier_on(dev);
441+
netif_carrier_on(dev);
448442

449443
unlock:
450444
mutex_unlock(&priv->state_lock);
@@ -454,15 +448,9 @@ static int mlx5e_rep_open(struct net_device *dev)
454448
static int mlx5e_rep_close(struct net_device *dev)
455449
{
456450
struct mlx5e_priv *priv = netdev_priv(dev);
457-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
458-
struct mlx5_eswitch_rep *rep = rpriv->rep;
459451
int ret;
460452

461453
mutex_lock(&priv->state_lock);
462-
mlx5_modify_vport_admin_state(priv->mdev,
463-
MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
464-
rep->vport, 1,
465-
MLX5_VPORT_ADMIN_STATE_DOWN);
466454
ret = mlx5e_close_locked(dev);
467455
mutex_unlock(&priv->state_lock);
468456
return ret;

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,9 +3170,8 @@ int esw_offloads_enable(struct mlx5_eswitch *esw)
31703170
if (err)
31713171
goto err_steering_init;
31723172

3173-
/* Representor will control the vport link state */
31743173
mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs)
3175-
vport->info.link_state = MLX5_VPORT_ADMIN_STATE_DOWN;
3174+
vport->info.link_state = MLX5_VPORT_ADMIN_STATE_AUTO;
31763175

31773176
/* Uplink vport rep must load first. */
31783177
err = esw_offloads_load_rep(esw, MLX5_VPORT_UPLINK);

0 commit comments

Comments
 (0)