From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8W76KGOBWe8spOSweraVtm8sWiN9hW8+NZqeLvkuTPE=; b=ZbeA1zBTenFavJoznITVTKWnl2OIJUQO5CroTvgOvdnkx11PuHHWOj4seEwsSz5DdZ zNTDLve/TT/ETBU1Mc5hQRcGq3NyMcs9/nTOd8yQCZs/2f2t49tWgvggkyJ8z0lAHKrZ p8s2xMHc9FuSj56UfLU+swje85SrGdq6nc82owqZf97TV5l8Uisb5DXX33tRxHj1QPcV zfwhzYOEJWl/TYvQAiOHs0gKVLKSavqT2vCMYnsa869nRXDr6wACBTU1IHsubAavjJoi ow2wAnIRbHbpelBAe7CbHCeMWjfJRes407tAGNahEhF6ka/jdIIxzuYGYJf17UslpCz5 tf6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8W76KGOBWe8spOSweraVtm8sWiN9hW8+NZqeLvkuTPE=; b=cJEIxNZgOThxykVToFGEmFFakDeIAXAJvFEmy/nvD5BnMwCh0LLpgSq7VLlz5xzV8S fCx+LWOVuq64G3JgQMM8WIKZEac9iZB8ISE5QR38SxKjMGln/VB2r9EIGX832OWlW2Sv U3H1BAv+iouVzRYeEC1Zdg5LEAMdqHB0f8EYj/m+4Sbpg6PN8rMkZ4+3Hh2iuHo11B7o eDr8+X3kEkbh6lh6ooIBmVNKSQdzVT6x0GOHs/hoT27ecl3ZoiaI/O26gOOEJBrBFPZC 5u3LmDIAjdxo5RSUWMDgiaTs87VW9iqF5wVuMWQjl7YEYL2AI+R78E3S94k+jq504xbK LEkg== X-Gm-Message-State: AElRT7GWrMZEHlFh3sbGQjHo+C9mGxjKKy45H1/2c3p/KIFK4ehpbZde XJV/QK0eUGEq30554sxII/XZ4Hl/ X-Google-Smtp-Source: AIpwx4+XtnzwicDdBH73adU9vuM2SzfROjLhEsUirh7LT4LfAogfQUZdoUo6aL8CTpUzfeYcr9yBqg== X-Received: by 10.28.11.207 with SMTP id 198mr13460032wml.70.1523020975430; Fri, 06 Apr 2018 06:22:55 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i141sm9205795wmd.6.2018.04.06.06.22.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 06:22:54 -0700 (PDT) Date: Fri, 6 Apr 2018 15:22:41 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu 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 Content-Disposition: inline In-Reply-To: <20180406131243.19037-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v3 05/11] app/testpmd: fix flow completion for RSS queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 13:22:56 -0000 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