patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 06/13] mbuf: fix missing includes in exported header
       [not found] <cover.1493048352.git.adrien.mazarguil@6wind.com>
@ 2017-04-24 15:53 ` Adrien Mazarguil
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 09/13] efd: fix missing include " Adrien Mazarguil
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-24 15:53 UTC (permalink / raw)
  To: dev; +Cc: stable, Olivier Matz

This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.681.c:1:0:
 build/include/rte_mbuf_ptype.h:587:35: error: unknown type name 'uint32_t'
 [...]
 build/include/rte_mbuf_ptype.h:662:51: error: unknown type name 'size_t'
 [...]

Fixes: 288541c8ff9e ("mbuf: add functions to dump packet type")

Cc: stable@dpdk.org
Cc: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index ff6de9d..a3269c4 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -91,6 +91,9 @@
  * RTE_PTYPE_INNER_L4_UDP.
  */
 
+#include <stddef.h>
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH 09/13] efd: fix missing include in exported header
       [not found] <cover.1493048352.git.adrien.mazarguil@6wind.com>
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
@ 2017-04-24 15:53 ` Adrien Mazarguil
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-24 15:53 UTC (permalink / raw)
  To: dev; +Cc: stable, Byron Marohn, Pablo de Lara Guarch

This commit addresses the following compilation errors:

 In file included from /tmp/check-includes.sh.8373.c:1:0:
 build/include/rte_efd.h:133:9: error: unknown type name 'uint8_t'
 [...]

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")

Cc: stable@dpdk.org
Cc: Byron Marohn <byron.marohn@intel.com>
Cc: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_efd/rte_efd.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_efd/rte_efd.h b/lib/librte_efd/rte_efd.h
index 6d31e18..1596863 100644
--- a/lib/librte_efd/rte_efd.h
+++ b/lib/librte_efd/rte_efd.h
@@ -40,6 +40,8 @@
  * RTE EFD Table
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH 11/13] ethdev: fix C++ errors in flow API
       [not found] <cover.1493048352.git.adrien.mazarguil@6wind.com>
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 09/13] efd: fix missing include " Adrien Mazarguil
@ 2017-04-24 15:53 ` Adrien Mazarguil
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 13/13] ethdev: fix incomplete items " Adrien Mazarguil
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-24 15:53 UTC (permalink / raw)
  To: dev; +Cc: stable

This commit addresses the following compilation errors:

 In file included from build/include/rte_flow_driver.h:50:0,
                  from /tmp/check-includes.sh.1397.cc:1:
 build/include/rte_flow.h:428:2: error: expected primary-expression before
    '.' token
 [...]
 build/include/rte_flow.h:469:1: sorry, unimplemented: non-trivial
    designated initializers not supported
 [...]

C++ does not support the C99-style designated initializers used in this
file for the default item masks. While the resulting symbols are primarily
useful to PMDs (written in C), they are exposed as part of the public API
for documentation purposes and to assist application writers.

Considering that:

- using pre-C99 initialization style for compatibility with C++ would
  render them difficult to understand (all struct members must be
  initialized)
- using both initialization styles would be needlessly verbose
- not exposing them at all would defeat their purpose
- applications do not normally need these symbols at run time

This commit hides these symbols from C++ applications. Specific C++
initializers will be added later if necessary.

Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 7749491..bc7bc45 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -314,9 +314,11 @@ struct rte_flow_item_any {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ANY. */
+#ifndef __cplusplus
 static const struct rte_flow_item_any rte_flow_item_any_mask = {
 	.num = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VF
@@ -341,9 +343,11 @@ struct rte_flow_item_vf {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
 	.id = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_PORT
@@ -370,9 +374,11 @@ struct rte_flow_item_port {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */
+#ifndef __cplusplus
 static const struct rte_flow_item_port rte_flow_item_port_mask = {
 	.index = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_RAW
@@ -403,6 +409,7 @@ struct rte_flow_item_raw {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */
+#ifndef __cplusplus
 static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.relative = 1,
 	.search = 1,
@@ -411,6 +418,7 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.limit = 0xffff,
 	.length = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ETH
@@ -424,11 +432,13 @@ struct rte_flow_item_eth {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
+#ifndef __cplusplus
 static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
 	.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.type = 0x0000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VLAN
@@ -444,10 +454,12 @@ struct rte_flow_item_vlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
 	.tpid = 0x0000,
 	.tci = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV4
@@ -461,12 +473,14 @@ struct rte_flow_item_ipv4 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
 	.hdr = {
 		.src_addr = 0xffffffff,
 		.dst_addr = 0xffffffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV6.
@@ -480,6 +494,7 @@ struct rte_flow_item_ipv6 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 	.hdr = {
 		.src_addr =
@@ -490,6 +505,7 @@ static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 			"\xff\xff\xff\xff\xff\xff\xff\xff",
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ICMP.
@@ -501,12 +517,14 @@ struct rte_flow_item_icmp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
 	.hdr = {
 		.icmp_type = 0xff,
 		.icmp_code = 0xff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_UDP.
@@ -518,12 +536,14 @@ struct rte_flow_item_udp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_TCP.
@@ -535,12 +555,14 @@ struct rte_flow_item_tcp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_SCTP.
@@ -552,12 +574,14 @@ struct rte_flow_item_sctp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VXLAN.
@@ -572,9 +596,11 @@ struct rte_flow_item_vxlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
 	.vni = "\xff\xff\xff",
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_E_TAG.
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH 13/13] ethdev: fix incomplete items in flow API
       [not found] <cover.1493048352.git.adrien.mazarguil@6wind.com>
                   ` (2 preceding siblings ...)
  2017-04-24 15:53 ` [dpdk-stable] [PATCH 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
@ 2017-04-24 15:53 ` Adrien Mazarguil
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-24 15:53 UTC (permalink / raw)
  To: dev; +Cc: stable, Wei Zhao, Wenzhuo Lu

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 | 19 ++++++++++++++
 lib/librte_ether/rte_flow.h        | 21 +++++++++++++++
 3 files changed, 86 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4e99f0f..5514ee4 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_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_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_ECID_B] = {
+		.name = "ecid_b",
+		.help = "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..5dfd8a2 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -863,6 +863,25 @@ 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.
+
+Item: ``NVGRE``
+^^^^^^^^^^^^^^^
+
+Matches a NVGRE header (RFC 7637).
+
+- ``c_k_s_rsvd0_ver``
+
 Item: ``MPLS``
 ^^^^^^^^^^^^^^
 
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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v2 06/13] mbuf: fix missing includes in exported header
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
@ 2017-04-25  8:30   ` Adrien Mazarguil
  2017-04-25  9:56     ` Olivier Matz
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 09/13] efd: fix missing include " Adrien Mazarguil
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-25  8:30 UTC (permalink / raw)
  To: dev; +Cc: stable, Olivier Matz

This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.681.c:1:0:
 build/include/rte_mbuf_ptype.h:587:35: error: unknown type name 'uint32_t'
 [...]
 build/include/rte_mbuf_ptype.h:662:51: error: unknown type name 'size_t'
 [...]

Fixes: 288541c8ff9e ("mbuf: add functions to dump packet type")

Cc: stable@dpdk.org
Cc: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index ff6de9d..a3269c4 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -91,6 +91,9 @@
  * RTE_PTYPE_INNER_L4_UDP.
  */
 
+#include <stddef.h>
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v2 09/13] efd: fix missing include in exported header
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
@ 2017-04-25  8:30   ` Adrien Mazarguil
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-25  8:30 UTC (permalink / raw)
  To: dev; +Cc: stable, Byron Marohn, Pablo de Lara Guarch

This commit addresses the following compilation errors:

 In file included from /tmp/check-includes.sh.8373.c:1:0:
 build/include/rte_efd.h:133:9: error: unknown type name 'uint8_t'
 [...]

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")

Cc: stable@dpdk.org
Cc: Byron Marohn <byron.marohn@intel.com>
Cc: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_efd/rte_efd.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_efd/rte_efd.h b/lib/librte_efd/rte_efd.h
index 6d31e18..1596863 100644
--- a/lib/librte_efd/rte_efd.h
+++ b/lib/librte_efd/rte_efd.h
@@ -40,6 +40,8 @@
  * RTE EFD Table
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 09/13] efd: fix missing include " Adrien Mazarguil
@ 2017-04-25  8:30   ` Adrien Mazarguil
  2017-04-25 11:35     ` Shahaf Shuler
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 13/13] ethdev: fix incomplete items " Adrien Mazarguil
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
  4 siblings, 1 reply; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-25  8:30 UTC (permalink / raw)
  To: dev; +Cc: stable

This commit addresses the following compilation errors:

 In file included from build/include/rte_flow_driver.h:50:0,
                  from /tmp/check-includes.sh.1397.cc:1:
 build/include/rte_flow.h:428:2: error: expected primary-expression before
    '.' token
 [...]
 build/include/rte_flow.h:469:1: sorry, unimplemented: non-trivial
    designated initializers not supported
 [...]

C++ does not support the C99-style designated initializers used in this
file for the default item masks. While the resulting symbols are primarily
useful to PMDs (written in C), they are exposed as part of the public API
for documentation purposes and to assist application writers.

Considering that:

- using pre-C99 initialization style for compatibility with C++ would
  render them difficult to understand (all struct members must be
  initialized)
- using both initialization styles would be needlessly verbose
- not exposing them at all would defeat their purpose
- applications do not normally need these symbols at run time

This commit hides these symbols from C++ applications. Specific C++
initializers will be added later if necessary.

Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 7749491..bc7bc45 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -314,9 +314,11 @@ struct rte_flow_item_any {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ANY. */
+#ifndef __cplusplus
 static const struct rte_flow_item_any rte_flow_item_any_mask = {
 	.num = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VF
@@ -341,9 +343,11 @@ struct rte_flow_item_vf {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
 	.id = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_PORT
@@ -370,9 +374,11 @@ struct rte_flow_item_port {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */
+#ifndef __cplusplus
 static const struct rte_flow_item_port rte_flow_item_port_mask = {
 	.index = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_RAW
@@ -403,6 +409,7 @@ struct rte_flow_item_raw {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */
+#ifndef __cplusplus
 static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.relative = 1,
 	.search = 1,
@@ -411,6 +418,7 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.limit = 0xffff,
 	.length = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ETH
@@ -424,11 +432,13 @@ struct rte_flow_item_eth {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
+#ifndef __cplusplus
 static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
 	.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.type = 0x0000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VLAN
@@ -444,10 +454,12 @@ struct rte_flow_item_vlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
 	.tpid = 0x0000,
 	.tci = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV4
@@ -461,12 +473,14 @@ struct rte_flow_item_ipv4 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
 	.hdr = {
 		.src_addr = 0xffffffff,
 		.dst_addr = 0xffffffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV6.
@@ -480,6 +494,7 @@ struct rte_flow_item_ipv6 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 	.hdr = {
 		.src_addr =
@@ -490,6 +505,7 @@ static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 			"\xff\xff\xff\xff\xff\xff\xff\xff",
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ICMP.
@@ -501,12 +517,14 @@ struct rte_flow_item_icmp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
 	.hdr = {
 		.icmp_type = 0xff,
 		.icmp_code = 0xff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_UDP.
@@ -518,12 +536,14 @@ struct rte_flow_item_udp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_TCP.
@@ -535,12 +555,14 @@ struct rte_flow_item_tcp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_SCTP.
@@ -552,12 +574,14 @@ struct rte_flow_item_sctp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VXLAN.
@@ -572,9 +596,11 @@ struct rte_flow_item_vxlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
 	.vni = "\xff\xff\xff",
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_E_TAG.
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v2 13/13] ethdev: fix incomplete items in flow API
       [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
                     ` (2 preceding siblings ...)
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
@ 2017-04-25  8:30   ` Adrien Mazarguil
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-25  8:30 UTC (permalink / raw)
  To: dev; +Cc: stable, Wei Zhao, Wenzhuo Lu

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-stable] [PATCH v2 06/13] mbuf: fix missing includes in exported header
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
@ 2017-04-25  9:56     ` Olivier Matz
  0 siblings, 0 replies; 17+ messages in thread
From: Olivier Matz @ 2017-04-25  9:56 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: dev, stable

On Tue, 25 Apr 2017 10:30:00 +0200, Adrien Mazarguil <adrien.mazarguil@6wind.com> wrote:
> This commit addresses the following errors:
> 
>  In file included from /tmp/check-includes.sh.681.c:1:0:
>  build/include/rte_mbuf_ptype.h:587:35: error: unknown type name 'uint32_t'
>  [...]
>  build/include/rte_mbuf_ptype.h:662:51: error: unknown type name 'size_t'
>  [...]
> 
> Fixes: 288541c8ff9e ("mbuf: add functions to dump packet type")
> 
> Cc: stable@dpdk.org
> Cc: Olivier Matz <olivier.matz@6wind.com>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API
  2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
@ 2017-04-25 11:35     ` Shahaf Shuler
  0 siblings, 0 replies; 17+ messages in thread
From: Shahaf Shuler @ 2017-04-25 11:35 UTC (permalink / raw)
  To: Adrien Mazarguil, dev; +Cc: stable

Tuesday, April 25, 2017 11:30 AM, Adrien Mazarguil:
> This commit addresses the following compilation errors:
> 
>  In file included from build/include/rte_flow_driver.h:50:0,
>                   from /tmp/check-includes.sh.1397.cc:1:
>  build/include/rte_flow.h:428:2: error: expected primary-expression before
>     '.' token
>  [...]
>  build/include/rte_flow.h:469:1: sorry, unimplemented: non-trivial
>     designated initializers not supported  [...]
> 
> C++ does not support the C99-style designated initializers used in this
> file for the default item masks. While the resulting symbols are primarily
> useful to PMDs (written in C), they are exposed as part of the public API for
> documentation purposes and to assist application writers.
> 
> Considering that:
> 
> - using pre-C99 initialization style for compatibility with C++ would
>   render them difficult to understand (all struct members must be
>   initialized)
> - using both initialization styles would be needlessly verbose
> - not exposing them at all would defeat their purpose
> - applications do not normally need these symbols at run time
> 
> This commit hides these symbols from C++ applications. Specific C++
> initializers will be added later if necessary.
> 
> Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")
> 
> Cc: stable@dpdk.org
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

> ---
>  lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index
> 7749491..bc7bc45 100644
> --- a/lib/librte_ether/rte_flow.h
> +++ b/lib/librte_ether/rte_flow.h
> @@ -314,9 +314,11 @@ struct rte_flow_item_any {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_ANY. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_any rte_flow_item_any_mask = {
>  	.num = 0x00000000,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_VF
> @@ -341,9 +343,11 @@ struct rte_flow_item_vf {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
>  	.id = 0x00000000,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_PORT
> @@ -370,9 +374,11 @@ struct rte_flow_item_port {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_port rte_flow_item_port_mask = {
>  	.index = 0x00000000,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_RAW
> @@ -403,6 +409,7 @@ struct rte_flow_item_raw {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
>  	.relative = 1,
>  	.search = 1,
> @@ -411,6 +418,7 @@ static const struct rte_flow_item_raw
> rte_flow_item_raw_mask = {
>  	.limit = 0xffff,
>  	.length = 0xffff,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_ETH
> @@ -424,11 +432,13 @@ struct rte_flow_item_eth {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
>  	.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
>  	.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
>  	.type = 0x0000,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_VLAN
> @@ -444,10 +454,12 @@ struct rte_flow_item_vlan {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
>  	.tpid = 0x0000,
>  	.tci = 0xffff,
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_IPV4
> @@ -461,12 +473,14 @@ struct rte_flow_item_ipv4 {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
>  	.hdr = {
>  		.src_addr = 0xffffffff,
>  		.dst_addr = 0xffffffff,
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_IPV6.
> @@ -480,6 +494,7 @@ struct rte_flow_item_ipv6 {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
>  	.hdr = {
>  		.src_addr =
> @@ -490,6 +505,7 @@ static const struct rte_flow_item_ipv6
> rte_flow_item_ipv6_mask = {
>  			"\xff\xff\xff\xff\xff\xff\xff\xff",
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_ICMP.
> @@ -501,12 +517,14 @@ struct rte_flow_item_icmp {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
>  	.hdr = {
>  		.icmp_type = 0xff,
>  		.icmp_code = 0xff,
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_UDP.
> @@ -518,12 +536,14 @@ struct rte_flow_item_udp {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
>  	.hdr = {
>  		.src_port = 0xffff,
>  		.dst_port = 0xffff,
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_TCP.
> @@ -535,12 +555,14 @@ struct rte_flow_item_tcp {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
>  	.hdr = {
>  		.src_port = 0xffff,
>  		.dst_port = 0xffff,
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_SCTP.
> @@ -552,12 +574,14 @@ struct rte_flow_item_sctp {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
>  	.hdr = {
>  		.src_port = 0xffff,
>  		.dst_port = 0xffff,
>  	},
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_VXLAN.
> @@ -572,9 +596,11 @@ struct rte_flow_item_vxlan {  };
> 
>  /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */
> +#ifndef __cplusplus
>  static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
>  	.vni = "\xff\xff\xff",
>  };
> +#endif
> 
>  /**
>   * RTE_FLOW_ITEM_TYPE_E_TAG.
> --
> 2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v3 06/14] mbuf: fix missing includes in exported header
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
@ 2017-04-26 12:07     ` Adrien Mazarguil
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 09/14] efd: fix missing include " Adrien Mazarguil
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-26 12:07 UTC (permalink / raw)
  To: dev; +Cc: stable

This commit addresses the following errors:

 In file included from /tmp/check-includes.sh.681.c:1:0:
 build/include/rte_mbuf_ptype.h:587:35: error: unknown type name 'uint32_t'
 [...]
 build/include/rte_mbuf_ptype.h:662:51: error: unknown type name 'size_t'
 [...]

Fixes: 288541c8ff9e ("mbuf: add functions to dump packet type")

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index ff6de9d..a3269c4 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -91,6 +91,9 @@
  * RTE_PTYPE_INNER_L4_UDP.
  */
 
+#include <stddef.h>
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v3 09/14] efd: fix missing include in exported header
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 06/14] mbuf: fix missing includes in exported header Adrien Mazarguil
@ 2017-04-26 12:07     ` Adrien Mazarguil
  2017-04-26 15:36       ` De Lara Guarch, Pablo
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 11/14] ethdev: fix C++ errors in flow API Adrien Mazarguil
                       ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-26 12:07 UTC (permalink / raw)
  To: dev; +Cc: stable, Byron Marohn, Pablo de Lara Guarch

This commit addresses the following compilation errors:

 In file included from /tmp/check-includes.sh.8373.c:1:0:
 build/include/rte_efd.h:133:9: error: unknown type name 'uint8_t'
 [...]

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")

Cc: stable@dpdk.org
Cc: Byron Marohn <byron.marohn@intel.com>
Cc: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_efd/rte_efd.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_efd/rte_efd.h b/lib/librte_efd/rte_efd.h
index 6d31e18..1596863 100644
--- a/lib/librte_efd/rte_efd.h
+++ b/lib/librte_efd/rte_efd.h
@@ -40,6 +40,8 @@
  * RTE EFD Table
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v3 11/14] ethdev: fix C++ errors in flow API
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 06/14] mbuf: fix missing includes in exported header Adrien Mazarguil
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 09/14] efd: fix missing include " Adrien Mazarguil
@ 2017-04-26 12:07     ` Adrien Mazarguil
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items " Adrien Mazarguil
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 14/14] eal: fix debug macro redefinition Adrien Mazarguil
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-26 12:07 UTC (permalink / raw)
  To: dev; +Cc: stable

This commit addresses the following compilation errors:

 In file included from build/include/rte_flow_driver.h:50:0,
                  from /tmp/check-includes.sh.1397.cc:1:
 build/include/rte_flow.h:428:2: error: expected primary-expression before
    '.' token
 [...]
 build/include/rte_flow.h:469:1: sorry, unimplemented: non-trivial
    designated initializers not supported
 [...]

C++ does not support the C99-style designated initializers used in this
file for the default item masks. While the resulting symbols are primarily
useful to PMDs (written in C), they are exposed as part of the public API
for documentation purposes and to assist application writers.

Considering that:

- using pre-C99 initialization style for compatibility with C++ would
  render them difficult to understand (all struct members must be
  initialized)
- using both initialization styles would be needlessly verbose
- not exposing them at all would defeat their purpose
- applications do not normally need these symbols at run time

This commit hides these symbols from C++ applications. Specific C++
initializers will be added later if necessary.

Fixes: 6de5c0f1302c ("ethdev: define default item masks in flow API")

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
---
 lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 7749491..bc7bc45 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -314,9 +314,11 @@ struct rte_flow_item_any {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ANY. */
+#ifndef __cplusplus
 static const struct rte_flow_item_any rte_flow_item_any_mask = {
 	.num = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VF
@@ -341,9 +343,11 @@ struct rte_flow_item_vf {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
 	.id = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_PORT
@@ -370,9 +374,11 @@ struct rte_flow_item_port {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */
+#ifndef __cplusplus
 static const struct rte_flow_item_port rte_flow_item_port_mask = {
 	.index = 0x00000000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_RAW
@@ -403,6 +409,7 @@ struct rte_flow_item_raw {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */
+#ifndef __cplusplus
 static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.relative = 1,
 	.search = 1,
@@ -411,6 +418,7 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
 	.limit = 0xffff,
 	.length = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ETH
@@ -424,11 +432,13 @@ struct rte_flow_item_eth {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
+#ifndef __cplusplus
 static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
 	.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
 	.type = 0x0000,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VLAN
@@ -444,10 +454,12 @@ struct rte_flow_item_vlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
 	.tpid = 0x0000,
 	.tci = 0xffff,
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV4
@@ -461,12 +473,14 @@ struct rte_flow_item_ipv4 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
 	.hdr = {
 		.src_addr = 0xffffffff,
 		.dst_addr = 0xffffffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_IPV6.
@@ -480,6 +494,7 @@ struct rte_flow_item_ipv6 {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
+#ifndef __cplusplus
 static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 	.hdr = {
 		.src_addr =
@@ -490,6 +505,7 @@ static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
 			"\xff\xff\xff\xff\xff\xff\xff\xff",
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_ICMP.
@@ -501,12 +517,14 @@ struct rte_flow_item_icmp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
 	.hdr = {
 		.icmp_type = 0xff,
 		.icmp_code = 0xff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_UDP.
@@ -518,12 +536,14 @@ struct rte_flow_item_udp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_TCP.
@@ -535,12 +555,14 @@ struct rte_flow_item_tcp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_SCTP.
@@ -552,12 +574,14 @@ struct rte_flow_item_sctp {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
+#ifndef __cplusplus
 static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
 	.hdr = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	},
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_VXLAN.
@@ -572,9 +596,11 @@ struct rte_flow_item_vxlan {
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */
+#ifndef __cplusplus
 static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
 	.vni = "\xff\xff\xff",
 };
+#endif
 
 /**
  * RTE_FLOW_ITEM_TYPE_E_TAG.
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items in flow API
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
                       ` (2 preceding siblings ...)
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 11/14] ethdev: fix C++ errors in flow API Adrien Mazarguil
@ 2017-04-26 12:07     ` Adrien Mazarguil
  2017-04-27  1:03       ` Lu, Wenzhuo
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 14/14] eal: fix debug macro redefinition Adrien Mazarguil
  4 siblings, 1 reply; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-26 12:07 UTC (permalink / raw)
  To: dev; +Cc: stable, Wei Zhao, Wenzhuo Lu

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-stable] [PATCH v3 14/14] eal: fix debug macro redefinition
       [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
                       ` (3 preceding siblings ...)
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items " Adrien Mazarguil
@ 2017-04-26 12:07     ` Adrien Mazarguil
  4 siblings, 0 replies; 17+ messages in thread
From: Adrien Mazarguil @ 2017-04-26 12:07 UTC (permalink / raw)
  To: dev; +Cc: stable, Thomas Monjalon, Declan Doherty, Jerin Jacob

The RTE_FUNC_*_RET() and RTE_PROC_*_RET() macro definitions in rte_dev.h
require RTE_PMD_DEBUG_TRACE(). This macro is defined as needed by users of
rte_dev.h since its value depends on their own debug settings.

It may be defined multiple times as a result when including files from
various components simultaneously. Worse, these redefinitions may be
inconsistent. This causes the following compilation errors:

 In file included from /tmp/check-includes.sh.13890.c:27:0:
    build/include/rte_eventdev_pmd.h:58:0: error: "RTE_PMD_DEBUG_TRACE"
    redefined [-Werror]
 [...]
 In file included from build/include/rte_ethdev_pci.h:39:0,
                  from /tmp/check-includes.sh.13890.c:13:
    build/include/rte_ethdev.h:1042:0: note: this is the location of the
    previous definition
 [...]
 In file included from /tmp/check-includes.sh.13890.c:83:0:
    build/include/rte_cryptodev_pmd.h:65:0: error: "RTE_PMD_DEBUG_TRACE"
    redefined [-Werror]
 [...]
 In file included from /tmp/check-includes.sh.13890.c:27:0:
    build/include/rte_eventdev_pmd.h:58:0: note: this is the location of
    the previous definition
 [...]

This commit moves the RTE_PMD_DEBUG_TRACE() definition to rte_dev.h where
it is enabled consistently depending on global configuration settings and
removes redundant definitions.

Also when disabled, RTE_PMD_DEBUG_TRACE() is now defined as (void)0 to
avoid empty statements warnings if used outside { } blocks.

Fixes: b974e4a40cb5 ("ethdev: make error checking macros public")

Cc: stable@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: Declan Doherty <declan.doherty@intel.com>
Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_cryptodev/rte_cryptodev_pmd.h |  8 --------
 lib/librte_eal/common/include/rte_dev.h  | 14 ++++++++++++++
 lib/librte_ether/rte_ethdev.h            |  9 ---------
 lib/librte_eventdev/rte_eventdev_pmd.h   |  7 -------
 4 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h
index 356b9dc..17ef37c 100644
--- a/lib/librte_cryptodev/rte_cryptodev_pmd.h
+++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h
@@ -57,14 +57,6 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_cryptodev.h"
 
-
-#ifdef RTE_LIBRTE_CRYPTODEV_DEBUG
-#define RTE_PMD_DEBUG_TRACE(...) \
-	rte_pmd_debug_trace(__func__, __VA_ARGS__)
-#else
-#define RTE_PMD_DEBUG_TRACE(...)
-#endif
-
 struct rte_cryptodev_session {
 	RTE_STD_C11
 	struct {
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 67c2b0c..d18e6b8 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_config.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -70,6 +71,19 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
 	rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s", func_name, buffer);
 }
 
+/*
+ * Enable RTE_PMD_DEBUG_TRACE() when at least one component relying on the
+ * RTE_*_RET() macros defined below is compiled in debug mode.
+ */
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || \
+	defined(RTE_LIBRTE_CRYPTODEV_DEBUG) || \
+	defined(RTE_LIBRTE_EVENTDEV_DEBUG)
+#define RTE_PMD_DEBUG_TRACE(...) \
+	rte_pmd_debug_trace(__func__, __VA_ARGS__)
+#else
+#define RTE_PMD_DEBUG_TRACE(...) (void)0
+#endif
+
 /* Macros for checking for restricting functions to primary instance only */
 #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e0f7ee5..5f1d663 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1034,15 +1034,6 @@ struct rte_eth_dev_callback;
 /** @internal Structure to keep track of registered callbacks */
 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
 
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
-#define RTE_PMD_DEBUG_TRACE(...) \
-	rte_pmd_debug_trace(__func__, __VA_ARGS__)
-#else
-#define RTE_PMD_DEBUG_TRACE(...)
-#endif
-
-
 /* Macros to check for valid port */
 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
 	if (!rte_eth_dev_is_valid_port(port_id)) { \
diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
index 988018f..4005b3c 100644
--- a/lib/librte_eventdev/rte_eventdev_pmd.h
+++ b/lib/librte_eventdev/rte_eventdev_pmd.h
@@ -54,13 +54,6 @@ extern "C" {
 
 #include "rte_eventdev.h"
 
-#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
-#define RTE_PMD_DEBUG_TRACE(...) \
-	rte_pmd_debug_trace(__func__, __VA_ARGS__)
-#else
-#define RTE_PMD_DEBUG_TRACE(...)
-#endif
-
 /* Logging Macros */
 #define RTE_EDEV_LOG_ERR(...) \
 	RTE_LOG(ERR, EVENTDEV, \
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-stable] [PATCH v3 09/14] efd: fix missing include in exported header
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 09/14] efd: fix missing include " Adrien Mazarguil
@ 2017-04-26 15:36       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2017-04-26 15:36 UTC (permalink / raw)
  To: Adrien Mazarguil, dev; +Cc: stable, Marohn, Byron



> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Wednesday, April 26, 2017 1:07 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Marohn, Byron; De Lara Guarch, Pablo
> Subject: [PATCH v3 09/14] efd: fix missing include in exported header
> 
> This commit addresses the following compilation errors:
> 
>  In file included from /tmp/check-includes.sh.8373.c:1:0:
>  build/include/rte_efd.h:133:9: error: unknown type name 'uint8_t'
>  [...]
> 
> Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
> 
> Cc: stable@dpdk.org
> Cc: Byron Marohn <byron.marohn@intel.com>
> Cc: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items in flow API
  2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items " Adrien Mazarguil
@ 2017-04-27  1:03       ` Lu, Wenzhuo
  0 siblings, 0 replies; 17+ messages in thread
From: Lu, Wenzhuo @ 2017-04-27  1:03 UTC (permalink / raw)
  To: Adrien Mazarguil, dev; +Cc: stable, Zhao1, Wei

Hi,

> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Wednesday, April 26, 2017 8:07 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhao1, Wei; Lu, Wenzhuo
> Subject: [PATCH v3 13/14] ethdev: fix incomplete items in flow API
> 
> 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>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Thanks for this patch :)

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-04-27  1:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1493048352.git.adrien.mazarguil@6wind.com>
2017-04-24 15:53 ` [dpdk-stable] [PATCH 06/13] mbuf: fix missing includes in exported header Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-stable] [PATCH 09/13] efd: fix missing include " Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-stable] [PATCH 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-24 15:53 ` [dpdk-stable] [PATCH 13/13] ethdev: fix incomplete items " Adrien Mazarguil
     [not found] ` <cover.1493108423.git.adrien.mazarguil@6wind.com>
2017-04-25  8:30   ` [dpdk-stable] [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-stable] [PATCH v2 09/13] efd: fix missing include " Adrien Mazarguil
2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-25 11:35     ` Shahaf Shuler
2017-04-25  8:30   ` [dpdk-stable] [PATCH v2 13/13] ethdev: fix incomplete items " Adrien Mazarguil
     [not found]   ` <cover.1493208189.git.adrien.mazarguil@6wind.com>
2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 06/14] mbuf: fix missing includes in exported header Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-stable] [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-stable] [PATCH v3 11/14] ethdev: fix C++ errors in flow API Adrien Mazarguil
2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 13/14] ethdev: fix incomplete items " Adrien Mazarguil
2017-04-27  1:03       ` Lu, Wenzhuo
2017-04-26 12:07     ` [dpdk-stable] [PATCH v3 14/14] eal: fix debug macro redefinition Adrien Mazarguil

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).