Skip to content

Commit 080d1b1

Browse files
ayalevin123Saeed Mahameed
authored andcommitted
net/mlx5e: Move modify tirs hash functionality
Move modify tirs hash functionality (mlx5e_modify_tirs_hash) from en_ethtool.c to en_main.c. This allows future use of this fuctionality from en_fs_ethtool.c, while keeping current convention: en_ethtool.c doesn't have an API. There is no functional change here. Signed-off-by: Aya Levin <ayal@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 3054383 commit 080d1b1

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ int mlx5e_redirect_rqt(struct mlx5e_priv *priv, u32 rqtn, int sz,
799799
void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_params *params,
800800
enum mlx5e_traffic_types tt,
801801
void *tirc, bool inner);
802+
void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen);
802803

803804
int mlx5e_open_locked(struct net_device *netdev);
804805
int mlx5e_close_locked(struct net_device *netdev);

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -972,31 +972,6 @@ static int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
972972
return 0;
973973
}
974974

975-
static void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
976-
{
977-
void *tirc = MLX5_ADDR_OF(modify_tir_in, in, ctx);
978-
struct mlx5_core_dev *mdev = priv->mdev;
979-
int ctxlen = MLX5_ST_SZ_BYTES(tirc);
980-
int tt;
981-
982-
MLX5_SET(modify_tir_in, in, bitmask.hash, 1);
983-
984-
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
985-
memset(tirc, 0, ctxlen);
986-
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc, false);
987-
mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
988-
}
989-
990-
if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
991-
return;
992-
993-
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
994-
memset(tirc, 0, ctxlen);
995-
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc, true);
996-
mlx5_core_modify_tir(mdev, priv->inner_indir_tir[tt].tirn, in, inlen);
997-
}
998-
}
999-
1000975
static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir,
1001976
const u8 *key, const u8 hfunc)
1002977
{

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,34 @@ void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_params *params,
27352735
}
27362736
}
27372737

2738+
void mlx5e_modify_tirs_hash(struct mlx5e_priv *priv, void *in, int inlen)
2739+
{
2740+
void *tirc = MLX5_ADDR_OF(modify_tir_in, in, ctx);
2741+
struct mlx5_core_dev *mdev = priv->mdev;
2742+
int ctxlen = MLX5_ST_SZ_BYTES(tirc);
2743+
int tt;
2744+
2745+
MLX5_SET(modify_tir_in, in, bitmask.hash, 1);
2746+
2747+
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
2748+
memset(tirc, 0, ctxlen);
2749+
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc,
2750+
false);
2751+
mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in, inlen);
2752+
}
2753+
2754+
if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
2755+
return;
2756+
2757+
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++) {
2758+
memset(tirc, 0, ctxlen);
2759+
mlx5e_build_indir_tir_ctx_hash(&priv->channels.params, tt, tirc,
2760+
true);
2761+
mlx5_core_modify_tir(mdev, priv->inner_indir_tir[tt].tirn, in,
2762+
inlen);
2763+
}
2764+
}
2765+
27382766
static int mlx5e_modify_tirs_lro(struct mlx5e_priv *priv)
27392767
{
27402768
struct mlx5_core_dev *mdev = priv->mdev;

0 commit comments

Comments
 (0)