net/mlx5e: Fix inner tirs handling
In the cited commit inner_tirs argument was added to create and destroy
inner tirs, and no indication was added to mlx5e_modify_tirs_hash()
function. In order to have a consistent handling, use
inner_indir_tir[0].tirn in tirs destroy/modify function as an indication
to whether inner tirs are created.
Inner tirs are not created for representors and before this commit,
a call to mlx5e_modify_tirs_hash() was sending HW commands to
modify non-existent inner tirs.
Fixes: 46dc933cee
("net/mlx5e: Provide explicit directive if to create inner indirect tirs")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
16736e11f4
commit
a16b8e0dcf
|
@ -1121,7 +1121,7 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
|
|||
int mlx5e_create_indirect_rqt(struct mlx5e_priv *priv);
|
||||
|
||||
int mlx5e_create_indirect_tirs(struct mlx5e_priv *priv, bool inner_ttc);
|
||||
void mlx5e_destroy_indirect_tirs(struct mlx5e_priv *priv, bool inner_ttc);
|
||||
void mlx5e_destroy_indirect_tirs(struct mlx5e_priv *priv);
|
||||
|
||||
int mlx5e_create_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs);
|
||||
void mlx5e_destroy_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs);
|
||||
|
|
|
@ -2717,7 +2717,8 @@ void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
|
|||
mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
|
||||
}
|
||||
|
||||
if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
|
||||
/* Verify inner tirs resources allocated */
|
||||
if (!priv->inner_indir_tir[0].tirn)
|
||||
return;
|
||||
|
||||
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
|
||||
|
@ -3408,14 +3409,15 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
void mlx5e_destroy_indirect_tirs(struct mlx5e_priv *priv, bool inner_ttc)
|
||||
void mlx5e_destroy_indirect_tirs(struct mlx5e_priv *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MLX5E_NUM_INDIR_TIRS; i++)
|
||||
mlx5e_destroy_tir(priv->mdev, &priv->indir_tir[i]);
|
||||
|
||||
if (!inner_ttc || !mlx5e_tunnel_inner_ft_supported(priv->mdev))
|
||||
/* Verify inner tirs resources allocated */
|
||||
if (!priv->inner_indir_tir[0].tirn)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MLX5E_NUM_INDIR_TIRS; i++)
|
||||
|
@ -5123,7 +5125,7 @@ err_destroy_xsk_rqts:
|
|||
err_destroy_direct_tirs:
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
err_destroy_indirect_tirs:
|
||||
mlx5e_destroy_indirect_tirs(priv, true);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
err_destroy_direct_rqts:
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
err_destroy_indirect_rqts:
|
||||
|
@ -5142,7 +5144,7 @@ static void mlx5e_cleanup_nic_rx(struct mlx5e_priv *priv)
|
|||
mlx5e_destroy_direct_tirs(priv, priv->xsk_tir);
|
||||
mlx5e_destroy_direct_rqts(priv, priv->xsk_tir);
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
mlx5e_destroy_indirect_tirs(priv, true);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
mlx5e_destroy_rqt(priv, &priv->indir_rqt);
|
||||
mlx5e_close_drop_rq(&priv->drop_rq);
|
||||
|
|
|
@ -1743,7 +1743,7 @@ err_destroy_ttc_table:
|
|||
err_destroy_direct_tirs:
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
err_destroy_indirect_tirs:
|
||||
mlx5e_destroy_indirect_tirs(priv, false);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
err_destroy_direct_rqts:
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
err_destroy_indirect_rqts:
|
||||
|
@ -1761,7 +1761,7 @@ static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
|
|||
mlx5e_destroy_rep_root_ft(priv);
|
||||
mlx5e_destroy_ttc_table(priv, &priv->fs.ttc);
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
mlx5e_destroy_indirect_tirs(priv, false);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
mlx5e_destroy_rqt(priv, &priv->indir_rqt);
|
||||
mlx5e_close_drop_rq(&priv->drop_rq);
|
||||
|
|
|
@ -396,7 +396,7 @@ static int mlx5i_init_rx(struct mlx5e_priv *priv)
|
|||
err_destroy_direct_tirs:
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
err_destroy_indirect_tirs:
|
||||
mlx5e_destroy_indirect_tirs(priv, true);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
err_destroy_direct_rqts:
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
err_destroy_indirect_rqts:
|
||||
|
@ -412,7 +412,7 @@ static void mlx5i_cleanup_rx(struct mlx5e_priv *priv)
|
|||
{
|
||||
mlx5i_destroy_flow_steering(priv);
|
||||
mlx5e_destroy_direct_tirs(priv, priv->direct_tir);
|
||||
mlx5e_destroy_indirect_tirs(priv, true);
|
||||
mlx5e_destroy_indirect_tirs(priv);
|
||||
mlx5e_destroy_direct_rqts(priv, priv->direct_tir);
|
||||
mlx5e_destroy_rqt(priv, &priv->indir_rqt);
|
||||
mlx5e_close_drop_rq(&priv->drop_rq);
|
||||
|
|
Loading…
Reference in New Issue