From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58C7FA04B5; Thu, 29 Oct 2020 06:35:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E59C972D8; Thu, 29 Oct 2020 06:35:33 +0100 (CET) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 4030F6CC6; Thu, 29 Oct 2020 06:35:31 +0100 (CET) From: Bing Zhao To: orika@nvidia.com, wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 29 Oct 2020 13:35:25 +0800 Message-Id: <1603949725-95973-1-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] app/testpmd: fix the eCPRI command line style 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In the current implementation of eCPRI flow item parsing of the CLI, the token items in the list are not connected properly. A command containing "rtc_ctrl rtc_id spec 14857 rtc_id mask 0xff00" will be considered invalid. In order to support spec with mask, the common entry needs to be typed twice and the whole command will be too long. By changing the token lists, it could support spec with mask without backing from the entry of the item. Fixes: 17d103cc9365 ("app/testpmd: add eCPRI in flow creation patterns") Cc: stable@dpdk.org Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index cd35d5b..6b8fed7 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3204,7 +3204,9 @@ static int comp_set_sample_index(struct context *, const struct token *, [ITEM_ECPRI_MSG_IQ_DATA_PCID] = { .name = "pc_id", .help = "Physical Channel ID", - .next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param), + .next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_IQ_DATA_PCID, + ITEM_ECPRI_COMMON, ITEM_NEXT), + NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, hdr.type0.pc_id)), }, @@ -3218,7 +3220,9 @@ static int comp_set_sample_index(struct context *, const struct token *, [ITEM_ECPRI_MSG_RTC_CTRL_RTCID] = { .name = "rtc_id", .help = "Real-Time Control Data ID", - .next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param), + .next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_RTC_CTRL_RTCID, + ITEM_ECPRI_COMMON, ITEM_NEXT), + NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, hdr.type2.rtc_id)), }, @@ -3232,7 +3236,9 @@ static int comp_set_sample_index(struct context *, const struct token *, [ITEM_ECPRI_MSG_DLY_MSR_MSRID] = { .name = "msr_id", .help = "Measurement ID", - .next = NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), item_param), + .next = NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_DLY_MSR_MSRID, + ITEM_ECPRI_COMMON, ITEM_NEXT), + NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, hdr.type5.msr_id)), }, -- 1.8.3.1