From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 11EA21C714 for ; Wed, 4 Apr 2018 16:58:10 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id n2so19866735wrj.7 for ; Wed, 04 Apr 2018 07:58: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=8W76KGOBWe8spOSweraVtm8sWiN9hW8+NZqeLvkuTPE=; b=ybwXrAu1DPwKDP+5eCrh3cm/T2tf4Gnmfo0AQvOqbJbv17zMMzm+Q950ijHfq9AXXG MHAEG1Y6R7sKVER0wLKOTNLYzHkQ9yq3HcczycXnSFW1Hr7qDO9rs7CgTCSN2MBT8NFO /36HlrJUiEW6o1LluK70wwRRzGzvb1rTcE5yxr03R/xip5Z766OhUr/qV8mxjw4Ay+tZ 9ZZk2OB9MOJ9Myufs9yS05D/SURH+ICjU/M+4apTAO9YUWu/2fFHQgJAv33HaalnHz6j H/zVxyZDiSwBXLpEMkQd7DqWcJCRvxBTnc5mDuyVT2dnQpeQ+rpeYftTpducNYsSR2Hh cCpQ== 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=XocxKks9HEejhM72fYJ1/Udw0MkivrFbdA4MF/pnJRwXp1br4WAYHHm66JTRi7MgAW XtyqT592nKA7bWm712eOta/oVqP+fEVVOVac0eK3+0RdRdwk9iWxG+XHD4M04NdkoX8o XkywzRcaMB2p8RPR2cwbKUEdUWOp/ZatOMr5LzPAnkWYJYt+LaPXi45xQa1hevVeU8dv nLrmzbPMTw2IV9bR927893Eb1bkAs0iPg1RgrhVudn5js+iAtKs7gcOdspXp76nd3q1M kgMLUDGvM87jrE/PfuAeLKNzaktOeRdIey/UH+qrOIkrrVtHDi6uFf0izabahMSy2P0y IRPQ== X-Gm-Message-State: AElRT7GbEKYA8BVdA/JosndEALrPTD2st4HufA1n4G47vgEkERnN43Tz rmnzHlOvDo+muBKUm+Rxuq8uwvDb X-Google-Smtp-Source: AIpwx4/6hY72dLZoU12WmIWM0oI9sjnEsiKTkvRWgA+xsQ1h6tXZ6UfJ7T50Jcb8KWfMr1B7Af/A3Q== X-Received: by 10.223.129.17 with SMTP id 17mr14060721wrm.109.1522853889869; Wed, 04 Apr 2018 07:58:09 -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 p137sm5060326wmd.41.2018.04.04.07.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 07:58:09 -0700 (PDT) Date: Wed, 4 Apr 2018 16:57:56 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180404144805.11966-7-adrien.mazarguil@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> <20180404144805.11966-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404144805.11966-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-stable] [PATCH v2 06/13] app/testpmd: fix flow completion for RSS queues X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 14:58: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 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