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 290D01C724 for ; Wed, 4 Apr 2018 16:58:10 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id u46so23208586wrc.11 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=cgb08LGb7/LzzktFkhTxSlG30zB6jMCveaWcmw8vV31nGDICYcKSyTTJ4acpuSr8c8 hMF2RRw8PQgdhNTO6sSGbVpFdLt1nP6Wm89IX+rEhY/+sn8wXwCoVBvUrFhFPZCKlLoA w4IAndFqcOOpKR9NKLywgvViQF0AoG1fCkOpm/OauxKI9rTlpMjdYK9TdyQN9n9NoVVX KMeavqQMMqhFcuXMADxHJh88m80BwTIkLKXV2a19EAoHkkImajYKMJmb+AH23gulKKTf 4caWKZS2o1b2rZZLgxzxki/eWUGn7wO1S/1f23pEf6zGIv7YuQqRJytjSXBG2ix1OVKG x+Pg== X-Gm-Message-State: AElRT7HQ389+LsfssO7P9rlx8J62XvMQKkM6Qpbzzu1C6zDJgq3o1jBF jDTIbp511u3ILLmruRcsVl6YTKR8 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-dev] [PATCH v2 06/13] 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: 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