Skip to content

Commit

Permalink
net/mlx5: E-Switch, Fix vport enable flow
Browse files Browse the repository at this point in the history
Reorder vport enable flow to mark the vport as enabled before calling
the vport change handler which was modified to handle the case for
when vport is not enabled.

This fixes the case for when the PF netdev is open before sriov is
enabled, once sriov is enabled at esw_enable_vport,
esw_vport_change_handle_locked didn't read the PF context since it
thought the PF vport was not enabled.

When we enable the vport, arming for events is not required anymore,
since it's done on the vport change handle

Fixes: 586cfa7 ('net/mlx5: E-Switch, Use vport event handler for vport cleanup')
Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mohamad Haj Yahia authored and David S. Miller committed Jun 10, 2016
1 parent 3f42ac6 commit 25fff58
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,14 +1491,11 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,

/* Sync with current vport context */
vport->enabled_events = enable_events;
esw_vport_change_handle_locked(vport);

vport->enabled = true;

/* only PF is trusted by default */
vport->trusted = (vport_num) ? false : true;

arm_vport_context_events_cmd(esw->dev, vport_num, enable_events);
esw_vport_change_handle_locked(vport);

esw->enabled_vports++;
esw_debug(esw->dev, "Enabled VPORT(%d)\n", vport_num);
Expand Down

0 comments on commit 25fff58

Please sign in to comment.