From mboxrd@z Thu Jan 1 00:00:00 1970 From: Declan Doherty Subject: [PATCH v4 5/6] testpmd: add support for MARK flow item Date: Wed, 18 Apr 2018 22:04:22 +0100 Message-ID: <20180418210423.13847-6-declan.doherty@intel.com> References: <1523017443-12414-1-git-send-email-declan.doherty@intel.com> <20180418210423.13847-1-declan.doherty@intel.com> Cc: Alex Rosenbaum , Ferruh Yigit , Thomas Monjalon , Shahaf Shuler , Qi Zhang , Alejandro Lucero , Andrew Rybchenko , Mohammad Abdul Awal , Remy Horton , John McNamara , Rony Efraim , Jingjing Wu , Wenzhuo Lu , Vincent Jardin , Yuanhan Liu , Bruce Richardson , Konstantin Ananyev , Zhihong Wang , Declan Doherty To: dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1DCB472FB for ; Wed, 18 Apr 2018 23:13:41 +0200 (CEST) In-Reply-To: <20180418210423.13847-1-declan.doherty@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add support for specificaiton of new MARK flow item in testpmd's cli, and update testpmd documentation to describe new MARK flow item support. Signed-off-by: Declan Doherty --- app/test-pmd/cmdline_flow.c | 22 ++++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 93e9a240d..e6284ce11 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -87,6 +87,8 @@ enum index { ITEM_VF_ID, ITEM_PORT, ITEM_PORT_INDEX, + ITEM_MARK, + ITEM_MARK_ID, ITEM_RAW, ITEM_RAW_RELATIVE, ITEM_RAW_SEARCH, @@ -419,6 +421,7 @@ static const enum index next_item[] = { ITEM_PF, ITEM_VF, ITEM_PORT, + ITEM_MARK, ITEM_RAW, ITEM_ETH, ITEM_VLAN, @@ -465,6 +468,12 @@ static const enum index item_port[] = { ZERO, }; +static const enum index item_mark[] = { + ITEM_MARK_ID, + ITEM_NEXT, + ZERO, +}; + static const enum index item_raw[] = { ITEM_RAW_RELATIVE, ITEM_RAW_SEARCH, @@ -1041,6 +1050,19 @@ static const struct token token_list[] = { .next = NEXT(item_port, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port, index)), }, + [ITEM_MARK] = { + .name = "mark", + .help = "match packets against value set in previous group", + .priv = PRIV_ITEM(MARK, sizeof(struct rte_flow_item_mark)), + .next = NEXT(item_mark), + .call = parse_vc, + }, + [ITEM_MARK_ID] = { + .name = "id", + .help = "Integer value to match against", + .next = NEXT(item_mark, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_mark, id)), + }, [ITEM_RAW] = { .name = "raw", .help = "match an arbitrary byte string", diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 7ecd602da..2b5ade4a8 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3211,6 +3211,10 @@ This section lists supported pattern items and their attributes, if any. - ``index {unsigned}``: physical port index. +- ``mark``: match value set in previously matched flow in higher priority group. + + - ``id {unsigned}``: arbitrary integer value. + - ``raw``: match an arbitrary byte string. - ``relative {boolean}``: look for pattern after the previous item. -- 2.14.3