From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 4F4C1D088 for ; Mon, 16 Apr 2018 18:22:10 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id s18so27685717wrg.9 for ; Mon, 16 Apr 2018 09:22:10 -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=JE3i2QC8Bkf8oGyUOEx8D1YyU+1MbiSAJJ3qWwO6Gps=; b=MrHZhnf8xdGvM7amXKvwa0N6b5c1/m+YQMDCcHxJXI2R6k0DJr5+uCN0xZHagDR4r3 2jmD2+GoHwHBxi3IjJFI6r38jTsWpoDhZVOOTNfmDTBG7Lalo8jLkWpk42ss9n3N2/Nx KUPevlauN5sq6hNXUtqQoAfLC7kMDuoEuD1+kPMKre+1hlreMEsm1mi1gF1hEs8TIoT0 m7ni1XR7P4Eb4mGZAjaRMrs5sIE53dQ+moda1FkFlVplz+rhV2rePuJJV41ceFhzx31q 42344sP1zbj6FYfRckN6B8zZHhElUc1DwQnJZX2m8DnmCwkua1vWVf/cK81jA1F60719 O7/g== 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=JE3i2QC8Bkf8oGyUOEx8D1YyU+1MbiSAJJ3qWwO6Gps=; b=X1W8IsuFaohmi/USOGps72EokjuuomLHPbpwXjKZngUtKtpFXWkHvJo+Y5RmKoGmJB FusY8PQniqzBHvBy6PT9YLH121C/VwZxLQU2SgYe9qtoF2dYJuElxiSv3hSCgUnQp+Bd cERHb48E5pWtO0laHehvMBs8EP3jRc3Y4ftQKPgc6eACTnozUIvRBI0R7psgSBlBtKG5 ZZQj8T+FN0Wq6WB+o6RHcdhzzC0WNlXkt3pq5qfn6B1sndAxKRzylWGcHghkBlHnLC/4 SWXHSOeNr4HPG9QABzw+xycD5lPEF7lsHMswZBQbqMOybKthI6YMRnyKj7K/XYRtaN88 lIxQ== X-Gm-Message-State: ALQs6tDk2t8UMJ76JzgIbIdTp62Jgk/Rngl8F06BTFcDcCLvZh9CX0d7 av3k0LKWCk9M+D/cFysOFI/NpPBT X-Google-Smtp-Source: AIpwx49q00c+UEqDacU7qa1qy2P/glk5urt1T3sStCK/w/p9ihrHO+oQ7BRT/FBwjNg4lmKhG+8umQ== X-Received: by 10.223.134.210 with SMTP id 18mr11668019wry.232.1523895730013; Mon, 16 Apr 2018 09:22:10 -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 y42sm16403776wry.97.2018.04.16.09.22.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 09:22:09 -0700 (PDT) Date: Mon, 16 Apr 2018 18:21:56 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180416150058.2620-6-adrien.mazarguil@6wind.com> References: <20180410161132.8776-1-adrien.mazarguil@6wind.com> <20180416150058.2620-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180416150058.2620-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v5 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: Mon, 16 Apr 2018 16:22:10 -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 59f3b3b57..4640f18f7 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