All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/8] net/mlx4_en: allow setting number of rx rings for, RSS/TCP
@ 2011-11-21  8:43 Yevgeny Petrilin
  2011-11-21 16:57 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Yevgeny Petrilin @ 2011-11-21  8:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, yevgenyp, ogerlitz, oren, amirv

From: Amir Vadai <amirv@mellanox.co.il>

Make RSS TCP divert packets only to part of the rx rings, other could be
accessed by using flow steering or RFS acceleration

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
---
 drivers/net/ethernet/mellanox/mlx4/en_main.c |    7 ++++---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   |    9 ++++++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index a06096f..f70bafb 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -63,9 +63,10 @@ static const char mlx4_en_version[] =
  */
 
 
-/* Enable RSS TCP traffic */
-MLX4_EN_PARM_INT(tcp_rss, 1,
-		 "Enable RSS for incomming TCP traffic or disabled (0)");
+/* RSS TCP usage */
+MLX4_EN_PARM_INT(tcp_rss, -1,
+		 "0 to disable RSS TCP, if n > 0, use n rx rings by RSS TCP. -1 "
+		 "for all rx rings");
 /* Enable RSS UDP traffic */
 MLX4_EN_PARM_INT(udp_rss, 1,
 		 "Enable RSS for incomming UDP traffic or disabled (0)");
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 3c24e16..044123a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -834,6 +834,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
 	struct mlx4_en_rss_map *rss_map = &priv->rss_map;
 	struct mlx4_qp_context context;
 	struct mlx4_rss_context *rss_context;
+	int tcp_rss_table_size;
 	void *ptr;
 	u8 rss_mask = (MLX4_RSS_IPV4 | MLX4_RSS_TCP_IPV4 | MLX4_RSS_IPV6 |
 			MLX4_RSS_TCP_IPV6);
@@ -874,10 +875,16 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
 	mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn,
 				priv->rx_ring[0].cqn, &context);
 
+	if (priv->mdev->profile.tcp_rss == -1 ||
+	    priv->mdev->profile.tcp_rss > priv->rx_ring_num)
+		tcp_rss_table_size = priv->rx_ring_num;
+	else
+		tcp_rss_table_size = max(1, priv->mdev->profile.tcp_rss);
+
 	ptr = ((void *) &context) + offsetof(struct mlx4_qp_context, pri_path)
 					+ MLX4_RSS_OFFSET_IN_QPC_PRI_PATH;
 	rss_context = ptr;
-	rss_context->base_qpn = cpu_to_be32(ilog2(priv->rx_ring_num) << 24 |
+	rss_context->base_qpn = cpu_to_be32(ilog2(tcp_rss_table_size) << 24 |
 					    (rss_map->base_qpn));
 	if (priv->mdev->profile.udp_rss) {
 		rss_mask |=  MLX4_RSS_UDP_IPV4 | MLX4_RSS_UDP_IPV6;
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/8] net/mlx4_en: allow setting number of rx rings for, RSS/TCP
  2011-11-21  8:43 [PATCH 6/8] net/mlx4_en: allow setting number of rx rings for, RSS/TCP Yevgeny Petrilin
@ 2011-11-21 16:57 ` Ben Hutchings
  2011-11-21 18:43   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-11-21 16:57 UTC (permalink / raw)
  To: Yevgeny Petrilin; +Cc: davem, netdev, ogerlitz, oren, amirv

On Mon, 2011-11-21 at 10:43 +0200, Yevgeny Petrilin wrote:
> From: Amir Vadai <amirv@mellanox.co.il>
> 
> Make RSS TCP divert packets only to part of the rx rings, other could be
> accessed by using flow steering or RFS acceleration
[...]

The ethtool {get,set}_rxfh_indir operations are a standard and more
flexible interface for configuring this.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/8] net/mlx4_en: allow setting number of rx rings for, RSS/TCP
  2011-11-21 16:57 ` Ben Hutchings
@ 2011-11-21 18:43   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-11-21 18:43 UTC (permalink / raw)
  To: bhutchings; +Cc: yevgenyp, netdev, ogerlitz, oren, amirv

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 21 Nov 2011 16:57:30 +0000

> On Mon, 2011-11-21 at 10:43 +0200, Yevgeny Petrilin wrote:
>> From: Amir Vadai <amirv@mellanox.co.il>
>> 
>> Make RSS TCP divert packets only to part of the rx rings, other could be
>> accessed by using flow steering or RFS acceleration
> [...]
> 
> The ethtool {get,set}_rxfh_indir operations are a standard and more
> flexible interface for configuring this.

Agreed, you should _NEVER_ add module options or private driver extensions
for such a common configuration setting.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-21 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-21  8:43 [PATCH 6/8] net/mlx4_en: allow setting number of rx rings for, RSS/TCP Yevgeny Petrilin
2011-11-21 16:57 ` Ben Hutchings
2011-11-21 18:43   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.