Skip to contentSkip to conversation

app/testpmd: fix wrong return value

PATCH In review Qi Zhang 3 participants 3 messages Sep 29, 2019 – Sep 30, 2019

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH 1/1 app/testpmd: fix wrong return value

The patch fix the issue that return value in parse_vc_action_rss be overwritten unexpectly. That cause an rte_flow creation command with rss action does not work.

For example:

testpmd> flow create 0 ingress pattern eth / ipv4 / end \
actions rss types ipv4 end / end

We will get error "Bad Agument"

Fixes f5267e485a2a ("app/testpmd: check status of getting ethdev info")
---
 app/test-pmd/cmdline_flow.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
app/test-pmd/cmdline_flow.c +4 -3
index 369426cbd..932bdb98e 100644
@@ -3549,10 +3549,11 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
 	if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
+		int ret2;
 
-		ret = rte_eth_dev_info_get(ctx->port, &info);
-		if (ret != 0)
-			return ret;
+		ret2 = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret2 != 0)
+			return ret2;
 
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 41 lines · Qi Zhang

The patch fix the issue that return value in parse_vc_action_rss be overwritten unexpectly. That cause an rte_flow creation command with rss action does not work.

For example:

testpmd> flow create 0 ingress pattern eth / ipv4 / end \
actions rss types ipv4 end / end

We will get error "Bad Agument"

Fixes f5267e485a2a ("app/testpmd: check status of getting ethdev info")

---
app/test-pmd/cmdline_flow.c | 7 ++++---

1 file changed, 4 insertions(+), 3 deletions(-)
app/test-pmd/cmdline_flow.c +4 -3
index 369426cbd..932bdb98e 100644
@@ -3549,10 +3549,11 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
 	if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
+		int ret2;
 
-		ret = rte_eth_dev_info_get(ctx->port, &info);
-		if (ret != 0)
-			return ret;
+		ret2 = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret2 != 0)
+			return ret2;
 
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
Signature · 1 line
2.13.6
#2 lore raw
Quoted 37 lines · Ye Xiaolong
Quoted 36 lines · Qi Zhang

The patch fix the issue that return value in parse_vc_action_rss be overwritten unexpectly. That cause an rte_flow creation command with rss action does not work.

For example:

testpmd> flow create 0 ingress pattern eth / ipv4 / end \
actions rss types ipv4 end / end

We will get error "Bad Agument"

Fixes f5267e485a2a ("app/testpmd: check status of getting ethdev info")

---
app/test-pmd/cmdline_flow.c | 7 ++++---

1 file changed, 4 insertions(+), 3 deletions(-)
app/test-pmd/cmdline_flow.c +4 -3
index 369426cbd..932bdb98e 100644
@@ -3549,10 +3549,11 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
 	if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
 	    ctx->port != (portid_t)RTE_PORT_ALL) {
 		struct rte_eth_dev_info info;
+		int ret2;
 
-		ret = rte_eth_dev_info_get(ctx->port, &info);
-		if (ret != 0)
-			return ret;
+		ret2 = rte_eth_dev_info_get(ctx->port, &info);
+		if (ret2 != 0)
+			return ret2;
 
Quoted 8 lines
Quoted 5 lines
app/test-pmd/cmdline_flow.c +0 -0
 		action_rss_data->conf.key_len =
 			RTE_MIN(sizeof(action_rss_data->key),
Signature · 1 line
2.13.6

Squashed into relevant commit in next-net, thanks.