From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
Tal Alon <talal@mellanox.com>, Tariq Toukan <tariqt@mellanox.com>,
Eran Ben Elisha <eranbe@mellanox.com>,
Eric Dumazet <edumazet@google.com>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [PATCH net-next V3 03/11] net/mlx5e: Use only close NUMA node for default RSS
Date: Wed, 20 Apr 2016 22:02:11 +0300 [thread overview]
Message-ID: <1461178939-20687-4-git-send-email-saeedm@mellanox.com> (raw)
In-Reply-To: <1461178939-20687-1-git-send-email-saeedm@mellanox.com>
From: Tariq Toukan <tariqt@mellanox.com>
Distribute default RSS table uniformly over the rings of the
close NUMA node, instead of all available channels.
This way we enforce the preference of close rings over far ones.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 3 ++-
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 15 +++++++++++++--
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index c4ddbe8..7f19644 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -671,7 +671,8 @@ void mlx5e_build_tir_ctx_hash(void *tirc, struct mlx5e_priv *priv);
int mlx5e_open_locked(struct net_device *netdev);
int mlx5e_close_locked(struct net_device *netdev);
-void mlx5e_build_default_indir_rqt(u32 *indirection_rqt, int len,
+void mlx5e_build_default_indir_rqt(struct mlx5_core_dev *mdev,
+ u32 *indirection_rqt, int len,
int num_channels);
static inline void mlx5e_tx_notify_hw(struct mlx5e_sq *sq,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 39c1902..6f40ba4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -397,7 +397,7 @@ static int mlx5e_set_channels(struct net_device *dev,
mlx5e_close_locked(dev);
priv->params.num_channels = count;
- mlx5e_build_default_indir_rqt(priv->params.indirection_rqt,
+ mlx5e_build_default_indir_rqt(priv->mdev, priv->params.indirection_rqt,
MLX5E_INDIR_RQT_SIZE, count);
if (was_opened)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 7fbe1ba..9b58ef6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2297,11 +2297,22 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv)
}
#endif
-void mlx5e_build_default_indir_rqt(u32 *indirection_rqt, int len,
+void mlx5e_build_default_indir_rqt(struct mlx5_core_dev *mdev,
+ u32 *indirection_rqt, int len,
int num_channels)
{
+ int node = mdev->priv.numa_node;
+ int node_num_of_cores;
int i;
+ if (node == -1)
+ node = first_online_node;
+
+ node_num_of_cores = cpumask_weight(cpumask_of_node(node));
+
+ if (node_num_of_cores)
+ num_channels = min_t(int, num_channels, node_num_of_cores);
+
for (i = 0; i < len; i++)
indirection_rqt[i] = i % num_channels;
}
@@ -2333,7 +2344,7 @@ static void mlx5e_build_netdev_priv(struct mlx5_core_dev *mdev,
netdev_rss_key_fill(priv->params.toeplitz_hash_key,
sizeof(priv->params.toeplitz_hash_key));
- mlx5e_build_default_indir_rqt(priv->params.indirection_rqt,
+ mlx5e_build_default_indir_rqt(mdev, priv->params.indirection_rqt,
MLX5E_INDIR_RQT_SIZE, num_channels);
priv->params.lro_wqe_sz =
--
1.7.1
next prev parent reply other threads:[~2016-04-20 19:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 19:02 [PATCH net-next V3 00/11] Mellanox 100G mlx5 driver receive path optimizations Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 01/11] net/mlx5: Introduce device queue counters Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 02/11] net/mlx5e: Allocate set of queue counters per netdev Saeed Mahameed
2016-04-20 19:02 ` Saeed Mahameed [this message]
2016-04-20 19:02 ` [PATCH net-next V3 04/11] net/mlx5e: Use function pointers for RX data path handling Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 05/11] net/mlx5e: Support RX multi-packet WQE (Striding RQ) Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 06/11] net/mlx5e: Added ICO SQs Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 07/11] net/mlx5e: Add fragmented memory support for RX multi packet WQE Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 08/11] net/mlx5e: Use napi_alloc_skb for RX SKB allocations Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 09/11] net/mlx5e: Remove redundant barrier Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 10/11] net/mlx5e: Delay skb->data access Saeed Mahameed
2016-04-20 19:02 ` [PATCH net-next V3 11/11] net/mlx5e: Add ethtool counter for RX buffer allocation failures Saeed Mahameed
2016-04-21 19:09 ` [PATCH net-next V3 00/11] Mellanox 100G mlx5 driver receive path optimizations David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461178939-20687-4-git-send-email-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eranbe@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=talal@mellanox.com \
--cc=tariqt@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox