* [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>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--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