From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D00DE7D05 for ; Fri, 25 Aug 2017 09:51:17 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Aug 2017 00:51:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,424,1498546800"; d="scan'208";a="144422392" Received: from unknown (HELO dpdk9.sh.intel.com) ([10.67.119.137]) by fmsmga006.fm.intel.com with ESMTP; 25 Aug 2017 00:51:16 -0700 From: Beilei Xing To: jingjing.wu@intel.com Cc: dev@dpdk.org Date: Fri, 25 Aug 2017 15:50:26 +0800 Message-Id: <1503647430-93905-4-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> References: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH 3/7] app/testpmd: add GTP fields to flow command 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, 25 Aug 2017 07:51:18 -0000 This patch exposes the following item fields through the flow command: - GTP TEID Signed-off-by: Beilei Xing --- app/test-pmd/cmdline_flow.c | 22 ++++++++++++++++++++++ app/test-pmd/config.c | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index a17a004..4ab5bcc 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -171,6 +171,8 @@ enum index { ITEM_GRE_PROTO, ITEM_FUZZY, ITEM_FUZZY_THRESH, + ITEM_GTP, + ITEM_GTP_TEID, /* Validate/create actions. */ ACTIONS, @@ -451,6 +453,7 @@ static const enum index next_item[] = { ITEM_MPLS, ITEM_GRE, ITEM_FUZZY, + ITEM_GTP, ZERO, }; @@ -588,6 +591,12 @@ static const enum index item_gre[] = { ZERO, }; +static const enum index item_gtp[] = { + ITEM_GTP_TEID, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -1421,6 +1430,19 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct rte_flow_item_fuzzy, thresh)), }, + [ITEM_GTP] = { + .name = "gtp", + .help = "match GTP header", + .priv = PRIV_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), + .next = NEXT(item_gtp), + .call = parse_vc, + }, + [ITEM_GTP_TEID] = { + .name = "teid", + .help = "GTP TEID", + .next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp, teid)), + }, /* Validate/create actions. */ [ACTIONS] = { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1c..1f320a0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -947,6 +947,7 @@ static const struct { MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)), MK_FLOW_ITEM(FUZZY, sizeof(struct rte_flow_item_fuzzy)), + MK_FLOW_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), }; /** Compute storage space needed by item specification. */ diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 2ed62f5..6ec463e 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2696,6 +2696,10 @@ This section lists supported pattern items and their attributes, if any. - ``thresh {unsigned}``: accuracy threshold. +- ``gtp``: match GTP header. + + - ``teid {unsigned}``: GTP TEID. + Actions list ^^^^^^^^^^^^ -- 2.5.5