From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id B66F32BB1 for ; Mon, 20 Nov 2017 09:22:12 +0100 (CET) Received: from pure.maildistiller.com (dispatch1.mdlocal [10.7.20.164]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id 48E8160F80; Mon, 20 Nov 2017 08:22:12 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us4.ppe-hosted.com (us4-filterqueue.mdlocal [10.7.20.246]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id B9CC81C0052; Mon, 20 Nov 2017 08:22:09 +0000 (UTC) Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 9D53580062; Mon, 20 Nov 2017 08:22:09 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 20 Nov 2017 00:22:07 -0800 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Mon, 20 Nov 2017 00:22:06 -0800 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id vAK8M5lW001730; Mon, 20 Nov 2017 08:22:05 GMT Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id vAK8M58x000778; Mon, 20 Nov 2017 08:22:05 GMT From: Andrew Rybchenko To: CC: Adrien Mazarguil , Jingjing Wu , Roman Zhukov Date: Mon, 20 Nov 2017 08:22:01 +0000 Message-ID: <1511166121-743-3-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1511166121-743-1-git-send-email-arybchenko@solarflare.com> References: <1511166121-743-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-MDID: 1511166129-lYDQExzOLiml Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: support GENEVE pattern item in flow rules 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: Mon, 20 Nov 2017 08:22:13 -0000 From: Roman Zhukov Add the ability to match a VNI field of GENEVE protocol header. Signed-off-by: Roman Zhukov Signed-off-by: Andrew Rybchenko --- app/test-pmd/cmdline_flow.c | 31 +++++++++++++++++++++++++++++ app/test-pmd/config.c | 1 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +++++ 3 files changed, 37 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index df16d2a..cee99f3 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -161,6 +161,9 @@ enum index { ITEM_SCTP_CKSUM, ITEM_VXLAN, ITEM_VXLAN_VNI, + ITEM_GENEVE, + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, ITEM_E_TAG, ITEM_E_TAG_GRP_ECID_B, ITEM_NVGRE, @@ -452,6 +455,7 @@ static const enum index next_item[] = { ITEM_TCP, ITEM_SCTP, ITEM_VXLAN, + ITEM_GENEVE, ITEM_E_TAG, ITEM_NVGRE, ITEM_MPLS, @@ -573,6 +577,13 @@ static const enum index item_vxlan[] = { ZERO, }; +static const enum index item_geneve[] = { + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, + ITEM_NEXT, + ZERO, +}; + static const enum index item_e_tag[] = { ITEM_E_TAG_GRP_ECID_B, ITEM_NEXT, @@ -1371,6 +1382,26 @@ static const struct token token_list[] = { .next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)), }, + [ITEM_GENEVE] = { + .name = "geneve", + .help = "match GENEVE header", + .priv = PRIV_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)), + .next = NEXT(item_geneve), + .call = parse_vc, + }, + [ITEM_GENEVE_VNI] = { + .name = "vni", + .help = "Virtual Network Identifier", + .next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve, vni)), + }, + [ITEM_GENEVE_PROTO] = { + .name = "protocol", + .help = "GENEVE protocol type", + .next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve, + protocol)), + }, [ITEM_E_TAG] = { .name = "e_tag", .help = "match E-Tag header", diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cd2ac11..4eda37f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -965,6 +965,7 @@ static const struct { MK_FLOW_ITEM(TCP, sizeof(struct rte_flow_item_tcp)), MK_FLOW_ITEM(SCTP, sizeof(struct rte_flow_item_sctp)), MK_FLOW_ITEM(VXLAN, sizeof(struct rte_flow_item_vxlan)), + MK_FLOW_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)), MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)), MK_FLOW_ITEM(NVGRE, sizeof(struct rte_flow_item_nvgre)), MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 9789139..8c2fd12 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3083,6 +3083,11 @@ This section lists supported pattern items and their attributes, if any. - ``vni {unsigned}``: VXLAN identifier. +- ``geneve``: match GENEVE header. + + - ``vni {unsigned}``: virtual network identifier. + - ``protocol {unsigned}``: protocol type. + - ``e_tag``: match IEEE 802.1BR E-Tag header. - ``grp_ecid_b {unsigned}``: GRP and E-CID base. -- 2.7.4