DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix the eCPRI command line style
@ 2020-10-29  5:35 Bing Zhao
  2020-10-30 12:29 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Bing Zhao @ 2020-10-29  5:35 UTC (permalink / raw)
  To: orika, wenzhuo.lu, beilei.xing, bernard.iremonger; +Cc: dev, stable

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 <bingz@nvidia.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix the eCPRI command line style
  2020-10-29  5:35 [dpdk-dev] [PATCH] app/testpmd: fix the eCPRI command line style Bing Zhao
@ 2020-10-30 12:29 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2020-10-30 12:29 UTC (permalink / raw)
  To: Bing Zhao, orika, wenzhuo.lu, beilei.xing, bernard.iremonger; +Cc: dev, stable

On 10/29/2020 5:35 AM, Bing Zhao wrote:
> 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 <bingz@nvidia.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-30 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29  5:35 [dpdk-dev] [PATCH] app/testpmd: fix the eCPRI command line style Bing Zhao
2020-10-30 12:29 ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git