From patchwork Fri Dec 1 10:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 31860 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B9A62C54; Fri, 1 Dec 2017 11:43:36 +0100 (CET) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 1D9082A62 for ; Fri, 1 Dec 2017 11:43:34 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine 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 DDCEE80005C; Fri, 1 Dec 2017 10:43:32 +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; Fri, 1 Dec 2017 02:43:30 -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; Fri, 1 Dec 2017 02:43:30 -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 vB1AhS5Q010260; Fri, 1 Dec 2017 10:43:28 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 vB1AhSAM013507; Fri, 1 Dec 2017 10:43:28 GMT From: Andrew Rybchenko To: CC: Adrien Mazarguil , Jingjing Wu , Roman Zhukov Date: Fri, 1 Dec 2017 10:43:16 +0000 Message-ID: <1512124996-13388-3-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1512124996-13388-1-git-send-email-arybchenko@solarflare.com> References: <1511166121-743-1-git-send-email-arybchenko@solarflare.com> <1512124996-13388-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 X-MDID: 1512125013-Q9XwExZX85s4 Subject: [dpdk-dev] [PATCH v2 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Roman Zhukov Add the ability to match VNI and protocol fields 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..561e057 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -175,6 +175,9 @@ enum index { ITEM_GTP_TEID, ITEM_GTPC, ITEM_GTPU, + ITEM_GENEVE, + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, /* Validate/create actions. */ ACTIONS, @@ -460,6 +463,7 @@ static const enum index next_item[] = { ITEM_GTP, ITEM_GTPC, ITEM_GTPU, + ITEM_GENEVE, ZERO, }; @@ -603,6 +607,13 @@ static const enum index item_gtp[] = { ZERO, }; +static const enum index item_geneve[] = { + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -1470,6 +1481,26 @@ static const struct token token_list[] = { .next = NEXT(item_gtp), .call = parse_vc, }, + [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)), + }, /* Validate/create actions. */ [ACTIONS] = { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cd2ac11..86ca3aa 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -973,6 +973,7 @@ static const struct { MK_FLOW_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), MK_FLOW_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)), MK_FLOW_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)), + MK_FLOW_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)), }; /** 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 9789139..2b00be8 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3107,6 +3107,11 @@ This section lists supported pattern items and their attributes, if any. - ``teid {unsigned}``: tunnel endpoint identifier. +- ``geneve``: match GENEVE header. + + - ``vni {unsigned}``: virtual network identifier. + - ``protocol {unsigned}``: protocol type. + Actions list ^^^^^^^^^^^^