patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v6 2/5] app/testpmd: fix RSS key length
       [not found] <20211027142213.556166-1-maxime.coquelin@redhat.com>
@ 2021-10-27 14:22 ` Maxime Coquelin
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 3/5] app/testpmd: fix RSS type display Maxime Coquelin
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 4/5] net/mlx5: fix RSS RETA update Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-27 14:22 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz, david.marchand, andrew.rybchenko,
	ferruh.yigit, michaelba, viacheslavo, xiaoyun.li
  Cc: nelio.laranjeiro, yvugenfi, ybendito, Maxime Coquelin, stable

port_rss_hash_key_update() initializes rss_conf with the
RSS key configuration provided  by the user, but it calls
rte_eth_dev_rss_hash_conf_get() before calling
rte_eth_dev_rss_hash_update(), which overrides the parsed
RSS config.

While the RSS key value is set again after, this is not
the case of the key length. It could cause out of bounds
access if the key length parsed is smaller than the one
read from rte_eth_dev_rss_hash_conf_get().

This patch restores the key length before the
rte_eth_dev_rss_hash_update() call to ensure the RSS key
value/length pair is consistent.

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 app/test-pmd/config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a18871d461..e5c58ceb37 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3040,7 +3040,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
 	unsigned int i;
 
 	rss_conf.rss_key = NULL;
-	rss_conf.rss_key_len = hash_key_len;
+	rss_conf.rss_key_len = 0;
 	rss_conf.rss_hf = 0;
 	for (i = 0; rss_type_table[i].str; i++) {
 		if (!strcmp(rss_type_table[i].str, rss_type))
@@ -3049,6 +3049,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
 	diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
 	if (diag == 0) {
 		rss_conf.rss_key = hash_key;
+		rss_conf.rss_key_len = hash_key_len;
 		diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf);
 	}
 	if (diag == 0)
-- 
2.31.1


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

* [dpdk-stable] [PATCH v6 3/5] app/testpmd: fix RSS type display
       [not found] <20211027142213.556166-1-maxime.coquelin@redhat.com>
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 2/5] app/testpmd: fix RSS key length Maxime Coquelin
@ 2021-10-27 14:22 ` Maxime Coquelin
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 4/5] net/mlx5: fix RSS RETA update Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-27 14:22 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz, david.marchand, andrew.rybchenko,
	ferruh.yigit, michaelba, viacheslavo, xiaoyun.li
  Cc: nelio.laranjeiro, yvugenfi, ybendito, Maxime Coquelin, stable

This patch fixes the display of the RSS hash types
configured in the port, which displayed "all" even
if only a single type was configured

Fixes: 3c90743dd3b9 ("app/testpmd: support more types for flow RSS")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 app/test-pmd/config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e5c58ceb37..2e52664964 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3019,7 +3019,9 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 	}
 	printf("RSS functions:\n ");
 	for (i = 0; rss_type_table[i].str; i++) {
-		if (rss_hf & rss_type_table[i].rss_type)
+		if (rss_type_table[i].rss_type == 0)
+			continue;
+		if ((rss_hf & rss_type_table[i].rss_type) == rss_type_table[i].rss_type)
 			printf("%s ", rss_type_table[i].str);
 	}
 	printf("\n");
-- 
2.31.1


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

* [dpdk-stable] [PATCH v6 4/5] net/mlx5: fix RSS RETA update
       [not found] <20211027142213.556166-1-maxime.coquelin@redhat.com>
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 2/5] app/testpmd: fix RSS key length Maxime Coquelin
  2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 3/5] app/testpmd: fix RSS type display Maxime Coquelin
@ 2021-10-27 14:22 ` Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-27 14:22 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz, david.marchand, andrew.rybchenko,
	ferruh.yigit, michaelba, viacheslavo, xiaoyun.li
  Cc: nelio.laranjeiro, yvugenfi, ybendito, Maxime Coquelin, stable

This patch fixes RETA updating for entries above 64.
Without ithat, these entries are never updated as
calculated mask value will always be 0.

Fixes: 634efbc2c8c0 ("mlx5: support RETA query and update")
Cc: stable@dpdk.org
Cc: nelio.laranjeiro@6wind.com

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_rss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index a4f690039e..a04e22398d 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -211,7 +211,7 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
 	for (idx = 0, i = 0; (i != reta_size); ++i) {
 		idx = i / RTE_ETH_RETA_GROUP_SIZE;
 		pos = i % RTE_ETH_RETA_GROUP_SIZE;
-		if (((reta_conf[idx].mask >> i) & 0x1) == 0)
+		if (((reta_conf[idx].mask >> pos) & 0x1) == 0)
 			continue;
 		MLX5_ASSERT(reta_conf[idx].reta[pos] < priv->rxqs_n);
 		(*priv->reta_idx)[i] = reta_conf[idx].reta[pos];
-- 
2.31.1


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

end of thread, other threads:[~2021-10-27 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211027142213.556166-1-maxime.coquelin@redhat.com>
2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 2/5] app/testpmd: fix RSS key length Maxime Coquelin
2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 3/5] app/testpmd: fix RSS type display Maxime Coquelin
2021-10-27 14:22 ` [dpdk-stable] [PATCH v6 4/5] net/mlx5: fix RSS RETA update Maxime Coquelin

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).