From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: [PATCH v3 05/11] app/testpmd: fix flow completion for RSS queues Date: Fri, 6 Apr 2018 15:22:41 +0200 Message-ID: <20180406131243.19037-6-adrien.mazarguil@6wind.com> References: <20180404144805.11966-1-adrien.mazarguil@6wind.com> <20180406131243.19037-1-adrien.mazarguil@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu To: dev@dpdk.org Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id B0A861D083 for ; Fri, 6 Apr 2018 15:22:55 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id b127so3522993wmf.5 for ; Fri, 06 Apr 2018 06:22:55 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180406131243.19037-1-adrien.mazarguil@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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@dpdk.org Signed-off-by: Adrien Mazarguil Cc: Wenzhuo Lu Cc: Jingjing Wu --- 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