Commit a90f88fe authored by Gavi Teitz's avatar Gavi Teitz Committed by Saeed Mahameed

net/mlx5e: Don't refresh TIRs when updating representor SQs

Refreshing TIRs is done in order to update the TIRs with the current
state of SQs in the transport domain, so that the TIRs can filter out
undesired self-loopback packets based on the source SQ of the packet.

Representor TIRs will only receive packets that originate from their
associated vport, due to dedicated steering, and therefore will never
receive self-loopback packets, whose source vport will be the vport of
the E-Switch manager, and therefore not the vport associated with the
representor. As such, it is not necessary to refresh the representors'
TIRs, since self-loopback packets can't reach them.

Since representors only exist in switchdev mode, and there is no
scenario in which a representor will exist in the transport domain
alongside a non-representor, it is not necessary to refresh the
transport domain's TIRs upon changing the state of a representor's
queues. Therefore, do not refresh TIRs upon such a change. Achieve
this by adding an update_rx callback to the mlx5e_profile, which
refreshes TIRs for non-representors and does nothing for representors,
and replace instances of mlx5e_refresh_tirs() upon changing the state
of the queues with update_rx().
Signed-off-by: default avatarGavi Teitz <gavi@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 5233794b
...@@ -763,6 +763,7 @@ struct mlx5e_profile { ...@@ -763,6 +763,7 @@ struct mlx5e_profile {
void (*cleanup_tx)(struct mlx5e_priv *priv); void (*cleanup_tx)(struct mlx5e_priv *priv);
void (*enable)(struct mlx5e_priv *priv); void (*enable)(struct mlx5e_priv *priv);
void (*disable)(struct mlx5e_priv *priv); void (*disable)(struct mlx5e_priv *priv);
int (*update_rx)(struct mlx5e_priv *priv);
void (*update_stats)(struct mlx5e_priv *priv); void (*update_stats)(struct mlx5e_priv *priv);
void (*update_carrier)(struct mlx5e_priv *priv); void (*update_carrier)(struct mlx5e_priv *priv);
struct { struct {
...@@ -1034,6 +1035,7 @@ int mlx5e_create_tis(struct mlx5_core_dev *mdev, int tc, ...@@ -1034,6 +1035,7 @@ int mlx5e_create_tis(struct mlx5_core_dev *mdev, int tc,
void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn); void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn);
int mlx5e_create_tises(struct mlx5e_priv *priv); int mlx5e_create_tises(struct mlx5e_priv *priv);
int mlx5e_update_nic_rx(struct mlx5e_priv *priv);
void mlx5e_update_carrier(struct mlx5e_priv *priv); void mlx5e_update_carrier(struct mlx5e_priv *priv);
int mlx5e_close(struct net_device *netdev); int mlx5e_close(struct net_device *netdev);
int mlx5e_open(struct net_device *netdev); int mlx5e_open(struct net_device *netdev);
......
...@@ -2845,7 +2845,7 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv, ...@@ -2845,7 +2845,7 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
if (hw_modify) if (hw_modify)
hw_modify(priv); hw_modify(priv);
mlx5e_refresh_tirs(priv, false); priv->profile->update_rx(priv);
mlx5e_activate_priv_channels(priv); mlx5e_activate_priv_channels(priv);
/* return carrier back if needed */ /* return carrier back if needed */
...@@ -2892,7 +2892,7 @@ int mlx5e_open_locked(struct net_device *netdev) ...@@ -2892,7 +2892,7 @@ int mlx5e_open_locked(struct net_device *netdev)
if (err) if (err)
goto err_clear_state_opened_flag; goto err_clear_state_opened_flag;
mlx5e_refresh_tirs(priv, false); priv->profile->update_rx(priv);
mlx5e_activate_priv_channels(priv); mlx5e_activate_priv_channels(priv);
if (priv->profile->update_carrier) if (priv->profile->update_carrier)
priv->profile->update_carrier(priv); priv->profile->update_carrier(priv);
...@@ -4928,6 +4928,11 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) ...@@ -4928,6 +4928,11 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
mlx5_lag_remove(mdev); mlx5_lag_remove(mdev);
} }
int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
{
return mlx5e_refresh_tirs(priv, false);
}
static const struct mlx5e_profile mlx5e_nic_profile = { static const struct mlx5e_profile mlx5e_nic_profile = {
.init = mlx5e_nic_init, .init = mlx5e_nic_init,
.cleanup = mlx5e_nic_cleanup, .cleanup = mlx5e_nic_cleanup,
...@@ -4937,6 +4942,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = { ...@@ -4937,6 +4942,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = {
.cleanup_tx = mlx5e_cleanup_nic_tx, .cleanup_tx = mlx5e_cleanup_nic_tx,
.enable = mlx5e_nic_enable, .enable = mlx5e_nic_enable,
.disable = mlx5e_nic_disable, .disable = mlx5e_nic_disable,
.update_rx = mlx5e_update_nic_rx,
.update_stats = mlx5e_update_ndo_stats, .update_stats = mlx5e_update_ndo_stats,
.update_carrier = mlx5e_update_carrier, .update_carrier = mlx5e_update_carrier,
.rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe, .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe,
......
...@@ -1638,6 +1638,11 @@ static void mlx5e_rep_enable(struct mlx5e_priv *priv) ...@@ -1638,6 +1638,11 @@ static void mlx5e_rep_enable(struct mlx5e_priv *priv)
mlx5e_set_netdev_mtu_boundaries(priv); mlx5e_set_netdev_mtu_boundaries(priv);
} }
static int mlx5e_update_rep_rx(struct mlx5e_priv *priv)
{
return 0;
}
static int uplink_rep_async_event(struct notifier_block *nb, unsigned long event, void *data) static int uplink_rep_async_event(struct notifier_block *nb, unsigned long event, void *data)
{ {
struct mlx5e_priv *priv = container_of(nb, struct mlx5e_priv, events_nb); struct mlx5e_priv *priv = container_of(nb, struct mlx5e_priv, events_nb);
...@@ -1713,6 +1718,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = { ...@@ -1713,6 +1718,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
.init_tx = mlx5e_init_rep_tx, .init_tx = mlx5e_init_rep_tx,
.cleanup_tx = mlx5e_cleanup_rep_tx, .cleanup_tx = mlx5e_cleanup_rep_tx,
.enable = mlx5e_rep_enable, .enable = mlx5e_rep_enable,
.update_rx = mlx5e_update_rep_rx,
.update_stats = mlx5e_rep_update_hw_counters, .update_stats = mlx5e_rep_update_hw_counters,
.rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep, .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
.rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq, .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
...@@ -1728,6 +1734,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { ...@@ -1728,6 +1734,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = {
.cleanup_tx = mlx5e_cleanup_rep_tx, .cleanup_tx = mlx5e_cleanup_rep_tx,
.enable = mlx5e_uplink_rep_enable, .enable = mlx5e_uplink_rep_enable,
.disable = mlx5e_uplink_rep_disable, .disable = mlx5e_uplink_rep_disable,
.update_rx = mlx5e_update_rep_rx,
.update_stats = mlx5e_uplink_rep_update_hw_counters, .update_stats = mlx5e_uplink_rep_update_hw_counters,
.update_carrier = mlx5e_update_carrier, .update_carrier = mlx5e_update_carrier,
.rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep, .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
......
...@@ -418,6 +418,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = { ...@@ -418,6 +418,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = {
.cleanup_rx = mlx5i_cleanup_rx, .cleanup_rx = mlx5i_cleanup_rx,
.enable = NULL, /* mlx5i_enable */ .enable = NULL, /* mlx5i_enable */
.disable = NULL, /* mlx5i_disable */ .disable = NULL, /* mlx5i_disable */
.update_rx = mlx5e_update_nic_rx,
.update_stats = NULL, /* mlx5i_update_stats */ .update_stats = NULL, /* mlx5i_update_stats */
.update_carrier = NULL, /* no HW update in IB link */ .update_carrier = NULL, /* no HW update in IB link */
.rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe, .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
...@@ -526,7 +527,7 @@ static int mlx5i_open(struct net_device *netdev) ...@@ -526,7 +527,7 @@ static int mlx5i_open(struct net_device *netdev)
if (err) if (err)
goto err_remove_fs_underlay_qp; goto err_remove_fs_underlay_qp;
mlx5e_refresh_tirs(epriv, false); epriv->profile->update_rx(epriv);
mlx5e_activate_priv_channels(epriv); mlx5e_activate_priv_channels(epriv);
mutex_unlock(&epriv->state_lock); mutex_unlock(&epriv->state_lock);
......
...@@ -221,7 +221,7 @@ static int mlx5i_pkey_open(struct net_device *netdev) ...@@ -221,7 +221,7 @@ static int mlx5i_pkey_open(struct net_device *netdev)
mlx5_core_warn(mdev, "opening child channels failed, %d\n", err); mlx5_core_warn(mdev, "opening child channels failed, %d\n", err);
goto err_clear_state_opened_flag; goto err_clear_state_opened_flag;
} }
mlx5e_refresh_tirs(epriv, false); epriv->profile->update_rx(epriv);
mlx5e_activate_priv_channels(epriv); mlx5e_activate_priv_channels(epriv);
mutex_unlock(&epriv->state_lock); mutex_unlock(&epriv->state_lock);
...@@ -350,6 +350,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = { ...@@ -350,6 +350,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = {
.cleanup_rx = mlx5i_pkey_cleanup_rx, .cleanup_rx = mlx5i_pkey_cleanup_rx,
.enable = NULL, .enable = NULL,
.disable = NULL, .disable = NULL,
.update_rx = mlx5e_update_nic_rx,
.update_stats = NULL, .update_stats = NULL,
.rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe, .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
.rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */ .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment