DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Wei Zhao <wei.zhao1@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH v3 13/14] ethdev: fix incomplete items in flow API
Date: Wed, 26 Apr 2017 14:07:21 +0200	[thread overview]
Message-ID: <fbf626e53d691fa787ac5bdbf1b530553e24b10f.1493208189.git.adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <cover.1493208189.git.adrien.mazarguil@6wind.com>

E-Tag and NVGRE pattern items have been added hastily without updating
documentation nor testpmd.

This commit also adds default masks for these items based on the ixgbe
implementation.

Fixes: 99e7003831c3 ("net/ixgbe: parse L2 tunnel filter")

Cc: stable@dpdk.org
Cc: Wei Zhao <wei.zhao1@intel.com>
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 app/test-pmd/cmdline_flow.c                 | 46 ++++++++++++++++++++++++
 doc/guides/prog_guide/rte_flow.rst          | 26 ++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 +++++
 lib/librte_ether/rte_flow.h                 | 21 +++++++++++
 4 files changed, 101 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4e99f0f..0a40005 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -159,6 +159,10 @@ enum index {
 	ITEM_SCTP_CKSUM,
 	ITEM_VXLAN,
 	ITEM_VXLAN_VNI,
+	ITEM_E_TAG,
+	ITEM_E_TAG_GRP_ECID_B,
+	ITEM_NVGRE,
+	ITEM_NVGRE_TNI,
 	ITEM_MPLS,
 	ITEM_MPLS_LABEL,
 	ITEM_GRE,
@@ -436,6 +440,8 @@ static const enum index next_item[] = {
 	ITEM_TCP,
 	ITEM_SCTP,
 	ITEM_VXLAN,
+	ITEM_E_TAG,
+	ITEM_NVGRE,
 	ITEM_MPLS,
 	ITEM_GRE,
 	ZERO,
@@ -544,6 +550,18 @@ static const enum index item_vxlan[] = {
 	ZERO,
 };
 
+static const enum index item_e_tag[] = {
+	ITEM_E_TAG_GRP_ECID_B,
+	ITEM_NEXT,
+	ZERO,
+};
+
+static const enum index item_nvgre[] = {
+	ITEM_NVGRE_TNI,
+	ITEM_NEXT,
+	ZERO,
+};
+
 static const enum index item_mpls[] = {
 	ITEM_MPLS_LABEL,
 	ITEM_NEXT,
@@ -1297,6 +1315,34 @@ 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_E_TAG] = {
+		.name = "e_tag",
+		.help = "match E-Tag header",
+		.priv = PRIV_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
+		.next = NEXT(item_e_tag),
+		.call = parse_vc,
+	},
+	[ITEM_E_TAG_GRP_ECID_B] = {
+		.name = "grp_ecid_b",
+		.help = "GRP and E-CID base",
+		.next = NEXT(item_e_tag, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_e_tag,
+						  rsvd_grp_ecid_b,
+						  "\x3f\xff")),
+	},
+	[ITEM_NVGRE] = {
+		.name = "nvgre",
+		.help = "match NVGRE header",
+		.priv = PRIV_ITEM(NVGRE, sizeof(struct rte_flow_item_nvgre)),
+		.next = NEXT(item_nvgre),
+		.call = parse_vc,
+	},
+	[ITEM_NVGRE_TNI] = {
+		.name = "tni",
+		.help = "virtual subnet ID",
+		.next = NEXT(item_nvgre, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_nvgre, tni)),
+	},
 	[ITEM_MPLS] = {
 		.name = "mpls",
 		.help = "match MPLS header",
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 9bca9ec..b587ba9 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -863,6 +863,32 @@ Matches a VXLAN header (RFC 7348).
 - ``rsvd1``: reserved, normally 0x00.
 - Default ``mask`` matches VNI only.
 
+Item: ``E_TAG``
+^^^^^^^^^^^^^^^
+
+Matches an IEEE 802.1BR E-Tag header.
+
+- ``tpid``: tag protocol identifier (0x893F)
+- ``epcp_edei_in_ecid_b``: E-Tag control information (E-TCI), E-PCP (3b),
+  E-DEI (1b), ingress E-CID base (12b).
+- ``rsvd_grp_ecid_b``: reserved (2b), GRP (2b), E-CID base (12b).
+- ``in_ecid_e``: ingress E-CID ext.
+- ``ecid_e``: E-CID ext.
+- Default ``mask`` simultaneously matches GRP and E-CID base.
+
+Item: ``NVGRE``
+^^^^^^^^^^^^^^^
+
+Matches a NVGRE header (RFC 7637).
+
+- ``c_k_s_rsvd0_ver``: checksum (1b), undefined (1b), key bit (1b),
+  sequence number (1b), reserved 0 (9b), version (3b). This field must have
+  value 0x2000 according to RFC 7637.
+- ``protocol``: protocol type (0x6558).
+- ``tni``: virtual subnet ID.
+- ``flow_id``: flow ID.
+- Default ``mask`` matches TNI only.
+
 Item: ``MPLS``
 ^^^^^^^^^^^^^^
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index ddd1d92..1aea101 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2537,6 +2537,14 @@ This section lists supported pattern items and their attributes, if any.
 
   - ``vni {unsigned}``: VXLAN identifier.
 
+- ``e_tag``: match IEEE 802.1BR E-Tag header.
+
+  - ``grp_ecid_b {unsigned}``: GRP and E-CID base.
+
+- ``nvgre``: match NVGRE header.
+
+  - ``tni {unsigned}``: virtual subnet ID.
+
 - ``mpls``: match MPLS header.
 
   - ``label {unsigned}``: MPLS label.
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index abd4c6a..c47edbc 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -49,6 +49,7 @@
 #include <rte_sctp.h>
 #include <rte_tcp.h>
 #include <rte_udp.h>
+#include <rte_byteorder.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -620,6 +621,19 @@ struct rte_flow_item_e_tag {
 	uint8_t ecid_e; /**< E-CID ext. */
 };
 
+/** Default mask for RTE_FLOW_ITEM_TYPE_E_TAG. */
+#ifndef __cplusplus
+static const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask = {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+	.rsvd_grp_ecid_b = 0x3fff,
+#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+	.rsvd_grp_ecid_b = 0xff3f,
+#else
+#error Unsupported endianness.
+#endif
+};
+#endif
+
 /**
  * RTE_FLOW_ITEM_TYPE_NVGRE.
  *
@@ -638,6 +652,13 @@ struct rte_flow_item_nvgre {
 	uint8_t flow_id; /**< Flow ID. */
 };
 
+/** Default mask for RTE_FLOW_ITEM_TYPE_NVGRE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask = {
+	.tni = "\xff\xff\xff",
+};
+#endif
+
 /**
  * RTE_FLOW_ITEM_TYPE_MPLS.
  *
-- 
2.1.4

  parent reply	other threads:[~2017-04-26 12:07 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 15:52 [dpdk-dev] [PATCH 00/13] Fixes for exported headers Adrien Mazarguil
2017-04-24 15:52 ` [dpdk-dev] [PATCH 01/13] crypto/scheduler: fix missing includes Adrien Mazarguil
2017-04-24 15:52 ` [dpdk-dev] [PATCH 02/13] eventdev: fix errors with strict compilation flags Adrien Mazarguil
2017-04-24 15:52 ` [dpdk-dev] [PATCH 03/13] latency: fix missing includes in exported header Adrien Mazarguil
2017-04-24 15:52 ` [dpdk-dev] [PATCH 04/13] net: fix missing include " Adrien Mazarguil
2017-04-24 15:52 ` [dpdk-dev] [PATCH 05/13] vhost: fix errors with strict compilation flags Adrien Mazarguil
2017-04-25  2:15   ` Yuanhan Liu
2017-04-26  7:32   ` Maxime Coquelin
2017-04-24 15:53 ` [dpdk-dev] [PATCH 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-dev] [PATCH 07/13] net/avp: fix errors in exported headers Adrien Mazarguil
2017-04-24 16:19   ` Legacy, Allain
2017-04-24 15:53 ` [dpdk-dev] [PATCH 08/13] bitrate: fix errors in exported header Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-dev] [PATCH 09/13] efd: fix missing include " Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-dev] [PATCH 10/13] metrics: fix errors " Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-dev] [PATCH 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-dev] [PATCH 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) Adrien Mazarguil
2017-04-25  1:18   ` Xing, Beilei
2017-04-24 15:53 ` [dpdk-dev] [PATCH 13/13] ethdev: fix incomplete items in flow API Adrien Mazarguil
2017-04-25  8:29 ` [dpdk-dev] [PATCH v2 00/13] Fixes for exported headers Adrien Mazarguil
2017-04-25  8:29   ` [dpdk-dev] [PATCH v2 01/13] crypto/scheduler: fix missing includes Adrien Mazarguil
2017-04-25 15:38     ` Zhang, Roy Fan
2017-04-25  8:29   ` [dpdk-dev] [PATCH v2 02/13] eventdev: fix errors with strict compilation flags Adrien Mazarguil
2017-04-25 15:31     ` De Lara Guarch, Pablo
2017-04-26  7:06       ` Adrien Mazarguil
2017-04-25  8:29   ` [dpdk-dev] [PATCH v2 03/13] latency: fix missing includes in exported header Adrien Mazarguil
2017-04-25  8:29   ` [dpdk-dev] [PATCH v2 04/13] net: fix missing include " Adrien Mazarguil
2017-04-25 16:13     ` Singh, Jasvinder
2017-04-25  8:29   ` [dpdk-dev] [PATCH v2 05/13] vhost: fix errors with strict compilation flags Adrien Mazarguil
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
2017-04-25  9:56     ` Olivier Matz
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 07/13] net/avp: fix errors in exported headers Adrien Mazarguil
2017-04-25 12:31     ` Legacy, Allain
2017-04-25 12:49       ` Adrien Mazarguil
2017-04-25 13:00         ` Legacy, Allain
2017-04-25 14:48           ` Adrien Mazarguil
2017-04-25 14:54             ` Legacy, Allain
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 08/13] bitrate: fix errors in exported header Adrien Mazarguil
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 09/13] efd: fix missing include " Adrien Mazarguil
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 10/13] metrics: fix errors " Adrien Mazarguil
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-25 11:35     ` [dpdk-dev] [dpdk-stable] " Shahaf Shuler
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) Adrien Mazarguil
2017-04-25 11:37     ` Shahaf Shuler
2017-04-25  8:30   ` [dpdk-dev] [PATCH v2 13/13] ethdev: fix incomplete items in flow API Adrien Mazarguil
2017-04-25 10:04   ` [dpdk-dev] [PATCH v2 00/13] Fixes for exported headers Ferruh Yigit
2017-04-26 12:07   ` [dpdk-dev] [PATCH v3 00/14] " Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 01/14] crypto/scheduler: fix missing includes Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 02/14] eventdev: fix errors with strict compilation flags Adrien Mazarguil
2017-04-26 14:47       ` Jerin Jacob
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 03/14] latency: fix missing includes in exported header Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 04/14] net: fix missing include " Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 05/14] vhost: fix errors with strict compilation flags Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 06/14] mbuf: fix missing includes in exported header Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 07/14] net/avp: fix errors in exported headers Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 08/14] bitrate: fix errors in exported header Adrien Mazarguil
2017-04-26 15:07       ` Remy Horton
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 09/14] efd: fix missing include " Adrien Mazarguil
2017-04-26 15:36       ` De Lara Guarch, Pablo
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 10/14] metrics: fix errors " Adrien Mazarguil
2017-04-26 15:07       ` Remy Horton
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 11/14] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 12/14] ethdev: fix C++ errors in flow API (MPLS, GRE) Adrien Mazarguil
2017-04-26 12:07     ` Adrien Mazarguil [this message]
2017-04-27  1:03       ` [dpdk-dev] [PATCH v3 13/14] ethdev: fix incomplete items in flow API Lu, Wenzhuo
2017-04-26 12:07     ` [dpdk-dev] [PATCH v3 14/14] eal: fix debug macro redefinition Adrien Mazarguil
2017-04-30 22:13     ` [dpdk-dev] [PATCH v3 00/14] Fixes for exported headers Thomas Monjalon

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=fbf626e53d691fa787ac5bdbf1b530553e24b10f.1493208189.git.adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@intel.com \
    --cc=wenzhuo.lu@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).