From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, tziporet@mellanox.co.il
Subject: [PATCH 2/6] mlx4_en: Separating default QP in RSS context
Date: Thu, 26 Mar 2009 15:49:31 +0200 [thread overview]
Message-ID: <49CB87EB.8060404@mellanox.co.il> (raw)
The default QP number in RSS is no longer part of the RSS table.
We want to separate TCP streams from other streams because we
want to handle them differently. Changed the RSS mask to perform
the hashing on TCP packets only and to send all the others to the
default ring.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
drivers/net/mlx4/en_main.c | 2 +-
drivers/net/mlx4/en_params.c | 2 +-
drivers/net/mlx4/en_rx.c | 4 ++--
drivers/net/mlx4/mlx4_en.h | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c
index eda72dd..ca6f7dc 100644
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -170,7 +170,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
mlx4_info(mdev, "Using %d tx rings for port:%d\n",
mdev->profile.prof[i].tx_ring_num, i);
mdev->profile.prof[i].rx_ring_num =
- min_t(int, dev->caps.num_comp_vectors, MAX_RX_RINGS);
+ min_t(int, dev->caps.num_comp_vectors + 1, MAX_RX_RINGS);
mlx4_info(mdev, "Defaulting to %d rx rings for port:%d\n",
mdev->profile.prof[i].rx_ring_num, i);
}
diff --git a/drivers/net/mlx4/en_params.c b/drivers/net/mlx4/en_params.c
index c1bd040..7f44fcb 100644
--- a/drivers/net/mlx4/en_params.c
+++ b/drivers/net/mlx4/en_params.c
@@ -53,7 +53,7 @@
MLX4_EN_PARM_INT(rss_xor, 0, "Use XOR hash function for RSS");
/* RSS hash type mask - default to <saddr, daddr, sport, dport> */
-MLX4_EN_PARM_INT(rss_mask, 0xf, "RSS hash type bitmask");
+MLX4_EN_PARM_INT(rss_mask, 0x5, "RSS hash type bitmask");
/* Number of LRO sessions per Rx ring (rounded up to a power of two) */
MLX4_EN_PARM_INT(num_lro, MLX4_EN_MAX_LRO_DESCRIPTORS,
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index a4130e7..b8c7182 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -1022,8 +1022,8 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
ptr = ((void *) &context) + 0x3c;
rss_context = (struct mlx4_en_rss_context *) ptr;
- rss_context->base_qpn = cpu_to_be32(ilog2(rss_map->size) << 24 |
- (rss_map->base_qpn));
+ rss_context->base_qpn = cpu_to_be32(ilog2(rss_map->size - 1) << 24 |
+ (rss_map->base_qpn + 1));
rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn);
rss_context->hash_fn = rss_xor & 0x3;
rss_context->flags = rss_mask << 2;
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index e9af32d..8fe1d39 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -78,9 +78,9 @@
#define MLX4_EN_PAGE_SHIFT 12
#define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT)
#define MAX_TX_RINGS 16
-#define MAX_RX_RINGS 16
+#define MAX_RX_RINGS 17
#define MAX_RSS_MAP_SIZE 64
-#define RSS_FACTOR 2
+#define RSS_FACTOR 1
#define TXBB_SIZE 64
#define HEADROOM (2048 / TXBB_SIZE + 1)
#define MAX_LSO_HDR_SIZE 92
--
1.6.1.3
next reply other threads:[~2009-03-26 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-26 13:49 Yevgeny Petrilin [this message]
2009-03-27 7:35 ` [PATCH 2/6] mlx4_en: Separating default QP in RSS context David Miller
2009-03-29 10:10 ` Yevgeny Petrilin
2009-03-29 10:12 ` 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=49CB87EB.8060404@mellanox.co.il \
--to=yevgenyp@mellanox.co.il \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=tziporet@mellanox.co.il \
/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;
as well as URLs for NNTP newsgroup(s).