]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Fix inner tirs handling
authorRoi Dayan <roid@mellanox.com>
Thu, 30 Apr 2020 06:16:01 +0000 (09:16 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Sat, 23 May 2020 00:28:44 +0000 (17:28 -0700)
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: df871862909f ("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>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c

index 23701c0e36ec38c3533deb67c64e62da9b50bbf3..59745402747be1b2de165bc3fc0297ed8a1c433a 100644 (file)
@@ -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);
index b314adf438da2d55c412e847a7ad149d415bcc65..c6b83042d4318f26328205651256802abc93031b 100644 (file)
@@ -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);
index cdecf4280e868d1be72f480260652441644f2dbf..4a8e0dfdc5f2c62331a0de68f1001abd5f6f17a4 100644 (file)
@@ -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);
index 673aaa815f571046fa177d54c8ab4c40a01872c8..505cf6eeae25cecc38f8e13e03fd046928b87b55 100644 (file)
@@ -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);