From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 0CB535F2C for ; Fri, 23 Mar 2018 13:58:22 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id 139so3391807wmn.2 for ; Fri, 23 Mar 2018 05:58:22 -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=10UlmQi8qtBESbLoX5p7EbN1WxBzhlzEBz1wF5cw7uPFPyD17UYmo7YA4QbOP485x1 2j750ZKXGBBRKeD0mRpwRu0FLsmZV1OEwLH/Rvs6DCIG35d3wFgzRWepJwgBawoymIH+ BIqOfZqhglGS1f1xkUOVRWGvuIA8Oen8QKxpeAWkvhAMh0d4+++4ZRihev1SRNHopp2E REPCksAGrL27qK8J08JgmvE65YeMxFYRRWL8fwRXnkLGf97RKxPmJt/aPfdw7ijUSZZI ih4C2xuUXBdCBZaM4V8+D/IWpcLEHvSMoJId3z5CEREouLu8R9Ej+zo2ZqHHT+lNiSTu zyow== 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=qz13YG6cMxoIGY5mwRjjqfjKKBranJLzl92I8FcPVmLz/QaYQ7CmHZpJ+CPvqw1oFJ G5GtQLlbvS7KH/gGSBadKC+FK42Z1yw83ot3oXL4Nm0q1A5pdd7RDvu22ix0eb/TBful 3DJs4yXETOlYSm2FXiFlAE2rhvQVCdK+Mix0o3+G4ov4f8DKYD6CbEOsepWYpRp/easQ 9W57NbEroxy8LwYc9d8d5Ckcrsq8sqcspeB1bQtLcNCVvL3ov3TSRiW40+HJy97NDB1t mig7a2gVHZbOPN0C7TxMwITirsOBIM/uFQPVM3p2MZOMOLq6kP4pa1lHFTvXiVVWwtiA skyA== X-Gm-Message-State: AElRT7EMiiBHLdv9Ce2qs60FNeL+LwjFlfygSXBa/xEAUdCSHcLpxvq0 Nmcjbr8FkuOUizqxbH9Tzb/U5sVw X-Google-Smtp-Source: AG47ELtIQ4k6GfTXu12Ub3rTtCGA2a2+CzmGfhvV63rXgSpdUIMeOi4IUwyKW26ZmeTCo2twqRvHPw== X-Received: by 10.28.207.201 with SMTP id f192mr7803570wmg.148.1521809901688; Fri, 23 Mar 2018 05:58:21 -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 v53sm8724904wrc.45.2018.03.23.05.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 05:58:21 -0700 (PDT) Date: Fri, 23 Mar 2018 13:58:07 +0100 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Wenzhuo Lu , Jingjing Wu Message-ID: <20180323124725.15806-4-adrien.mazarguil@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323124725.15806-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v1 3/9] 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, 23 Mar 2018 12:58:23 -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