[dpdk-dev] [PATCH v4 05/11] app/testpmd: fix flow completion for RSS queues
Adrien Mazarguil
adrien.mazarguil at 6wind.com
Tue Apr 10 18:34:11 CEST 2018
The lack of a working completion for RSS queues was overlooked during
development; until now only "end" was displayed as a valid token.
Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Cc: stable at dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
Cc: Wenzhuo Lu <wenzhuo.lu at intel.com>
Cc: Jingjing Wu <jingjing.wu at intel.com>
---
app/test-pmd/cmdline_flow.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a5cf84f79..9cac8e9bf 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -2663,17 +2663,15 @@ static int
comp_vc_action_rss_queue(struct context *ctx, const struct token *token,
unsigned int ent, char *buf, unsigned int size)
{
- static const char *const str[] = { "", "end", NULL };
- unsigned int i;
-
(void)ctx;
(void)token;
- for (i = 0; str[i] != NULL; ++i)
- if (buf && i == ent)
- return snprintf(buf, size, "%s", str[i]);
- if (buf)
- return -1;
- return i;
+ if (!buf)
+ return nb_rxq + 1;
+ if (ent < nb_rxq)
+ return snprintf(buf, size, "%u", ent);
+ if (ent == nb_rxq)
+ return snprintf(buf, size, "end");
+ return -1;
}
/** Internal context. */
--
2.11.0
More information about the dev
mailing list