DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: support GENEVE pattern item in flow rules
Date: Fri, 1 Dec 2017 10:43:16 +0000	[thread overview]
Message-ID: <1512124996-13388-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1512124996-13388-1-git-send-email-arybchenko@solarflare.com>

From: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>

Add the ability to match VNI and protocol fields of GENEVE protocol header.

Signed-off-by: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 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
 ^^^^^^^^^^^^
 
-- 
2.7.4

      parent reply	other threads:[~2017-12-01 10:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20  8:21 [dpdk-dev] [PATCH 0/2] ethdev: add GENEVE to flow API Andrew Rybchenko
2017-11-20  8:22 ` [dpdk-dev] [PATCH 1/2] ethdev: add GENEVE flow pattern item Andrew Rybchenko
2017-11-23  9:39   ` Adrien Mazarguil
2017-11-20  8:22 ` [dpdk-dev] [PATCH 2/2] app/testpmd: support GENEVE pattern item in flow rules Andrew Rybchenko
2017-11-23  9:40   ` Adrien Mazarguil
2017-11-23  9:39 ` [dpdk-dev] [PATCH 0/2] ethdev: add GENEVE to flow API Adrien Mazarguil
2017-11-23 10:07   ` Andrew Rybchenko
2017-12-01 10:43 ` [dpdk-dev] [PATCH v2 " Andrew Rybchenko
2017-12-01 10:43   ` [dpdk-dev] [PATCH v2 1/2] ethdev: add GENEVE flow pattern item Andrew Rybchenko
2017-12-04 14:03     ` Adrien Mazarguil
2017-12-07 23:52       ` Ferruh Yigit
2017-12-08 10:52         ` Adrien Mazarguil
2017-12-08 19:06         ` Ferruh Yigit
2017-12-01 10:43   ` Andrew Rybchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512124996-13388-3-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Roman.Zhukov@oktetlabs.ru \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).