From 3f22d6c77bb91b3429814c3baae91903c8cf7f90 Mon Sep 17 00:00:00 2001 From: Maxim Mikityanskiy Date: Mon, 5 Apr 2021 18:27:40 +0300 Subject: net/mlx5e: Move RX resources to a separate struct This commit moves RQTs and TIRs to a separate struct that is allocated dynamically in profiles that support these RX resources (all profiles, except IPoIB PKey). It also allows to remove rqt_enabled flags, as RQTs are always enabled in profiles that support RX resources. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c') diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index c1f42eade842..8a75b37edcc2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -1172,7 +1172,7 @@ static int mlx5e_set_link_ksettings(struct net_device *netdev, u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv) { - return sizeof(priv->rss_params.toeplitz_hash_key); + return sizeof(priv->rx_res->rss_params.toeplitz_hash_key); } static u32 mlx5e_get_rxfh_key_size(struct net_device *netdev) @@ -1198,7 +1198,9 @@ int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc) { struct mlx5e_priv *priv = netdev_priv(netdev); - struct mlx5e_rss_params *rss = &priv->rss_params; + struct mlx5e_rss_params *rss; + + rss = &priv->rx_res->rss_params; if (indir) memcpy(indir, rss->indir.table, sizeof(rss->indir.table)); @@ -1217,8 +1219,8 @@ int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc) { struct mlx5e_priv *priv = netdev_priv(dev); - struct mlx5e_rss_params *rss = &priv->rss_params; int inlen = MLX5_ST_SZ_BYTES(modify_tir_in); + struct mlx5e_rss_params *rss; bool refresh_tirs = false; bool refresh_rqt = false; void *in; @@ -1234,6 +1236,8 @@ int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, mutex_lock(&priv->state_lock); + rss = &priv->rx_res->rss_params; + if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != rss->hfunc) { rss->hfunc = hfunc; refresh_rqt = true; @@ -1261,7 +1265,8 @@ int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, for (ix = 0; ix < priv->channels.num; ix++) rqns[ix] = priv->channels.c[ix]->rq.rqn; - mlx5e_rqt_redirect_indir(&priv->indir_rqt, rqns, priv->channels.num, + mlx5e_rqt_redirect_indir(&priv->rx_res->indir_rqt, rqns, + priv->channels.num, rss->hfunc, &rss->indir); kvfree(rqns); } -- cgit