Skip to content

Commit cb28a49

Browse files
dickmanmaorBrian Maly
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: 34477073 This is an out of tree patch to fix VF link propagation problem reported on UEK6u3. 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]> Signed-off-by: Brian Maly <[email protected]>
1 parent 9e9236d commit cb28a49

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
@@ -396,20 +396,14 @@ void mlx5e_remove_sqs_fwd_rules(struct mlx5e_priv *priv)
396396
static int mlx5e_rep_open(struct net_device *dev)
397397
{
398398
struct mlx5e_priv *priv = netdev_priv(dev);
399-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
400-
struct mlx5_eswitch_rep *rep = rpriv->rep;
401399
int err;
402400

403401
mutex_lock(&priv->state_lock);
404402
err = mlx5e_open_locked(dev);
405403
if (err)
406404
goto unlock;
407405

408-
if (!mlx5_modify_vport_admin_state(priv->mdev,
409-
MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
410-
rep->vport, 1,
411-
MLX5_VPORT_ADMIN_STATE_UP))
412-
netif_carrier_on(dev);
406+
netif_carrier_on(dev);
413407

414408
unlock:
415409
mutex_unlock(&priv->state_lock);
@@ -419,15 +413,9 @@ static int mlx5e_rep_open(struct net_device *dev)
419413
static int mlx5e_rep_close(struct net_device *dev)
420414
{
421415
struct mlx5e_priv *priv = netdev_priv(dev);
422-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
423-
struct mlx5_eswitch_rep *rep = rpriv->rep;
424416
int ret;
425417

426418
mutex_lock(&priv->state_lock);
427-
mlx5_modify_vport_admin_state(priv->mdev,
428-
MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
429-
rep->vport, 1,
430-
MLX5_VPORT_ADMIN_STATE_DOWN);
431419
ret = mlx5e_close_locked(dev);
432420
mutex_unlock(&priv->state_lock);
433421
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
@@ -2347,9 +2347,8 @@ int esw_offloads_enable(struct mlx5_eswitch *esw)
23472347
if (err)
23482348
goto err_steering_init;
23492349

2350-
/* Representor will control the vport link state */
23512350
mlx5_esw_for_each_vf_vport(esw, i, vport, esw->esw_funcs.num_vfs)
2352-
vport->info.link_state = MLX5_VPORT_ADMIN_STATE_DOWN;
2351+
vport->info.link_state = MLX5_VPORT_ADMIN_STATE_AUTO;
23532352

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

0 commit comments

Comments
 (0)