Skip to contentSkip to conversation

testpmd: allow to query any RETA size

PATCH In review Yuanhan Liu 3 participants 6 messages Jul 7, 2017 – Oct 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 testpmd: allow to query any RETA size

Currently, testpmd just allows to query the RETA info only when the required size equals to configured RETA size.

This patch allows to query any RETA size <= the configured size. This helps when the RETA size is big (say 512) and when I just want to peak few RETA entries.

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index 0afac68..c8faef9 100644
@@ -2143,7 +2143,7 @@ cmd_showport_reta_parsed(void *parsed_result,
 
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
-	if (dev_info.reta_size == 0 || res->size != dev_info.reta_size ||
+	if (dev_info.reta_size == 0 || res->size > dev_info.reta_size ||
 				res->size > ETH_RSS_RETA_SIZE_512) {
 		printf("Invalid redirection table size: %u\n", res->size);
 		return;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 testpmd: give more hint on invalid RETA size

Print the valid RTE size range so that user knows what goes wrong.

---
 app/test-pmd/cmdline.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +5 -3
index c8faef9..d32a1df 100644
@@ -2140,12 +2140,14 @@ cmd_showport_reta_parsed(void *parsed_result,
 	struct cmd_showport_reta *res = parsed_result;
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
+	uint16_t max_reta_size;
 
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
-	if (dev_info.reta_size == 0 || res->size > dev_info.reta_size ||
-				res->size > ETH_RSS_RETA_SIZE_512) {
-		printf("Invalid redirection table size: %u\n", res->size);
+	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
+	if (res->size == 0 || res->size > max_reta_size) {
+		printf("Invalid redirection table size: %u (1-%u)\n",
+			res->size, max_reta_size);
 		return;
 	}
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 2/2] testpmd: give more hint on invalid RETA size

Quoted 28 lines

-----Original Message-----
From: Yuanhan Liu [mailto:[email protected]]
Sent: Friday, July 7, 2017 2:02 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Yuanhan Liu <[email protected]>
Subject: [PATCH 2/2] testpmd: give more hint on invalid RETA size

Print the valid RTE size range so that user knows what goes wrong.

---
 app/test-pmd/cmdline.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +1 -0
index c8faef9..d32a1df 100644
@@ -2140,12 +2140,14 @@ cmd_showport_reta_parsed(void *parsed_result,
 	struct cmd_showport_reta *res = parsed_result;
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
+	uint16_t max_reta_size;
 
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);

app/test-pmd/cmdline.c cmd_showport_reta_parsed(void *parsed_result, · line 2153

Quoted 10 lines
app/test-pmd/cmdline.c +4 -3
-	if (dev_info.reta_size == 0 || res->size > dev_info.reta_size ||
-				res->size > ETH_RSS_RETA_SIZE_512) {
-		printf("Invalid redirection table size: %u\n", res->size);
+	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
+	if (res->size == 0 || res->size > max_reta_size) {
+		printf("Invalid redirection table size: %u (1-%u)\n",
+			res->size, max_reta_size);
 		return;
 	}
 

Why not merge this with previous one?
Thanks
Jingjing

#3 lore raw

Re: [PATCH 2/2] testpmd: give more hint on invalid RETA size

Quoted 21 lines · Jingjing
Quoted 21 lines

-----Original Message-----
From: Yuanhan Liu [mailto:[email protected]]
Subject: [PATCH 2/2] testpmd: give more hint on invalid RETA size

Print the valid RTE size range so that user knows what goes wrong.

---
 app/test-pmd/cmdline.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +1 -0
index c8faef9..d32a1df 100644
@@ -2140,12 +2140,14 @@ cmd_showport_reta_parsed(void *parsed_result,
 	struct cmd_showport_reta *res = parsed_result;
 	struct rte_eth_rss_reta_entry64 reta_conf[8];
 	struct rte_eth_dev_info dev_info;
+	uint16_t max_reta_size;
 
Quoted 13 lines

app/test-pmd/cmdline.c cmd_showport_reta_parsed(void *parsed_result, · line 2153

Quoted 12 lines
app/test-pmd/cmdline.c +4 -3
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(res->port_id, &dev_info);
-	if (dev_info.reta_size == 0 || res->size > dev_info.reta_size ||
-				res->size > ETH_RSS_RETA_SIZE_512) {
-		printf("Invalid redirection table size: %u\n", res->size);
+	max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512);
+	if (res->size == 0 || res->size > max_reta_size) {
+		printf("Invalid redirection table size: %u (1-%u)\n",
+			res->size, max_reta_size);
 		return;
 	}
 

Why not merge this with previous one?

Because they are two differnt things, even though each of them is really tiny.

	--yliu
Acked-by on v1 1/2
#4 lore raw
In reply to Yuanhan Liu
Quoted 9 lines

-----Original Message-----
From: Yuanhan Liu [mailto:[email protected]]
Sent: Friday, July 7, 2017 2:02 PM
To: [email protected]
Cc: Wu, Jingjing <[email protected]>; Yuanhan Liu <[email protected]>
Subject: [PATCH 1/2] testpmd: allow to query any RETA size

Quoted 8 lines

Currently, testpmd just allows to query the RETA info only when the required size equals to configured RETA size.

This patch allows to query any RETA size <= the configured size. This helps when the RETA size is big (say 512) and when I just want to peak few RETA entries.

Looks reasonable.

#5 lore raw
Quoted 10 lines · Jingjing)
Quoted 10 lines

-----Original Message-----
From: Yuanhan Liu [mailto:yliu at fridaylinux.org]
Sent: Friday, July 7, 2017 2:02 PM
To: dev at dpdk.org
Cc: Wu, Jingjing <jingjing.wu at intel.com>; Yuanhan Liu <yliu at fridaylinux.org>
Subject: [PATCH 1/2] testpmd: allow to query any RETA size

Currently, testpmd just allows to query the RETA info only when the required size equals to configured RETA size.

Quoted 7 lines
Quoted 5 lines

This patch allows to query any RETA size <= the configured size. This helps when the RETA size is big (say 512) and when I just want to peak few RETA entries.

Signed-off-by Yuanhan Liu <yliu at fridaylinux.org>
Acked-by Jingjing Wu <jingjing.wu at intel.com>

Series applied to dpdk-next-net/master, thanks.