patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v4 2/5] app/testpmd: fix RSS key length
       [not found] <20211004143017.51488-1-maxime.coquelin@redhat.com>
@ 2021-10-04 14:30 ` Maxime Coquelin
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 3/5] app/testpmd: fix RSS type display Maxime Coquelin
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 4/5] net/mlx5: fix RSS RETA update Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-04 14:30 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 9c66329e96..611965769c 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2854,7 +2854,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))
@@ -2863,6 +2863,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 v4 3/5] app/testpmd: fix RSS type display
       [not found] <20211004143017.51488-1-maxime.coquelin@redhat.com>
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 2/5] app/testpmd: fix RSS key length Maxime Coquelin
@ 2021-10-04 14:30 ` Maxime Coquelin
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 4/5] net/mlx5: fix RSS RETA update Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-04 14:30 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 611965769c..9a4a0c232b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2833,7 +2833,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 v4 4/5] net/mlx5: fix RSS RETA update
       [not found] <20211004143017.51488-1-maxime.coquelin@redhat.com>
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 2/5] app/testpmd: fix RSS key length Maxime Coquelin
  2021-10-04 14:30 ` [dpdk-stable] [PATCH v4 3/5] app/testpmd: fix RSS type display Maxime Coquelin
@ 2021-10-04 14:30 ` Maxime Coquelin
  2 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-10-04 14:30 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 c32129cdc2..6dc52acee0 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_RETA_GROUP_SIZE;
 		pos = i % RTE_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-04 14:31 UTC | newest]

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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git