* [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading
@ 2018-02-26 15:09 Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (17 more replies)
0 siblings, 18 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
This patchset supports MLX5 RX offloading(checksum, inner rss, inner ptype)
for VXLAN(starndard L2/nonstandard L3), GRE and VXLAN-GPE based on rte flow.
V0 patchset was based on follwoing patchset:
http://www.dpdk.org/dev/patchwork/patch/35005/
http://www.dpdk.org/dev/patchwork/patch/31757/
Next version will be based on Adrien's new flow action api:
http://www.dpdk.org/dev/patchwork/patch/35178/
Shahaf Shuler (1):
net/mlx5: fix tunnel offloads cap query
Xueming Li (17):
ethdev: support tunnel RSS level
app/testpmd: support flow RSS level parsing
ethdev: introduce new tunnel VXLAN-GPE
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
net/mlx5: support GRE tunnel flow
net/mlx5: support L3 vxlan
net/mlx5: support tunnel inner csum offloads
net/mlx5: support packet tunnel type
net/mlx5: split flow RSS handling logic
net/mlx5: support tunnel RSS level
net/mlx5: support 16 hardware priorities
net/mlx5: add hardware flow debug dump
net/mlx5: fix control flow create failure
net/mlx5: introduce new tunnel VXLAN-GPE
net/mlx5: allow flow tunnel ID 0 with outer pattern
doc: update mlx5 guide on tunnel offloading
app/test-pmd/cmdline_flow.c | 51 ++-
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 +++++-
app/test-pmd/parameters.c | 12 +-
app/test-pmd/testpmd.h | 2 +
doc/guides/nics/mlx5.rst | 4 +-
doc/guides/testpmd_app_ug/run_app.rst | 5 +
drivers/net/mlx5/Makefile | 6 +-
drivers/net/mlx5/mlx5.c | 39 +--
drivers/net/mlx5/mlx5.h | 4 +-
drivers/net/mlx5/mlx5_flow.c | 608 +++++++++++++++++++++++++++-------
drivers/net/mlx5/mlx5_rxq.c | 61 +++-
drivers/net/mlx5/mlx5_rxtx.c | 33 +-
drivers/net/mlx5/mlx5_rxtx.h | 11 +-
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 21 +-
drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 17 +-
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_ethdev.h | 9 +
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +
lib/librte_net/rte_ether.h | 25 ++
25 files changed, 862 insertions(+), 200 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-27 13:09 ` Ferruh Yigit
` (40 more replies)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing Xueming Li
` (16 subsequent siblings)
17 siblings, 41 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Currently PMD implementations default RSS on either tunnel outer or
inner fields. This patch introduced RSS level to allow user to specify
RSS hash field level of tunneled packets.
0: outer RSS.
1: inner RSS.
2-255: deep RSS level.
Please note that tunnels that tightly nested without IP/UDP/TCP layer
interlaced are deemed as one level. For example the following packet can
only use level 0 or 1:
eth / ipv4 / GRE / MPLS / ipv4 / udp
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_ether/rte_ethdev.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0361533..baaeb3c 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -398,6 +398,15 @@ struct rte_eth_rss_conf {
uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */
uint8_t rss_key_len; /**< hash key length in bytes. */
uint64_t rss_hf; /**< Hash functions to apply - see below. */
+ /**
+ * RSS hash calculation on tunnel level:
+ * 0: outer RSS, default.
+ * 1: inner RSS.
+ * 2-255: deep RSS level.
+ * Please note that tunnels not interlaced with [IP|TCP|UDP] are
+ * deemed as one level, such as MPLS over GRE.
+ */
+ uint8_t rss_level;
};
/*
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-27 13:10 ` Ferruh Yigit
2018-02-26 15:09 ` [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (15 subsequent siblings)
17 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Support new flow RSS level parameter to select inner or outer RSS
fields. Example:
flow create 0 ingress pattern eth / ipv4 / udp dst is 4789 / vxlan /
end actions rss queues 1 2 end level 1 / end
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a5cf84f..921220d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -169,6 +169,7 @@ enum index {
ACTION_RSS,
ACTION_RSS_QUEUES,
ACTION_RSS_QUEUE,
+ ACTION_RSS_LEVEL,
ACTION_PF,
ACTION_VF,
ACTION_VF_ORIGINAL,
@@ -190,7 +191,8 @@ enum index {
/** Storage size for struct rte_flow_action_rss including queues. */
#define ACTION_RSS_SIZE \
(offsetof(struct rte_flow_action_rss, queue) + \
- sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM)
+ sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM + \
+ sizeof(struct rte_eth_rss_conf))
/** Maximum number of subsequent tokens and arguments on the stack. */
#define CTX_STACK_SIZE 16
@@ -623,6 +625,7 @@ struct parse_action_priv {
static const enum index action_rss[] = {
ACTION_RSS_QUEUES,
+ ACTION_RSS_LEVEL,
ACTION_NEXT,
ZERO,
};
@@ -640,6 +643,12 @@ struct parse_action_priv {
ZERO,
};
+static struct arg rss_level_arg = {
+ .offset = ACTION_RSS_SIZE - sizeof(struct rte_eth_rss_conf) +
+ offsetof(struct rte_eth_rss_conf, rss_level),
+ .size = sizeof(((struct rte_eth_rss_conf *)0)->rss_level),
+};
+
static int parse_init(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
@@ -1589,6 +1598,13 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
.call = parse_vc_action_rss_queue,
.comp = comp_vc_action_rss_queue,
},
+ [ACTION_RSS_LEVEL] = {
+ .name = "level",
+ .help = "rss on tunnel level",
+ .next = NEXT(action_rss, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(&rss_level_arg),
+ .call = parse_vc_conf,
+ },
[ACTION_PF] = {
.name = "pf",
.help = "redirect packets to physical device function",
@@ -1890,6 +1906,7 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
sizeof(double));
if ((uint8_t *)item + sizeof(*item) > data)
return -1;
+ memset(data, 0, data_size);
*item = (struct rte_flow_item){
.type = priv->type,
};
@@ -1907,14 +1924,20 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
sizeof(double));
if ((uint8_t *)action + sizeof(*action) > data)
return -1;
+ memset(data, 0, data_size);
*action = (struct rte_flow_action){
.type = priv->type,
};
+ if (ctx->curr == ACTION_RSS) {
+ struct rte_flow_action_rss *rss = (void *)data;
+
+ rss->rss_conf = RTE_PTR_ADD(rss, data_size -
+ sizeof(*rss->rss_conf));
+ }
++out->args.vc.actions_n;
ctx->object = action;
ctx->objmask = NULL;
}
- memset(data, 0, data_size);
out->args.vc.data = data;
ctx->objdata = data_size;
return len;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-27 15:25 ` Mohammad Abdul Awal
2018-02-26 15:09 ` [dpdk-dev] [PATCH 04/18] app/testpmd: " Xueming Li
` (14 subsequent siblings)
17 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
8 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59a..5ea8ae2 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 38f2d27..a32242a 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -49,6 +49,7 @@ struct rte_flow_desc_data {
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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),
MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 13e4202..8fa0397 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -244,6 +244,13 @@ enum rte_flow_item_type {
RTE_FLOW_ITEM_TYPE_VXLAN,
/**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+
+ /**
* Matches a E_TAG header.
*
* See struct rte_flow_item_e_tag.
@@ -630,6 +637,26 @@ struct rte_flow_item_vxlan {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flag). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* RTE_FLOW_ITEM_TYPE_E_TAG.
*
* Matches a E-tag header.
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 091d388..dc90379 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -439,6 +440,8 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 6274025..1839cf2 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefac..49106c7 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a3381..7caf833 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index 45daa91..fe02ad8 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -310,6 +310,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header.
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 04/18] app/testpmd: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (2 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 05/18] app/testpmd: add more GRE extension support to csum engine Xueming Li
` (13 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 24 ++++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 +++
6 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 921220d..ec451dd 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -133,6 +133,8 @@ enum index {
ITEM_SCTP_CKSUM,
ITEM_VXLAN,
ITEM_VXLAN_VNI,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
ITEM_E_TAG,
ITEM_E_TAG_GRP_ECID_B,
ITEM_NVGRE,
@@ -429,6 +431,7 @@ struct parse_action_priv {
ITEM_TCP,
ITEM_SCTP,
ITEM_VXLAN,
+ ITEM_VXLAN_GPE,
ITEM_E_TAG,
ITEM_NVGRE,
ITEM_MPLS,
@@ -551,6 +554,12 @@ struct parse_action_priv {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index item_e_tag[] = {
ITEM_E_TAG_GRP_ECID_B,
ITEM_NEXT,
@@ -1363,6 +1372,21 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
.next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
[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 4bb255c..2f74a7b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -971,6 +971,7 @@ struct rss_type_info {
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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
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)),
@@ -3016,6 +3017,7 @@ struct igb_ring_desc_16_bytes {
{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
{"port", RTE_ETH_FLOW_PORT},
{"vxlan", RTE_ETH_FLOW_VXLAN},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
};
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64..2138883 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ struct simple_gre_hdr {
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* check udp destination port, 4790 is the default vxlan-gpe port */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPv4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ struct simple_gre_hdr {
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ struct simple_gre_hdr {
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 97d22b8..d7489bc 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -186,6 +186,7 @@
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -621,6 +622,7 @@
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1092,6 +1094,14 @@
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 153abea..4cec239 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -433,6 +433,8 @@ enum tx_pkt_split {
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd5395..2e8690f 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -479,3 +479,8 @@ The commandline options are:
Set the hexadecimal bitmask of TX queue offloads.
The default value is 0.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 05/18] app/testpmd: add more GRE extension support to csum engine
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (3 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 04/18] app/testpmd: " Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 06/18] net/mlx5: fix tunnel offloads cap query Xueming Li
` (12 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 2138883..b73b8fe 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ struct simple_gre_hdr {
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ struct simple_gre_hdr {
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 06/18] net/mlx5: fix tunnel offloads cap query
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (4 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 05/18] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 07/18] net/mlx5: support GRE tunnel flow Xueming Li
` (11 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: dev, stable
From: Shahaf Shuler <shahafs@mellanox.com>
The query for the tunnel stateless offloads is wrongly implemented
because of:
1. It was using the device id to query for the offloads.
2. It was using a compilation flag for Verbs which no longer exits.
The main reason was lack of proper API from Verbs.
Fixing the query to use rdma-core API. The capability returned from
rdma-core refer to both Tx and Rx sides.
Eventhough there is a separate cap for GRE and VXLAN, implementation merge
them into a single flag in order to simplify the checks on the data
path.
Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Fixes: f5fde5205101 ("net/mlx5: add hardware checksum offload for tunnel packets")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
drivers/net/mlx5/Makefile | 6 +++---
drivers/net/mlx5/mlx5.c | 39 +++++++++++++++------------------------
drivers/net/mlx5/mlx5.h | 4 ++--
drivers/net/mlx5/mlx5_rxq.c | 2 +-
4 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 3bc9736..afda411 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -125,9 +125,9 @@ mlx5_autoconf.h.new: FORCE
mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
$Q $(RM) -f -- '$@'
$Q sh -- '$<' '$@' \
- HAVE_IBV_DEVICE_VXLAN_SUPPORT \
- infiniband/verbs.h \
- enum IBV_DEVICE_VXLAN_SUPPORT \
+ HAVE_IBV_DEVICE_TUNNEL_SUPPORT \
+ infiniband/mlx5dv.h \
+ enum MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS \
$(AUTOCONF_OUTPUT)
$Q sh -- '$<' '$@' \
HAVE_IBV_WQ_FLAG_RX_END_PADDING \
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 6c0985b..61cb931 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -584,7 +584,7 @@
unsigned int tunnel_en = 0;
int idx;
int i;
- struct mlx5dv_context attrs_out;
+ struct mlx5dv_context attrs_out = {0};
#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
struct ibv_counter_set_description cs_desc;
#endif
@@ -633,20 +633,6 @@
PCI_DEVICE_ID_MELLANOX_CONNECTX5VF) ||
(pci_dev->id.device_id ==
PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF));
- switch (pci_dev->id.device_id) {
- case PCI_DEVICE_ID_MELLANOX_CONNECTX4:
- tunnel_en = 1;
- break;
- case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5VF:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5EX:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF:
- tunnel_en = 1;
- break;
- default:
- break;
- }
INFO("PCI information matches, using device \"%s\""
" (SR-IOV: %s)",
list[i]->name,
@@ -675,6 +661,9 @@
* Multi-packet send is supported by ConnectX-4 Lx PF as well
* as all ConnectX-5 devices.
*/
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ attrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS;
+#endif
mlx5_glue->dv_query_device(attr_ctx, &attrs_out);
if (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED) {
if (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW) {
@@ -693,6 +682,17 @@
cqe_comp = 0;
else
cqe_comp = 1;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ if (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS) {
+ tunnel_en = ((attrs_out.tunnel_offloads_caps &
+ MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN) &&
+ (attrs_out.tunnel_offloads_caps &
+ MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE));
+ }
+ DEBUG("Tunnel offloading is %ssupported", tunnel_en ? "" : "not ");
+#else
+ WARN("Tunnel offloading disabled due to old OFED/rdma-core version");
+#endif
if (mlx5_glue->query_device_ex(attr_ctx, NULL, &device_attr))
goto error;
INFO("%u port(s) detected", device_attr.orig_attr.phys_port_cnt);
@@ -838,15 +838,6 @@
IBV_DEVICE_RAW_IP_CSUM);
DEBUG("checksum offloading is %ssupported",
(config.hw_csum ? "" : "not "));
-
-#ifdef HAVE_IBV_DEVICE_VXLAN_SUPPORT
- config.hw_csum_l2tun =
- !!(exp_device_attr.exp_device_cap_flags &
- IBV_DEVICE_VXLAN_SUPPORT);
-#endif
- DEBUG("Rx L2 tunnel checksum offloads are %ssupported",
- (config.hw_csum_l2tun ? "" : "not "));
-
#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
config.flow_counter_en = !!(device_attr.max_counter_sets);
mlx5_glue->describe_counter_set(ctx, 0, &cs_desc);
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 965c19f..3e2d96a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -75,13 +75,13 @@ struct mlx5_xstats_ctrl {
*/
struct mlx5_dev_config {
unsigned int hw_csum:1; /* Checksum offload is supported. */
- unsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */
unsigned int hw_vlan_strip:1; /* VLAN stripping is supported. */
unsigned int hw_fcs_strip:1; /* FCS stripping is supported. */
unsigned int hw_padding:1; /* End alignment padding is supported. */
unsigned int sriov:1; /* This is a VF or PF with VF devices. */
unsigned int mps:2; /* Multi-packet send supported mode. */
- unsigned int tunnel_en:1; /* Whether tunnel is supported. */
+ unsigned int tunnel_en:1;
+ /* Whether tunnel stateless offloads are supported. */
unsigned int flow_counter_en:1; /* Whether flow counter is supported. */
unsigned int cqe_comp:1; /* CQE compression is enabled. */
unsigned int tso:1; /* Whether TSO is supported. */
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index ff58c49..238fa7e 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1006,7 +1006,7 @@ struct mlx5_rxq_ctrl*
/* Toggle RX checksum offload if hardware supports it. */
tmpl->rxq.csum = !!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM);
tmpl->rxq.csum_l2tun = (!!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM) &&
- priv->config.hw_csum_l2tun);
+ priv->config.tunnel_en);
tmpl->rxq.hw_timestamp = !!(conf->offloads & DEV_RX_OFFLOAD_TIMESTAMP);
/* Configure VLAN stripping. */
tmpl->rxq.vlan_strip = !!(conf->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 07/18] net/mlx5: support GRE tunnel flow
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (5 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 06/18] net/mlx5: fix tunnel offloads cap query Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 08/18] net/mlx5: support L3 vxlan Xueming Li
` (10 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Support GRE tunnel type in RTE FLOW.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 67 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 60 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 26002c4..2acd42b 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -79,6 +79,11 @@ struct ibv_flow_spec_counter_action {
const void *default_mask,
void *data);
+static int
+mlx5_flow_create_gre(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data);
+
struct mlx5_flow_parse;
static void
@@ -222,6 +227,10 @@ struct rte_flow {
__VA_ARGS__, RTE_FLOW_ITEM_TYPE_END, \
}
+#define IS_TUNNEL(type) ( \
+ (type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
+ (type) == RTE_FLOW_ITEM_TYPE_GRE)
+
/** Structure to generate a simple graph of layers supported by the NIC. */
struct mlx5_flow_items {
/** List of possible actions for these items. */
@@ -274,7 +283,8 @@ struct mlx5_flow_items {
static const struct mlx5_flow_items mlx5_flow_items[] = {
[RTE_FLOW_ITEM_TYPE_END] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
- RTE_FLOW_ITEM_TYPE_VXLAN),
+ RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_GRE),
},
[RTE_FLOW_ITEM_TYPE_ETH] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_VLAN,
@@ -305,7 +315,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_IPV4] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_UDP,
- RTE_FLOW_ITEM_TYPE_TCP),
+ RTE_FLOW_ITEM_TYPE_TCP,
+ RTE_FLOW_ITEM_TYPE_GRE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_ipv4){
.hdr = {
@@ -322,7 +333,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_IPV6] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_UDP,
- RTE_FLOW_ITEM_TYPE_TCP),
+ RTE_FLOW_ITEM_TYPE_TCP,
+ RTE_FLOW_ITEM_TYPE_GRE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_ipv6){
.hdr = {
@@ -375,6 +387,18 @@ struct mlx5_flow_items {
.convert = mlx5_flow_create_tcp,
.dst_sz = sizeof(struct ibv_flow_spec_tcp_udp),
},
+ [RTE_FLOW_ITEM_TYPE_GRE] = {
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
+ .actions = valid_actions,
+ .mask = &(const struct rte_flow_item_gre){
+ .protocol = -1,
+ },
+ .default_mask = &rte_flow_item_gre_mask,
+ .mask_sz = sizeof(struct rte_flow_item_gre),
+ .convert = mlx5_flow_create_gre,
+ .dst_sz = sizeof(struct ibv_flow_spec_tunnel),
+ },
[RTE_FLOW_ITEM_TYPE_VXLAN] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH),
.actions = valid_actions,
@@ -390,7 +414,7 @@ struct mlx5_flow_items {
/** Structure to pass to the conversion function. */
struct mlx5_flow_parse {
- uint32_t inner; /**< Set once VXLAN is encountered. */
+ uint32_t inner; /**< Verb spec, set once tunnel is encountered. */
uint32_t create:1;
/**< Whether resources should remain after a validate. */
uint32_t drop:1; /**< Target is a drop queue. */
@@ -815,13 +839,13 @@ struct ibv_spec_header {
cur_item->mask_sz);
if (err)
goto exit_item_not_supported;
- if (items->type == RTE_FLOW_ITEM_TYPE_VXLAN) {
+ if (IS_TUNNEL(items->type)) {
if (parser->inner) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
- "cannot recognize multiple"
- " VXLAN encapsulations");
+ "Cannot recognize multiple"
+ " tunnel encapsulations.");
return -rte_errno;
}
parser->inner = IBV_FLOW_SPEC_INNER;
@@ -1548,6 +1572,35 @@ struct ibv_spec_header {
}
/**
+ * Convert GRE item to Verbs specification.
+ *
+ * @param item[in]
+ * Item specification.
+ * @param default_mask[in]
+ * Default bit-masks to use when item->mask is not provided.
+ * @param data[in, out]
+ * User structure.
+ */
+static int
+mlx5_flow_create_gre(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data)
+{
+ struct mlx5_flow_parse *parser = (struct mlx5_flow_parse *)data;
+ unsigned int size = sizeof(struct ibv_flow_spec_tunnel);
+ struct ibv_flow_spec_tunnel tunnel = {
+ .type = parser->inner | IBV_FLOW_SPEC_VXLAN_TUNNEL,
+ .size = size,
+ };
+
+ (void)item;
+ (void)default_mask;
+ parser->inner = IBV_FLOW_SPEC_INNER;
+ mlx5_flow_create_copy(parser, &tunnel, size);
+ return 0;
+}
+
+/**
* Convert mark/flag action to Verbs specification.
*
* @param parser
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 08/18] net/mlx5: support L3 vxlan
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (6 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 07/18] net/mlx5: support GRE tunnel flow Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 09/18] net/mlx5: support tunnel inner csum offloads Xueming Li
` (9 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
This patch add L3 vxlan support which don't have inner L2 header
comparing to standard vxlan protocol.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2acd42b..10f6413 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -400,7 +400,9 @@ struct mlx5_flow_items {
.dst_sz = sizeof(struct ibv_flow_spec_tunnel),
},
[RTE_FLOW_ITEM_TYPE_VXLAN] = {
- .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH),
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_vxlan){
.vni = "\xff\xff\xff",
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 09/18] net/mlx5: support tunnel inner csum offloads
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (7 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 08/18] net/mlx5: support L3 vxlan Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 10/18] net/mlx5: support packet tunnel type Xueming Li
` (8 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
PKT_RX_IP_CKSUM_GOOD and PKT_RX_L4_CKSUM_GOOD of mubf.ol_flags now are
inner header checksum when packet is tunneled.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 13 +++++++++++++
drivers/net/mlx5/mlx5_rxq.c | 2 --
drivers/net/mlx5/mlx5_rxtx.c | 18 ++++--------------
drivers/net/mlx5/mlx5_rxtx.h | 1 -
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 10f6413..755355e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -812,8 +812,15 @@ struct ibv_spec_header {
{
const struct mlx5_flow_items *cur_item = mlx5_flow_items;
unsigned int i;
+ int csum_en = 0;
+ struct mlx5_rxq_data *q;
(void)priv;
+ /* Check if checksum offloading */
+ for (i = 0; i != parser->queues_n; ++i) {
+ q = (*priv->rxqs)[parser->queues[i]];
+ csum_en |= q->csum;
+ }
/* Initialise the offsets to start after verbs attribute. */
for (i = 0; i != hash_rxq_init_n; ++i)
parser->queue[i].offset = sizeof(struct ibv_flow_attr);
@@ -850,6 +857,12 @@ struct ibv_spec_header {
" tunnel encapsulations.");
return -rte_errno;
}
+ if (!priv->config.tunnel_en && csum_en)
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ items,
+ "Cannot support hw tunnel checksum "
+ "offloads");
parser->inner = IBV_FLOW_SPEC_INNER;
}
if (parser->drop) {
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 238fa7e..9bc8b30 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1005,8 +1005,6 @@ struct mlx5_rxq_ctrl*
}
/* Toggle RX checksum offload if hardware supports it. */
tmpl->rxq.csum = !!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM);
- tmpl->rxq.csum_l2tun = (!!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM) &&
- priv->config.tunnel_en);
tmpl->rxq.hw_timestamp = !!(conf->offloads & DEV_RX_OFFLOAD_TIMESTAMP);
/* Configure VLAN stripping. */
tmpl->rxq.vlan_strip = !!(conf->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index dc4ead9..d9bfc9b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -41,7 +41,7 @@
uint16_t cqe_cnt, uint32_t *rss_hash);
static __rte_always_inline uint32_t
-rxq_cq_to_ol_flags(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe);
+rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe);
uint32_t mlx5_ptype_table[] __rte_cache_aligned = {
[0xff] = RTE_PTYPE_ALL_MASK, /* Last entry for errored packet. */
@@ -1688,8 +1688,6 @@
/**
* Translate RX completion flags to offload flags.
*
- * @param[in] rxq
- * Pointer to RX queue structure.
* @param[in] cqe
* Pointer to CQE.
*
@@ -1697,7 +1695,7 @@
* Offload flags (ol_flags) for struct rte_mbuf.
*/
static inline uint32_t
-rxq_cq_to_ol_flags(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe)
+rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe)
{
uint32_t ol_flags = 0;
uint16_t flags = rte_be_to_cpu_16(cqe->hdr_type_etc);
@@ -1709,14 +1707,6 @@
TRANSPOSE(flags,
MLX5_CQE_RX_L4_HDR_VALID,
PKT_RX_L4_CKSUM_GOOD);
- if ((cqe->pkt_info & MLX5_CQE_RX_TUNNEL_PACKET) && (rxq->csum_l2tun))
- ol_flags |=
- TRANSPOSE(flags,
- MLX5_CQE_RX_L3_HDR_VALID,
- PKT_RX_IP_CKSUM_GOOD) |
- TRANSPOSE(flags,
- MLX5_CQE_RX_L4_HDR_VALID,
- PKT_RX_L4_CKSUM_GOOD);
return ol_flags;
}
@@ -1815,8 +1805,8 @@
mlx5_flow_mark_get(mark);
}
}
- if (rxq->csum | rxq->csum_l2tun)
- pkt->ol_flags |= rxq_cq_to_ol_flags(rxq, cqe);
+ if (rxq->csum)
+ pkt->ol_flags |= rxq_cq_to_ol_flags(cqe);
if (rxq->vlan_strip &&
(cqe->hdr_type_etc &
rte_cpu_to_be_16(MLX5_CQE_VLAN_STRIPPED))) {
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index d7e8905..7fce001 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -77,7 +77,6 @@ struct rxq_zip {
/* RX queue descriptor. */
struct mlx5_rxq_data {
unsigned int csum:1; /* Enable checksum offloading. */
- unsigned int csum_l2tun:1; /* Same for L2 tunnels. */
unsigned int hw_timestamp:1; /* Enable HW timestamp. */
unsigned int vlan_strip:1; /* Enable VLAN stripping. */
unsigned int crc_present:1; /* CRC must be subtracted. */
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 10/18] net/mlx5: support packet tunnel type
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (8 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 09/18] net/mlx5: support tunnel inner csum offloads Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 11/18] net/mlx5: split flow RSS handling logic Xueming Li
` (7 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Support packet tunnel type identification based on rte_flow rule.
If rules of multiple tunnel types specified on same queue,
RTE_PTYPE_TUNNEL_MASK will be returned as tunnel type, it's user's
responsibility to set bits in flow mark as tunnel type identifier.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 72 +++++++++++++++++++++++++++++++----
drivers/net/mlx5/mlx5_rxq.c | 13 ++++++-
drivers/net/mlx5/mlx5_rxtx.c | 12 ++++--
drivers/net/mlx5/mlx5_rxtx.h | 7 +++-
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 21 ++++++----
drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 17 +++++++--
6 files changed, 115 insertions(+), 27 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 755355e..0f59de6 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -215,6 +215,7 @@ struct rte_flow {
uint16_t (*queues)[]; /**< Queues indexes to use. */
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
+ uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counters for the rule. */
struct mlx5_flow_counter_stats counter_stats;/**<The counter stats. */
struct mlx5_flow frxq[RTE_DIM(hash_rxq_init)];
@@ -231,6 +232,18 @@ struct rte_flow {
(type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
(type) == RTE_FLOW_ITEM_TYPE_GRE)
+const uint32_t rte_ptype[] = {
+ [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+};
+
+#define PTYPE_TUN(t) ((RTE_PTYPE_TUNNEL_MASK & (t)) >> 12)
+static const uint32_t ptype_flow_type[] = {
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
+};
+
/** Structure to generate a simple graph of layers supported by the NIC. */
struct mlx5_flow_items {
/** List of possible actions for these items. */
@@ -428,6 +441,7 @@ struct mlx5_flow_parse {
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
enum hash_rxq_type layer; /**< Last pattern layer detected. */
+ uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counter set for the rule */
struct {
struct ibv_flow_attr *ibv_attr;
@@ -849,7 +863,7 @@ struct ibv_spec_header {
if (err)
goto exit_item_not_supported;
if (IS_TUNNEL(items->type)) {
- if (parser->inner) {
+ if (parser->tunnel) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
@@ -864,6 +878,7 @@ struct ibv_spec_header {
"Cannot support hw tunnel checksum "
"offloads");
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[items->type];
}
if (parser->drop) {
parser->queue[HASH_RXQ_ETH].offset += cur_item->dst_sz;
@@ -1132,6 +1147,7 @@ struct ibv_spec_header {
}
/* Third step. Conversion parse, fill the specifications. */
parser->inner = 0;
+ parser->tunnel = 0;
for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) {
if (items->type == RTE_FLOW_ITEM_TYPE_VOID)
continue;
@@ -1562,6 +1578,7 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
if (spec) {
if (!mask)
mask = default_mask;
@@ -1611,6 +1628,7 @@ struct ibv_spec_header {
(void)item;
(void)default_mask;
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
mlx5_flow_create_copy(parser, &tunnel, size);
return 0;
}
@@ -1783,7 +1801,8 @@ struct ibv_spec_header {
parser->rss_conf.rss_key_len,
hash_fields,
parser->queues,
- parser->queues_n);
+ parser->queues_n,
+ parser->tunnel);
if (flow->frxq[i].hrxq)
continue;
flow->frxq[i].hrxq =
@@ -1792,7 +1811,8 @@ struct ibv_spec_header {
parser->rss_conf.rss_key_len,
hash_fields,
parser->queues,
- parser->queues_n);
+ parser->queues_n,
+ parser->tunnel);
if (!flow->frxq[i].hrxq) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
@@ -1858,8 +1878,16 @@ struct ibv_spec_header {
for (i = 0; i != parser->queues_n; ++i) {
struct mlx5_rxq_data *q =
(*priv->rxqs)[parser->queues[i]];
+ struct mlx5_rxq_ctrl *rxq_ctrl =
+ container_of(q, struct mlx5_rxq_ctrl, rxq);
+ uint8_t tunnel = PTYPE_TUN(parser->tunnel);
q->mark |= parser->mark;
+ if (parser->tunnel)
+ rxq_ctrl->tunnel_types[tunnel] += 1;
+ if (q->tunnel != parser->tunnel)
+ q->tunnel = q->tunnel ? RTE_PTYPE_TUNNEL_MASK :
+ parser->tunnel;
}
return 0;
error:
@@ -1932,6 +1960,7 @@ struct ibv_spec_header {
flow->queues = (uint16_t (*)[])(flow + 1);
memcpy(flow->queues, parser.queues, parser.queues_n * sizeof(uint16_t));
flow->queues_n = parser.queues_n;
+ flow->tunnel = parser.tunnel;
flow->mark = parser.mark;
/* Copy RSS configuration. */
flow->rss_conf = parser.rss_conf;
@@ -2021,9 +2050,36 @@ struct rte_flow *
{
unsigned int i;
- if (flow->drop || !flow->mark)
+ if (flow->drop)
goto free;
- for (i = 0; i != flow->queues_n; ++i) {
+ for (i = 0; flow->tunnel && i != flow->queues_n; ++i) {
+ /* Update queue tunnel type. */
+ struct mlx5_rxq_data *rxq = (*priv->rxqs)[(*flow->queues)[i]];
+ struct mlx5_rxq_ctrl *rxq_ctrl =
+ container_of(rxq, struct mlx5_rxq_ctrl, rxq);
+ uint8_t tunnel = PTYPE_TUN(flow->tunnel);
+
+ RTE_ASSERT(rxq_ctrl->tunnel_types[tunnel] > 0);
+ rxq_ctrl->tunnel_types[tunnel] -= 1;
+ if (!rxq_ctrl->tunnel_types[tunnel]) {
+ /* Update tunnel type. */
+ uint8_t j;
+ uint8_t types = 0;
+ uint8_t last;
+
+ for (j = 0; j < RTE_DIM(rxq_ctrl->tunnel_types); j++)
+ if (rxq_ctrl->tunnel_types[j]) {
+ types += 1;
+ last = j;
+ }
+ /* Keep same if more than one tunnel types left. */
+ if (types == 1)
+ rxq->tunnel = rte_ptype[ptype_flow_type[last]];
+ else if (types == 0) /* No tunnel type left. */
+ rxq->tunnel = 0;
+ }
+ }
+ for (i = 0; flow->mark && i != flow->queues_n; ++i) {
struct rte_flow *tmp;
int mark = 0;
@@ -2315,7 +2371,8 @@ struct rte_flow *
flow->rss_conf.rss_key_len,
hash_rxq_init[i].hash_fields,
(*flow->queues),
- flow->queues_n);
+ flow->queues_n,
+ flow->tunnel);
if (flow->frxq[i].hrxq)
goto flow_create;
flow->frxq[i].hrxq =
@@ -2323,7 +2380,8 @@ struct rte_flow *
flow->rss_conf.rss_key_len,
hash_rxq_init[i].hash_fields,
(*flow->queues),
- flow->queues_n);
+ flow->queues_n,
+ flow->tunnel);
if (!flow->frxq[i].hrxq) {
DEBUG("Flow %p cannot be applied",
(void *)flow);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 9bc8b30..09ef189 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1325,13 +1325,16 @@ struct mlx5_ind_table_ibv*
* first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
+ * @param tunnel
+ * Tunnel type.
*
* @return
* An hash Rx queue on success.
*/
struct mlx5_hrxq*
mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
- uint64_t hash_fields, uint16_t queues[], uint16_t queues_n)
+ uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
+ uint32_t tunnel)
{
struct mlx5_hrxq *hrxq;
struct mlx5_ind_table_ibv *ind_tbl;
@@ -1369,6 +1372,7 @@ struct mlx5_hrxq*
hrxq->qp = qp;
hrxq->rss_key_len = rss_key_len;
hrxq->hash_fields = hash_fields;
+ hrxq->tunnel = tunnel;
memcpy(hrxq->rss_key, rss_key, rss_key_len);
rte_atomic32_inc(&hrxq->refcnt);
LIST_INSERT_HEAD(&priv->hrxqs, hrxq, next);
@@ -1394,13 +1398,16 @@ struct mlx5_hrxq*
* first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
+ * @param tunnel
+ * Tunnel type.
*
* @return
* An hash Rx queue on success.
*/
struct mlx5_hrxq*
mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
- uint64_t hash_fields, uint16_t queues[], uint16_t queues_n)
+ uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
+ uint32_t tunnel)
{
struct mlx5_hrxq *hrxq;
@@ -1414,6 +1421,8 @@ struct mlx5_hrxq*
continue;
if (hrxq->hash_fields != hash_fields)
continue;
+ if (hrxq->tunnel != tunnel)
+ continue;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
if (!ind_tbl)
continue;
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d9bfc9b..926e11d 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -34,7 +34,7 @@
#include "mlx5_prm.h"
static __rte_always_inline uint32_t
-rxq_cq_to_pkt_type(volatile struct mlx5_cqe *cqe);
+rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe);
static __rte_always_inline int
mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -109,12 +109,14 @@
(*p)[0x8a] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_L4_UDP;
/* Tunneled - L3 */
+ (*p)[0x40] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
(*p)[0x41] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
(*p)[0x42] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
+ (*p)[0xc0] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
(*p)[0xc1] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
@@ -1541,6 +1543,8 @@
/**
* Translate RX completion flags to packet type.
*
+ * @param[in] rxq
+ * Pointer to RX queue structure.
* @param[in] cqe
* Pointer to CQE.
*
@@ -1550,7 +1554,7 @@
* Packet type for struct rte_mbuf.
*/
static inline uint32_t
-rxq_cq_to_pkt_type(volatile struct mlx5_cqe *cqe)
+rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe)
{
uint8_t idx;
uint8_t pinfo = cqe->pkt_info;
@@ -1565,7 +1569,7 @@
* bit[7] = outer_l3_type
*/
idx = ((pinfo & 0x3) << 6) | ((ptype & 0xfc00) >> 10);
- return mlx5_ptype_table[idx];
+ return mlx5_ptype_table[idx] | rxq->tunnel * !!(idx & (1 << 6));
}
/**
@@ -1787,7 +1791,7 @@
pkt = seg;
assert(len >= (rxq->crc_present << 2));
/* Update packet information. */
- pkt->packet_type = rxq_cq_to_pkt_type(cqe);
+ pkt->packet_type = rxq_cq_to_pkt_type(rxq, cqe);
pkt->ol_flags = 0;
if (rss_hash_res && rxq->rss_hash) {
pkt->hash.rss = rss_hash_res;
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 7fce001..7763641 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -103,6 +103,7 @@ struct mlx5_rxq_data {
void *cq_uar; /* CQ user access region. */
uint32_t cqn; /* CQ number. */
uint8_t cq_arm_sn; /* CQ arm seq number. */
+ uint32_t tunnel; /* Tunnel type. */
} __rte_cache_aligned;
/* Verbs Rx queue elements. */
@@ -124,6 +125,7 @@ struct mlx5_rxq_ctrl {
struct mlx5_rxq_ibv *ibv; /* Verbs elements. */
struct mlx5_rxq_data rxq; /* Data path structure. */
unsigned int socket; /* CPU socket ID for allocations. */
+ uint32_t tunnel_types[16]; /* Tunnel type counter. */
unsigned int irq:1; /* Whether IRQ is enabled. */
};
@@ -143,6 +145,7 @@ struct mlx5_hrxq {
struct mlx5_ind_table_ibv *ind_table; /* Indirection table. */
struct ibv_qp *qp; /* Verbs queue pair. */
uint64_t hash_fields; /* Verbs Hash fields. */
+ uint32_t tunnel; /* Tunnel type. */
uint8_t rss_key_len; /* Hash key length in bytes. */
uint8_t rss_key[]; /* Hash key. */
};
@@ -240,9 +243,9 @@ struct mlx5_ind_table_ibv *mlx5_priv_ind_table_ibv_get(struct priv *,
int mlx5_priv_ind_table_ibv_release(struct priv *, struct mlx5_ind_table_ibv *);
int mlx5_priv_ind_table_ibv_verify(struct priv *);
struct mlx5_hrxq *mlx5_priv_hrxq_new(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t);
+ uint64_t, uint16_t [], uint16_t, uint32_t);
struct mlx5_hrxq *mlx5_priv_hrxq_get(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t);
+ uint64_t, uint16_t [], uint16_t, uint32_t);
int mlx5_priv_hrxq_release(struct priv *, struct mlx5_hrxq *);
int mlx5_priv_hrxq_ibv_verify(struct priv *);
uint64_t mlx5_priv_get_rx_port_offloads(struct priv *);
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index bbe1818..9f91361 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -551,6 +551,7 @@
const uint64x1_t mbuf_init = vld1_u64(&rxq->mbuf_initializer);
const uint64x1_t r32_mask = vcreate_u64(0xffffffff);
uint64x2_t rearm0, rearm1, rearm2, rearm3;
+ uint8_t pt_idx0, pt_idx1, pt_idx2, pt_idx3;
if (rxq->mark) {
const uint32x4_t ft_def = vdupq_n_u32(MLX5_FLOW_MARK_DEFAULT);
@@ -583,14 +584,18 @@
ptype = vshrn_n_u32(ptype_info, 10);
/* Errored packets will have RTE_PTYPE_ALL_MASK. */
ptype = vorr_u16(ptype, op_err);
- pkts[0]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 6)];
- pkts[1]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 4)];
- pkts[2]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 2)];
- pkts[3]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 0)];
+ pt_idx0 = vget_lane_u8(vreinterpret_u8_u16(ptype), 6);
+ pt_idx1 = vget_lane_u8(vreinterpret_u8_u16(ptype), 4);
+ pt_idx2 = vget_lane_u8(vreinterpret_u8_u16(ptype), 2);
+ pt_idx3 = vget_lane_u8(vreinterpret_u8_u16(ptype), 0);
+ pkts[0]->packet_type = mlx5_ptype_table[pt_idx0] |
+ !!(pt_idx0 & (1 << 6)) * rxq->tunnel;
+ pkts[1]->packet_type = mlx5_ptype_table[pt_idx1] |
+ !!(pt_idx1 & (1 << 6)) * rxq->tunnel;
+ pkts[2]->packet_type = mlx5_ptype_table[pt_idx2] |
+ !!(pt_idx2 & (1 << 6)) * rxq->tunnel;
+ pkts[3]->packet_type = mlx5_ptype_table[pt_idx3] |
+ !!(pt_idx3 & (1 << 6)) * rxq->tunnel;
/* Fill flags for checksum and VLAN. */
pinfo = vandq_u32(ptype_info, ptype_ol_mask);
pinfo = vreinterpretq_u32_u8(
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index c088bcb..d249248 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -542,6 +542,7 @@
const __m128i mbuf_init =
_mm_loadl_epi64((__m128i *)&rxq->mbuf_initializer);
__m128i rearm0, rearm1, rearm2, rearm3;
+ uint8_t pt_idx0, pt_idx1, pt_idx2, pt_idx3;
/* Extract pkt_info field. */
pinfo0 = _mm_unpacklo_epi32(cqes[0], cqes[1]);
@@ -595,10 +596,18 @@
/* Errored packets will have RTE_PTYPE_ALL_MASK. */
op_err = _mm_srli_epi16(op_err, 8);
ptype = _mm_or_si128(ptype, op_err);
- pkts[0]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 0)];
- pkts[1]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 2)];
- pkts[2]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 4)];
- pkts[3]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 6)];
+ pt_idx0 = _mm_extract_epi8(ptype, 0);
+ pt_idx1 = _mm_extract_epi8(ptype, 2);
+ pt_idx2 = _mm_extract_epi8(ptype, 4);
+ pt_idx3 = _mm_extract_epi8(ptype, 6);
+ pkts[0]->packet_type = mlx5_ptype_table[pt_idx0] |
+ !!(pt_idx0 & (1 << 6)) * rxq->tunnel;
+ pkts[1]->packet_type = mlx5_ptype_table[pt_idx1] |
+ !!(pt_idx1 & (1 << 6)) * rxq->tunnel;
+ pkts[2]->packet_type = mlx5_ptype_table[pt_idx2] |
+ !!(pt_idx2 & (1 << 6)) * rxq->tunnel;
+ pkts[3]->packet_type = mlx5_ptype_table[pt_idx3] |
+ !!(pt_idx3 & (1 << 6)) * rxq->tunnel;
/* Fill flags for checksum and VLAN. */
pinfo = _mm_and_si128(pinfo, ptype_ol_mask);
pinfo = _mm_shuffle_epi8(cv_flag_sel, pinfo);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 11/18] net/mlx5: split flow RSS handling logic
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (9 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 10/18] net/mlx5: support packet tunnel type Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 12/18] net/mlx5: support tunnel RSS level Xueming Li
` (6 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Refactor and split out flow RSS hash field handling logic to dedicate
function.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 95 +++++++++++++++++++++++++-------------------
1 file changed, 54 insertions(+), 41 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0f59de6..0c45228 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -956,50 +956,9 @@ struct ibv_spec_header {
static void
priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser)
{
- const unsigned int ipv4 =
- hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
- const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
- const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
- const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
- const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
- const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
unsigned int i;
(void)priv;
- if (parser->layer == HASH_RXQ_ETH) {
- goto fill;
- } else {
- /*
- * This layer becomes useless as the pattern define under
- * layers.
- */
- rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
- parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
- }
- /* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
- for (i = ohmin; i != (ohmax + 1); ++i) {
- if (!parser->queue[i].ibv_attr)
- continue;
- rte_free(parser->queue[i].ibv_attr);
- parser->queue[i].ibv_attr = NULL;
- }
- /* Remove impossible flow according to the RSS configuration. */
- if (hash_rxq_init[parser->layer].dpdk_rss_hf &
- parser->rss_conf.rss_hf) {
- /* Remove any other flow. */
- for (i = hmin; i != (hmax + 1); ++i) {
- if ((i == parser->layer) ||
- (!parser->queue[i].ibv_attr))
- continue;
- rte_free(parser->queue[i].ibv_attr);
- parser->queue[i].ibv_attr = NULL;
- }
- } else if (!parser->queue[ip].ibv_attr) {
- /* no RSS possible with the current configuration. */
- parser->queues_n = 1;
- return;
- }
-fill:
/*
* Fill missing layers in verbs specifications, or compute the correct
* offset to allocate the memory space for the attributes and
@@ -1062,6 +1021,57 @@ struct ibv_spec_header {
}
/**
+ * Update flows according to pattern and RSS hash fields.
+ *
+ * @param priv
+ * Pointer to private structure.
+ * @param[in, out] parser
+ * Internal parser structure.
+ */
+static int
+priv_flow_convert_rss(struct priv *priv, struct mlx5_flow_parse *parser)
+{
+ const unsigned int ipv4 =
+ hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
+ const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
+ const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
+ const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
+ const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ unsigned int i;
+
+ (void)priv;
+ if (parser->layer == HASH_RXQ_ETH)
+ return 0;
+ /* This layer becomes useless as the pattern define under layers. */
+ rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
+ parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
+ /* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
+ for (i = ohmin; i != (ohmax + 1); ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ /* Remove impossible flow according to the RSS configuration. */
+ if (hash_rxq_init[parser->layer].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ /* Remove any other flow. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if ((i == parser->layer) ||
+ (!parser->queue[i].ibv_attr))
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ } else if (!parser->queue[ip].ibv_attr) {
+ /* no RSS possible with the current configuration. */
+ parser->queues_n = 1;
+ }
+ return 0;
+}
+
+/**
* Validate and convert a flow supported by the NIC.
*
* @param priv
@@ -1176,6 +1186,9 @@ struct ibv_spec_header {
* configuration.
*/
if (!parser->drop) {
+ ret = priv_flow_convert_rss(priv, parser);
+ if (ret)
+ goto exit_free;
priv_flow_convert_finalise(priv, parser);
} else {
parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 12/18] net/mlx5: support tunnel RSS level
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (10 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 11/18] net/mlx5: split flow RSS handling logic Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 13/18] net/mlx5: support 16 hardware priorities Xueming Li
` (5 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
RTE flow tunnel RSS level give user a choice to do RSS hash calculation
on inner or outer RSS fields. This path make mlx5 PMD support rte_flow
tunel RSS level. Testpmd flow command examples:
GRE tunnel with inner TCP, UDP and IP RSS:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 1 / end
GRE tunnel rule with specific inner pattern and same RSS queue as above
rule:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / ipv4 /
tcp / end actions rss queues 1 2 end level 1 / end
GRE tunnel rule with outer IP RSS:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 0 / end
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 242 +++++++++++++++++++++++++++++++------------
drivers/net/mlx5/mlx5_rxq.c | 50 ++++++++-
drivers/net/mlx5/mlx5_rxtx.h | 7 +-
3 files changed, 226 insertions(+), 73 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0c45228..1e9e3d6 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -105,6 +105,7 @@ enum hash_rxq_type {
HASH_RXQ_UDPV6,
HASH_RXQ_IPV6,
HASH_RXQ_ETH,
+ HASH_RXQ_TUNNEL,
};
/* Initialization data for hash RX queue. */
@@ -441,6 +442,7 @@ struct mlx5_flow_parse {
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
enum hash_rxq_type layer; /**< Last pattern layer detected. */
+ enum hash_rxq_type out_layer; /**< Last outer pattern layer detected. */
uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counter set for the rule */
struct {
@@ -448,6 +450,7 @@ struct mlx5_flow_parse {
/**< Pointer to Verbs attributes. */
unsigned int offset;
/**< Current position or total size of the attribute. */
+ uint64_t hash_fields; /**< verbs hash fields. */
} queue[RTE_DIM(hash_rxq_init)];
};
@@ -579,7 +582,7 @@ struct ibv_spec_header {
if (rss_conf) {
if (rss_conf->rss_hf & MLX5_RSS_HF_MASK)
return EINVAL;
- if (rss_conf->rss_key_len != 40)
+ if (rss_conf->rss_key_len > 0 && rss_conf->rss_key_len != 40)
return EINVAL;
if (rss_conf->rss_key_len && rss_conf->rss_key) {
parser->rss_conf.rss_key_len = rss_conf->rss_key_len;
@@ -587,7 +590,9 @@ struct ibv_spec_header {
rss_conf->rss_key_len);
parser->rss_conf.rss_key = parser->rss_key;
}
- parser->rss_conf.rss_hf = rss_conf->rss_hf;
+ if (rss_conf->rss_hf)
+ parser->rss_conf.rss_hf = rss_conf->rss_hf;
+ parser->rss_conf.rss_level = rss_conf->rss_level;
}
return 0;
}
@@ -759,6 +764,13 @@ struct ibv_spec_header {
"wrong RSS configuration");
return -rte_errno;
}
+ if (parser->rss_conf.rss_level > 1) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "wrong RSS level");
+ return -rte_errno;
+ }
} else if (actions->type == RTE_FLOW_ACTION_TYPE_MARK) {
const struct rte_flow_action_mark *mark =
(const struct rte_flow_action_mark *)
@@ -875,10 +887,19 @@ struct ibv_spec_header {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
- "Cannot support hw tunnel checksum "
+ "Cannot support tunnel checksum "
"offloads");
+ if (!priv->config.tunnel_en &&
+ parser->rss_conf.rss_level)
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ items,
+ "Cannot support tunnel inner RSS");
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[items->type];
+ parser->layer = HASH_RXQ_TUNNEL;
+ } else {
+ parser->layer = HASH_RXQ_ETH;
}
if (parser->drop) {
parser->queue[HASH_RXQ_ETH].offset += cur_item->dst_sz;
@@ -957,8 +978,12 @@ struct ibv_spec_header {
priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser)
{
unsigned int i;
+ uint32_t inner = parser->inner;
(void)priv;
+ /* Don't create extra flows for outer RSS. */
+ if (parser->tunnel && !parser->rss_conf.rss_level)
+ return;
/*
* Fill missing layers in verbs specifications, or compute the correct
* offset to allocate the memory space for the attributes and
@@ -969,23 +994,25 @@ struct ibv_spec_header {
struct ibv_flow_spec_ipv4_ext ipv4;
struct ibv_flow_spec_ipv6 ipv6;
struct ibv_flow_spec_tcp_udp udp_tcp;
+ struct ibv_flow_spec_eth eth;
} specs;
void *dst;
uint16_t size;
if (i == parser->layer)
continue;
- if (parser->layer == HASH_RXQ_ETH) {
+ if (parser->layer == HASH_RXQ_ETH ||
+ parser->layer == HASH_RXQ_TUNNEL) {
if (hash_rxq_init[i].ip_version == MLX5_IPV4) {
size = sizeof(struct ibv_flow_spec_ipv4_ext);
specs.ipv4 = (struct ibv_flow_spec_ipv4_ext){
- .type = IBV_FLOW_SPEC_IPV4_EXT,
+ .type = inner | IBV_FLOW_SPEC_IPV4_EXT,
.size = size,
};
} else {
size = sizeof(struct ibv_flow_spec_ipv6);
specs.ipv6 = (struct ibv_flow_spec_ipv6){
- .type = IBV_FLOW_SPEC_IPV6,
+ .type = inner | IBV_FLOW_SPEC_IPV6,
.size = size,
};
}
@@ -1002,7 +1029,7 @@ struct ibv_spec_header {
(i == HASH_RXQ_UDPV6) || (i == HASH_RXQ_TCPV6)) {
size = sizeof(struct ibv_flow_spec_tcp_udp);
specs.udp_tcp = (struct ibv_flow_spec_tcp_udp) {
- .type = ((i == HASH_RXQ_UDPV4 ||
+ .type = inner | ((i == HASH_RXQ_UDPV4 ||
i == HASH_RXQ_UDPV6) ?
IBV_FLOW_SPEC_UDP :
IBV_FLOW_SPEC_TCP),
@@ -1025,25 +1052,72 @@ struct ibv_spec_header {
*
* @param priv
* Pointer to private structure.
+ * @param[out] error
+ * Perform verbose error reporting if not NULL.
* @param[in, out] parser
* Internal parser structure.
*/
static int
-priv_flow_convert_rss(struct priv *priv, struct mlx5_flow_parse *parser)
+priv_flow_convert_rss(struct priv *priv, struct rte_flow_error *error,
+ struct mlx5_flow_parse *parser)
{
- const unsigned int ipv4 =
+ unsigned int ipv4 =
hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
- const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
unsigned int i;
+ int found = 0;
(void)priv;
- if (parser->layer == HASH_RXQ_ETH)
+ /*
+ * Outer RSS.
+ * HASH_RXQ_ETH is the only rule since tunnel packet match this
+ * rule must match outer pattern.
+ */
+ if (parser->tunnel && !parser->rss_conf.rss_level) {
+ /* Remove flows other than default. */
+ for (i = 0; i != hash_rxq_init_n - 1; ++i) {
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ ipv4 = hash_rxq_init[parser->out_layer].ip_version == MLX5_IPV4;
+ ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ if (hash_rxq_init[parser->out_layer].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ parser->queue[HASH_RXQ_ETH].hash_fields =
+ hash_rxq_init[parser->out_layer].hash_fields;
+ } else if (ip && (hash_rxq_init[ip].dpdk_rss_hf &
+ parser->rss_conf.rss_hf)) {
+ parser->queue[HASH_RXQ_ETH].hash_fields =
+ hash_rxq_init[ip].hash_fields;
+ } else if (parser->rss_conf.rss_hf) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+ "rss outer hash function not match pattern");
+ return -rte_errno;
+ }
return 0;
- /* This layer becomes useless as the pattern define under layers. */
+ }
+ if (parser->layer == HASH_RXQ_ETH || parser->layer == HASH_RXQ_TUNNEL) {
+ /* Remove unused flows according to hash function. */
+ for (i = 0; i != hash_rxq_init_n - 1; ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ if (hash_rxq_init[i].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[i].hash_fields;
+ continue;
+ }
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ return 0;
+ }
+ /* Remove ETH layer flow. */
rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
/* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
@@ -1053,9 +1127,54 @@ struct ibv_spec_header {
rte_free(parser->queue[i].ibv_attr);
parser->queue[i].ibv_attr = NULL;
}
- /* Remove impossible flow according to the RSS configuration. */
- if (hash_rxq_init[parser->layer].dpdk_rss_hf &
- parser->rss_conf.rss_hf) {
+ /*
+ * Keep L4 flows as IP pattern has to support L4 RSS.
+ * Otherwise, only keep the flow that match the pattern.
+ */
+ if (parser->layer != ip) {
+ /* Only keep the flow that match the pattern. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if (i == parser->layer)
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ }
+ if (parser->rss_conf.rss_hf) {
+ /* Remove impossible flow according to the RSS configuration. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ if (parser->rss_conf.rss_hf &
+ hash_rxq_init[i].dpdk_rss_hf) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[i].hash_fields;
+ found = 1;
+ continue;
+ }
+ /* L4 flow could be used for L3 RSS. */
+ if (i == parser->layer && i < ip &&
+ (hash_rxq_init[ip].dpdk_rss_hf &
+ parser->rss_conf.rss_hf)) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[ip].hash_fields;
+ found = 1;
+ continue;
+ }
+ /* L3 flow and L4 hash: non-rss L3 flow. */
+ if (i == parser->layer && i == ip && found)
+ /* IP pattern and L4 HF. */
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ if (!found) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "rss hash function not match pattern");
+ return -rte_errno;
+ }
+ } else {
/* Remove any other flow. */
for (i = hmin; i != (hmax + 1); ++i) {
if ((i == parser->layer) ||
@@ -1064,8 +1183,6 @@ struct ibv_spec_header {
rte_free(parser->queue[i].ibv_attr);
parser->queue[i].ibv_attr = NULL;
}
- } else if (!parser->queue[ip].ibv_attr) {
- /* no RSS possible with the current configuration. */
parser->queues_n = 1;
}
return 0;
@@ -1142,10 +1259,6 @@ struct ibv_spec_header {
hash_rxq_init[i].flow_priority;
unsigned int offset;
- if (!(parser->rss_conf.rss_hf &
- hash_rxq_init[i].dpdk_rss_hf) &&
- (i != HASH_RXQ_ETH))
- continue;
offset = parser->queue[i].offset;
parser->queue[i].ibv_attr =
priv_flow_convert_allocate(priv, priority,
@@ -1158,6 +1271,7 @@ struct ibv_spec_header {
/* Third step. Conversion parse, fill the specifications. */
parser->inner = 0;
parser->tunnel = 0;
+ parser->layer = HASH_RXQ_ETH;
for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) {
if (items->type == RTE_FLOW_ITEM_TYPE_VOID)
continue;
@@ -1174,19 +1288,12 @@ struct ibv_spec_header {
goto exit_free;
}
}
- if (parser->mark)
- mlx5_flow_create_flag_mark(parser, parser->mark_id);
- if (parser->count && parser->create) {
- mlx5_flow_create_count(priv, parser);
- if (!parser->cs)
- goto exit_count_error;
- }
/*
* Last step. Complete missing specification to reach the RSS
* configuration.
*/
if (!parser->drop) {
- ret = priv_flow_convert_rss(priv, parser);
+ ret = priv_flow_convert_rss(priv, error, parser);
if (ret)
goto exit_free;
priv_flow_convert_finalise(priv, parser);
@@ -1195,6 +1302,13 @@ struct ibv_spec_header {
attr->priority +
hash_rxq_init[parser->layer].flow_priority;
}
+ if (parser->mark)
+ mlx5_flow_create_flag_mark(parser, parser->mark_id);
+ if (parser->count && parser->create) {
+ mlx5_flow_create_count(priv, parser);
+ if (!parser->cs)
+ goto exit_count_error;
+ }
exit_free:
/* Only verification is expected, all resources should be released. */
if (!parser->create) {
@@ -1242,17 +1356,11 @@ struct ibv_spec_header {
for (i = 0; i != hash_rxq_init_n; ++i) {
if (!parser->queue[i].ibv_attr)
continue;
- /* Specification must be the same l3 type or none. */
- if (parser->layer == HASH_RXQ_ETH ||
- (hash_rxq_init[parser->layer].ip_version ==
- hash_rxq_init[i].ip_version) ||
- (hash_rxq_init[i].ip_version == 0)) {
- dst = (void *)((uintptr_t)parser->queue[i].ibv_attr +
- parser->queue[i].offset);
- memcpy(dst, src, size);
- ++parser->queue[i].ibv_attr->num_of_specs;
- parser->queue[i].offset += size;
- }
+ dst = (void *)((uintptr_t)parser->queue[i].ibv_attr +
+ parser->queue[i].offset);
+ memcpy(dst, src, size);
+ ++parser->queue[i].ibv_attr->num_of_specs;
+ parser->queue[i].offset += size;
}
}
@@ -1280,9 +1388,7 @@ struct ibv_spec_header {
.size = eth_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_ETH;
+ parser->layer = HASH_RXQ_ETH;
if (spec) {
unsigned int i;
@@ -1369,9 +1475,7 @@ struct ibv_spec_header {
.size = ipv4_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_IPV4;
+ parser->layer = HASH_RXQ_IPV4;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1421,9 +1525,7 @@ struct ibv_spec_header {
.size = ipv6_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_IPV6;
+ parser->layer = HASH_RXQ_IPV6;
if (spec) {
unsigned int i;
uint32_t vtc_flow_val;
@@ -1493,13 +1595,10 @@ struct ibv_spec_header {
.size = udp_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner) {
- if (parser->layer == HASH_RXQ_IPV4)
- parser->layer = HASH_RXQ_UDPV4;
- else
- parser->layer = HASH_RXQ_UDPV6;
- }
+ if (parser->layer == HASH_RXQ_IPV4)
+ parser->layer = HASH_RXQ_UDPV4;
+ else
+ parser->layer = HASH_RXQ_UDPV6;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1539,13 +1638,10 @@ struct ibv_spec_header {
.size = tcp_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner) {
- if (parser->layer == HASH_RXQ_IPV4)
- parser->layer = HASH_RXQ_TCPV4;
- else
- parser->layer = HASH_RXQ_TCPV6;
- }
+ if (parser->layer == HASH_RXQ_IPV4)
+ parser->layer = HASH_RXQ_TCPV4;
+ else
+ parser->layer = HASH_RXQ_TCPV6;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1592,6 +1688,8 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1642,6 +1740,8 @@ struct ibv_spec_header {
(void)default_mask;
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
mlx5_flow_create_copy(parser, &tunnel, size);
return 0;
}
@@ -1805,7 +1905,7 @@ struct ibv_spec_header {
continue;
flow->frxq[i].ibv_attr = parser->queue[i].ibv_attr;
parser->queue[i].ibv_attr = NULL;
- hash_fields = hash_rxq_init[i].hash_fields;
+ hash_fields = parser->queue[i].hash_fields;
if (!priv->dev->data->dev_started)
continue;
flow->frxq[i].hrxq =
@@ -1815,7 +1915,8 @@ struct ibv_spec_header {
hash_fields,
parser->queues,
parser->queues_n,
- parser->tunnel);
+ parser->tunnel,
+ parser->rss_conf.rss_level);
if (flow->frxq[i].hrxq)
continue;
flow->frxq[i].hrxq =
@@ -1825,7 +1926,8 @@ struct ibv_spec_header {
hash_fields,
parser->queues,
parser->queues_n,
- parser->tunnel);
+ parser->tunnel,
+ parser->rss_conf.rss_level);
if (!flow->frxq[i].hrxq) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
@@ -1885,7 +1987,7 @@ struct ibv_spec_header {
}
DEBUG("%p type %d QP %p ibv_flow %p",
(void *)flow, i,
- (void *)flow->frxq[i].hrxq,
+ (void *)flow->frxq[i].hrxq->qp,
(void *)flow->frxq[i].ibv_flow);
}
for (i = 0; i != parser->queues_n; ++i) {
@@ -2385,7 +2487,8 @@ struct rte_flow *
hash_rxq_init[i].hash_fields,
(*flow->queues),
flow->queues_n,
- flow->tunnel);
+ flow->tunnel,
+ flow->rss_conf.rss_level);
if (flow->frxq[i].hrxq)
goto flow_create;
flow->frxq[i].hrxq =
@@ -2394,7 +2497,8 @@ struct rte_flow *
hash_rxq_init[i].hash_fields,
(*flow->queues),
flow->queues_n,
- flow->tunnel);
+ flow->tunnel,
+ flow->rss_conf.rss_level);
if (!flow->frxq[i].hrxq) {
DEBUG("Flow %p cannot be applied",
(void *)flow);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 09ef189..470fd2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1327,6 +1327,8 @@ struct mlx5_ind_table_ibv*
* Number of queues.
* @param tunnel
* Tunnel type.
+ * @param rss_level
+ * RSS hash on tunnel level, 0: outer most, 1: inner.
*
* @return
* An hash Rx queue on success.
@@ -1334,11 +1336,14 @@ struct mlx5_ind_table_ibv*
struct mlx5_hrxq*
mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
- uint32_t tunnel)
+ uint32_t tunnel, uint8_t rss_level)
{
struct mlx5_hrxq *hrxq;
struct mlx5_ind_table_ibv *ind_tbl;
struct ibv_qp *qp;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ struct mlx5dv_qp_init_attr qp_init_attr = {0};
+#endif
queues_n = hash_fields ? queues_n : 1;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
@@ -1346,6 +1351,40 @@ struct mlx5_hrxq*
ind_tbl = mlx5_priv_ind_table_ibv_new(priv, queues, queues_n);
if (!ind_tbl)
return NULL;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ if (tunnel) {
+ qp_init_attr.comp_mask =
+ MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS;
+ qp_init_attr.create_flags = MLX5DV_QP_CREATE_TUNNEL_OFFLOADS;
+ }
+ qp = mlx5dv_create_qp(
+ priv->ctx,
+ &(struct ibv_qp_init_attr_ex){
+ .qp_type = IBV_QPT_RAW_PACKET,
+ .comp_mask =
+ IBV_QP_INIT_ATTR_PD |
+ IBV_QP_INIT_ATTR_IND_TABLE |
+ IBV_QP_INIT_ATTR_RX_HASH,
+ .rx_hash_conf = (struct ibv_rx_hash_conf){
+ .rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,
+ .rx_hash_key_len = rss_key_len,
+ .rx_hash_key = rss_key,
+ .rx_hash_fields_mask = hash_fields |
+ (tunnel && rss_level ?
+ (uint32_t)IBV_RX_HASH_INNER : 0),
+ },
+ .rwq_ind_tbl = ind_tbl->ind_table,
+ .pd = priv->pd,
+ },
+ &qp_init_attr);
+ DEBUG("mxl5dv_create_qp(): %p, hash_fields: %lx ind_tbl:%p dv_attr: "
+ "comp_mask: %lx create_flags:%x",
+ (void *)qp, hash_fields | (tunnel && rss_level ?
+ (uint32_t)IBV_RX_HASH_INNER : 0), (void *)ind_tbl,
+ qp_init_attr.comp_mask, qp_init_attr.create_flags);
+ if (!qp)
+ goto error;
+#else
qp = mlx5_glue->create_qp_ex
(priv->ctx,
&(struct ibv_qp_init_attr_ex){
@@ -1363,6 +1402,7 @@ struct mlx5_hrxq*
.rwq_ind_tbl = ind_tbl->ind_table,
.pd = priv->pd,
});
+#endif
if (!qp)
goto error;
hrxq = rte_calloc(__func__, 1, sizeof(*hrxq) + rss_key_len, 0);
@@ -1373,6 +1413,7 @@ struct mlx5_hrxq*
hrxq->rss_key_len = rss_key_len;
hrxq->hash_fields = hash_fields;
hrxq->tunnel = tunnel;
+ hrxq->rss_level = rss_level;
memcpy(hrxq->rss_key, rss_key, rss_key_len);
rte_atomic32_inc(&hrxq->refcnt);
LIST_INSERT_HEAD(&priv->hrxqs, hrxq, next);
@@ -1380,6 +1421,7 @@ struct mlx5_hrxq*
(void *)hrxq, rte_atomic32_read(&hrxq->refcnt));
return hrxq;
error:
+ ERROR("%p: Error creating Hash Rx queue", (void *)priv);
mlx5_priv_ind_table_ibv_release(priv, ind_tbl);
if (qp)
claim_zero(mlx5_glue->destroy_qp(qp));
@@ -1400,6 +1442,8 @@ struct mlx5_hrxq*
* Number of queues.
* @param tunnel
* Tunnel type.
+ * @param rss_level
+ * RSS hash on tunnel level, 0: outer most, 1: inner
*
* @return
* An hash Rx queue on success.
@@ -1407,7 +1451,7 @@ struct mlx5_hrxq*
struct mlx5_hrxq*
mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
- uint32_t tunnel)
+ uint32_t tunnel, uint8_t rss_level)
{
struct mlx5_hrxq *hrxq;
@@ -1423,6 +1467,8 @@ struct mlx5_hrxq*
continue;
if (hrxq->tunnel != tunnel)
continue;
+ if (hrxq->rss_level != rss_level)
+ continue;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
if (!ind_tbl)
continue;
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 7763641..626ebe8 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -146,6 +146,7 @@ struct mlx5_hrxq {
struct ibv_qp *qp; /* Verbs queue pair. */
uint64_t hash_fields; /* Verbs Hash fields. */
uint32_t tunnel; /* Tunnel type. */
+ uint8_t rss_level; /* RSS on tunnel level. */
uint8_t rss_key_len; /* Hash key length in bytes. */
uint8_t rss_key[]; /* Hash key. */
};
@@ -243,9 +244,11 @@ struct mlx5_ind_table_ibv *mlx5_priv_ind_table_ibv_get(struct priv *,
int mlx5_priv_ind_table_ibv_release(struct priv *, struct mlx5_ind_table_ibv *);
int mlx5_priv_ind_table_ibv_verify(struct priv *);
struct mlx5_hrxq *mlx5_priv_hrxq_new(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t, uint32_t);
+ uint64_t, uint16_t [], uint16_t,
+ uint32_t, uint8_t);
struct mlx5_hrxq *mlx5_priv_hrxq_get(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t, uint32_t);
+ uint64_t, uint16_t [], uint16_t,
+ uint32_t, uint8_t);
int mlx5_priv_hrxq_release(struct priv *, struct mlx5_hrxq *);
int mlx5_priv_hrxq_ibv_verify(struct priv *);
uint64_t mlx5_priv_get_rx_port_offloads(struct priv *);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 13/18] net/mlx5: support 16 hardware priorities
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (11 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 12/18] net/mlx5: support tunnel RSS level Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 14/18] net/mlx5: add hardware flow debug dump Xueming Li
` (4 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Since OFED 4.3-0.1.3.0, new driver support 16 Verbs priorities, adjust
RTE FLOW priority mapping to:
0-3: RTE FLOW tunnel rule
4-7: RTE FLOW non-tunnel rule
8-15: PMD default control flow
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1e9e3d6..f01c90f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -28,7 +28,16 @@
#include "mlx5_glue.h"
/* Define minimal priority for control plane flows. */
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+/* 16 verb priorities since OFED 4.3, control flow start from 8. */
+#define MLX5_CTRL_FLOW_PRIORITY 8
+#else
+/* 8 Verb priorities before OFED4.3, control flow start from 4. */
#define MLX5_CTRL_FLOW_PRIORITY 4
+#endif
+
+/* Define verb priority span for each flow. */
+#define MLX5_FLOW_PRIORITY_SPAN 4
/* Internet Protocol versions. */
#define MLX5_IPV4 4
@@ -1216,6 +1225,7 @@ struct ibv_spec_header {
struct mlx5_flow_parse *parser)
{
const struct mlx5_flow_items *cur_item = mlx5_flow_items;
+ unsigned int priority_shift = attr->priority;
unsigned int i;
int ret;
@@ -1235,13 +1245,20 @@ struct ibv_spec_header {
if (ret)
return ret;
priv_flow_convert_finalise(priv, parser);
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ /*
+ * 16 priorities since OFED4.3, tunnel rules use highest priority 0-3,
+ * other user-flows use 4-7, control flows use lowest start from 8.
+ */
+ if (!parser->tunnel)
+ priority_shift += MLX5_FLOW_PRIORITY_SPAN;
+#endif
/*
* Second step.
* Allocate the memory space to store verbs specifications.
*/
if (parser->drop) {
- unsigned int priority =
- attr->priority +
+ unsigned int priority = priority_shift +
hash_rxq_init[HASH_RXQ_ETH].flow_priority;
unsigned int offset = parser->queue[HASH_RXQ_ETH].offset;
@@ -1254,8 +1271,7 @@ struct ibv_spec_header {
sizeof(struct ibv_flow_attr);
} else {
for (i = 0; i != hash_rxq_init_n; ++i) {
- unsigned int priority =
- attr->priority +
+ unsigned int priority = priority_shift +
hash_rxq_init[i].flow_priority;
unsigned int offset;
@@ -1299,7 +1315,7 @@ struct ibv_spec_header {
priv_flow_convert_finalise(priv, parser);
} else {
parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
- attr->priority +
+ priority_shift +
hash_rxq_init[parser->layer].flow_priority;
}
if (parser->mark)
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 14/18] net/mlx5: add hardware flow debug dump
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (12 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 13/18] net/mlx5: support 16 hardware priorities Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 15/18] net/mlx5: fix control flow create failure Xueming Li
` (3 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Dump verb flow detail including each flow spec type and size for debug
purpose.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f01c90f..5b95afc 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1994,6 +1994,30 @@ struct ibv_spec_header {
flow->frxq[i].ibv_flow =
mlx5_glue->create_flow(flow->frxq[i].hrxq->qp,
flow->frxq[i].ibv_attr);
+#ifndef NDEBUG
+ uintptr_t spec_ptr;
+ uint16_t j;
+ char buf[256];
+ uint8_t off;
+
+ spec_ptr = (uintptr_t)(flow->frxq[i].ibv_attr + 1);
+ for (j = 0, off = 0; j < flow->frxq[i].ibv_attr->num_of_specs;
+ j++) {
+ struct ibv_flow_spec *spec = (void *)spec_ptr;
+ off += sprintf(buf + off, " %x(%hu)", spec->hdr.type,
+ spec->hdr.size);
+ spec_ptr += spec->hdr.size;
+ }
+ DEBUG("verb flow: qp:%p n_specs:%hhu, size:%hu, priority:%hu, type:%d, flags:%x, comp_mask:%x specs:%s",
+ (void *)flow->frxq[i].hrxq->qp,
+ flow->frxq[i].ibv_attr->num_of_specs,
+ flow->frxq[i].ibv_attr->size,
+ flow->frxq[i].ibv_attr->priority,
+ flow->frxq[i].ibv_attr->type,
+ flow->frxq[i].ibv_attr->flags,
+ flow->frxq[i].ibv_attr->comp_mask,
+ buf);
+#endif
if (!flow->frxq[i].ibv_flow) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 15/18] net/mlx5: fix control flow create failure
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (13 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 14/18] net/mlx5: add hardware flow debug dump Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 16/18] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
` (2 subsequent siblings)
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev, stable
Fix control flow create failure by initializing temp struct variable.
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 5b95afc..7bef702 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2656,6 +2656,7 @@ struct rte_flow *
if (!priv->reta_idx_n)
return EINVAL;
+ memset(&action_rss, 0, sizeof(action_rss));
for (i = 0; i != priv->reta_idx_n; ++i)
action_rss.local.queue[i] = (*priv->reta_idx)[i];
action_rss.local.rss_conf = &priv->rss_conf;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 16/18] net/mlx5: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (14 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 15/18] net/mlx5: fix control flow create failure Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 17/18] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 18/18] doc: update mlx5 guide on tunnel offloading Xueming Li
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Add VXLAN-GPE support to rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 98 +++++++++++++++++++++++++++++++++++++++++---
drivers/net/mlx5/mlx5_rxtx.c | 3 +-
2 files changed, 93 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 7bef702..fe10904 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -89,6 +89,11 @@ struct ibv_flow_spec_counter_action {
void *data);
static int
+mlx5_flow_create_vxlan_gpe(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data);
+
+static int
mlx5_flow_create_gre(const struct rte_flow_item *item,
const void *default_mask,
void *data);
@@ -240,18 +245,22 @@ struct rte_flow {
#define IS_TUNNEL(type) ( \
(type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
+ (type) == RTE_FLOW_ITEM_TYPE_VXLAN_GPE || \
(type) == RTE_FLOW_ITEM_TYPE_GRE)
const uint32_t rte_ptype[] = {
- [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
- RTE_PTYPE_L4_UDP,
- [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+ [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = RTE_PTYPE_TUNNEL_VXLAN_GPE |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
};
#define PTYPE_TUN(t) ((RTE_PTYPE_TUNNEL_MASK & (t)) >> 12)
static const uint32_t ptype_flow_type[] = {
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN_GPE)] = RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
};
/** Structure to generate a simple graph of layers supported by the NIC. */
@@ -307,6 +316,7 @@ struct mlx5_flow_items {
[RTE_FLOW_ITEM_TYPE_END] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
RTE_FLOW_ITEM_TYPE_GRE),
},
[RTE_FLOW_ITEM_TYPE_ETH] = {
@@ -384,7 +394,8 @@ struct mlx5_flow_items {
.dst_sz = sizeof(struct ibv_flow_spec_ipv6),
},
[RTE_FLOW_ITEM_TYPE_UDP] = {
- .items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN),
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_udp){
.hdr = {
@@ -435,6 +446,19 @@ struct mlx5_flow_items {
.convert = mlx5_flow_create_vxlan,
.dst_sz = sizeof(struct ibv_flow_spec_tunnel),
},
+ [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = {
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
+ .actions = valid_actions,
+ .mask = &(const struct rte_flow_item_vxlan_gpe){
+ .vni = "\xff\xff\xff",
+ },
+ .default_mask = &rte_flow_item_vxlan_gpe_mask,
+ .mask_sz = sizeof(struct rte_flow_item_vxlan_gpe),
+ .convert = mlx5_flow_create_vxlan_gpe,
+ .dst_sz = sizeof(struct ibv_flow_spec_tunnel),
+ },
};
/** Structure to pass to the conversion function. */
@@ -1731,6 +1755,68 @@ struct ibv_spec_header {
}
/**
+ * Convert VXLAN-GPE item to Verbs specification.
+ *
+ * @param item[in]
+ * Item specification.
+ * @param default_mask[in]
+ * Default bit-masks to use when item->mask is not provided.
+ * @param data[in, out]
+ * User structure.
+ */
+static int
+mlx5_flow_create_vxlan_gpe(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data)
+{
+ const struct rte_flow_item_vxlan_gpe *spec = item->spec;
+ const struct rte_flow_item_vxlan_gpe *mask = item->mask;
+ struct mlx5_flow_parse *parser = (struct mlx5_flow_parse *)data;
+ unsigned int size = sizeof(struct ibv_flow_spec_tunnel);
+ struct ibv_flow_spec_tunnel vxlan = {
+ .type = parser->inner | IBV_FLOW_SPEC_VXLAN_TUNNEL,
+ .size = size,
+ };
+ union vni {
+ uint32_t vlan_id;
+ uint8_t vni[4];
+ } id;
+ int r;
+
+ id.vni[0] = 0;
+ parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
+ if (spec) {
+ if (!mask)
+ mask = default_mask;
+ memcpy(&id.vni[1], spec->vni, 3);
+ vxlan.val.tunnel_id = id.vlan_id;
+ memcpy(&id.vni[1], mask->vni, 3);
+ vxlan.mask.tunnel_id = id.vlan_id;
+ if (spec->protocol) {
+ r = EINVAL;
+ return r;
+ }
+ /* Remove unwanted bits from values. */
+ vxlan.val.tunnel_id &= vxlan.mask.tunnel_id;
+ }
+ /*
+ * Tunnel id 0 is equivalent as not adding a VXLAN layer, if only this
+ * layer is defined in the Verbs specification it is interpreted as
+ * wildcard and all packets will match this rule, if it follows a full
+ * stack layer (ex: eth / ipv4 / udp), all packets matching the layers
+ * before will also match this rule.
+ * To avoid such situation, VNI 0 is currently refused.
+ */
+ if (!vxlan.val.tunnel_id)
+ return EINVAL;
+ mlx5_flow_create_copy(parser, &vxlan, size);
+ return 0;
+}
+
+/**
* Convert GRE item to Verbs specification.
*
* @param item[in]
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 926e11d..7fc367b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -426,8 +426,7 @@
uint8_t vlan_sz =
(buf->ol_flags & PKT_TX_VLAN_PKT) ? 4 : 0;
const uint64_t is_tunneled =
- buf->ol_flags & (PKT_TX_TUNNEL_GRE |
- PKT_TX_TUNNEL_VXLAN);
+ buf->ol_flags & (PKT_TX_TUNNEL_MASK);
tso_header_sz = buf->l2_len + vlan_sz +
buf->l3_len + buf->l4_len;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 17/18] net/mlx5: allow flow tunnel ID 0 with outer pattern
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (15 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 16/18] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 18/18] doc: update mlx5 guide on tunnel offloading Xueming Li
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Tunnel w/o tunnel id pattern could match any non-tunneled packet,
thus this patch only allow tunnel pattern with outer spec.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index fe10904..eb4b447 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1748,7 +1748,11 @@ struct ibv_spec_header {
* before will also match this rule.
* To avoid such situation, VNI 0 is currently refused.
*/
- if (!vxlan.val.tunnel_id)
+ /*
+ * Tunnel w/o tunnel id pattern could match any non-tunneled packet,
+ * thus only allow tunnel pattern with outer spec.
+ */
+ if (parser->out_layer == HASH_RXQ_ETH && !vxlan.val.tunnel_id)
return EINVAL;
mlx5_flow_create_copy(parser, &vxlan, size);
return 0;
@@ -1810,7 +1814,11 @@ struct ibv_spec_header {
* before will also match this rule.
* To avoid such situation, VNI 0 is currently refused.
*/
- if (!vxlan.val.tunnel_id)
+ /*
+ * Tunnel w/o tunnel id pattern could match any non-tunneled packet,
+ * thus only allow tunnel pattern with outer spec.
+ */
+ if (parser->out_layer == HASH_RXQ_ETH && !vxlan.val.tunnel_id)
return EINVAL;
mlx5_flow_create_copy(parser, &vxlan, size);
return 0;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH 18/18] doc: update mlx5 guide on tunnel offloading
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
` (16 preceding siblings ...)
2018-02-26 15:09 ` [dpdk-dev] [PATCH 17/18] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
@ 2018-02-26 15:09 ` Xueming Li
17 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-02-26 15:09 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler
Cc: Xueming Li, dev
Remove tunnel limitations, add new hardware tunnel offload features.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
doc/guides/nics/mlx5.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 0e6e525..aa8f221 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -100,12 +100,12 @@ Features
- RX interrupts.
- Statistics query including Basic, Extended and per queue.
- Rx HW timestamp.
+- Tunnel types: VXLAN, GRE.
+- Tunnel HW offloads: packet type, inner/outer RSS, IP and UDP checksum verification.
Limitations
-----------
-- Inner RSS for VXLAN frames is not supported yet.
-- Hardware checksum RX offloads for VXLAN inner header are not supported yet.
- For secondary process:
- Forked secondary process not supported.
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
@ 2018-02-27 13:09 ` Ferruh Yigit
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 00/21] MLX5 tunnel Rx offloading Xueming Li
` (39 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Ferruh Yigit @ 2018-02-27 13:09 UTC (permalink / raw)
To: Xueming Li, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Nelio Laranjeiro, Adrien Mazarguil, Shahaf Shuler
Cc: dev
On 2/26/2018 3:09 PM, Xueming Li wrote:
> Currently PMD implementations default RSS on either tunnel outer or
> inner fields. This patch introduced RSS level to allow user to specify
> RSS hash field level of tunneled packets.
>
> 0: outer RSS.
> 1: inner RSS.
> 2-255: deep RSS level.
>
> Please note that tunnels that tightly nested without IP/UDP/TCP layer
> interlaced are deemed as one level. For example the following packet can
> only use level 0 or 1:
> eth / ipv4 / GRE / MPLS / ipv4 / udp
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
> lib/librte_ether/rte_ethdev.h | 9 +++++++++
Please remove the related deprecation notice in this patch.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing
2018-02-26 15:09 ` [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing Xueming Li
@ 2018-02-27 13:10 ` Ferruh Yigit
2018-03-05 10:36 ` Xueming(Steven) Li
0 siblings, 1 reply; 111+ messages in thread
From: Ferruh Yigit @ 2018-02-27 13:10 UTC (permalink / raw)
To: Xueming Li, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Nelio Laranjeiro, Adrien Mazarguil, Shahaf Shuler
Cc: dev
On 2/26/2018 3:09 PM, Xueming Li wrote:
> Support new flow RSS level parameter to select inner or outer RSS
> fields. Example:
>
> flow create 0 ingress pattern eth / ipv4 / udp dst is 4789 / vxlan /
> end actions rss queues 1 2 end level 1 / end
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
> app/test-pmd/cmdline_flow.c | 27 +++++++++++++++++++++++++--
Isn't there any document file to update for this new parameter?
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-02-27 15:25 ` Mohammad Abdul Awal
0 siblings, 0 replies; 111+ messages in thread
From: Mohammad Abdul Awal @ 2018-02-27 15:25 UTC (permalink / raw)
To: dev
On 26/02/2018 15:09, Xueming Li wrote:
> diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> index 45daa91..fe02ad8 100644
> --- a/lib/librte_net/rte_ether.h
> +++ b/lib/librte_net/rte_ether.h
> @@ -310,6 +310,31 @@ struct vxlan_hdr {
> /**< VXLAN tunnel header length. */
>
> /**
> + * VXLAN-GPE protocol header.
> + * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
> + * Identifier and Reserved fields (16 bits and 8 bits).
> + */
> +struct vxlan_gpe_hdr {
> + uint8_t vx_flags; /**< flag (8). */
> + uint8_t reserved[2]; /**< Reserved (16). */
> + uint8_t proto; /**< next-protocol (8). */
> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> +} __attribute__((__packed__));
> +
> +/* VXLAN-GPE next protocol types */
> +#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
> +#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
> +#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
> +#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
> +#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
> +#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
> +#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
> +
> +#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
> + sizeof(struct vxlan_gpe_hdr))
> +/**< VXLAN-GPE tunnel header length. */
> +
> +/**
> * Extract VLAN tag information into mbuf
> *
> * Software version of VLAN stripping
Should we define the VXLAN-GPE protocol and related macros in a separate
file (say lib/librte_net/rte_vxlan_gpe.h)?
I can see that VXLAN header also defined in the rte_ether.h file but we
should consider moving that VXLAN definition in a separate header file
(rte_vxlan.h) as well.
Regards,
Awal.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing
2018-02-27 13:10 ` Ferruh Yigit
@ 2018-03-05 10:36 ` Xueming(Steven) Li
0 siblings, 0 replies; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-03-05 10:36 UTC (permalink / raw)
To: Ferruh Yigit, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Nélio Laranjeiro, Adrien Mazarguil, Shahaf Shuler
Cc: dev
Thanks for reminding, I'll update in next version.
> -----Original Message-----
> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
> Sent: Tuesday, February 27, 2018 9:10 PM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Wenzhuo Lu
> <wenzhuo.lu@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Thomas
> Monjalon <thomas@monjalon.net>; Nélio Laranjeiro
> <nelio.laranjeiro@6wind.com>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level
> parsing
>
> On 2/26/2018 3:09 PM, Xueming Li wrote:
> > Support new flow RSS level parameter to select inner or outer RSS
> > fields. Example:
> >
> > flow create 0 ingress pattern eth / ipv4 / udp dst is 4789 / vxlan
> > / end actions rss queues 1 2 end level 1 / end
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > ---
> > app/test-pmd/cmdline_flow.c | 27 +++++++++++++++++++++++++--
>
> Isn't there any document file to update for this new parameter?
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 00/21] MLX5 tunnel Rx offloading
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
2018-02-27 13:09 ` Ferruh Yigit
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 01/21] ethdev: support tunnel RSS level Xueming Li
` (38 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset supports MLX5 RX offloading(checksum, inner rss, inner ptype) for VXLAN(starndard L2/nonstandard L3), GRE and VXLAN-GPE based on rte flow.
V0 patchset was based on follwoing patchset:
http://www.dpdk.org/dev/patchwork/patch/35005/
http://www.dpdk.org/dev/patchwork/patch/31757/
Next version will be based on Adrien's new flow action api:
http://www.dpdk.org/dev/patchwork/patch/35178/
Shahaf Shuler (1):
net/mlx5: fix tunnel offloads cap query
Xueming Li (20):
ethdev: support tunnel RSS level
app/testpmd: support flow RSS level parsing
ethdev: introduce new tunnel VXLAN-GPE
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
net/mlx5: support GRE tunnel flow
net/mlx5: support L3 vxlan
net/mlx5: support tunnel inner csum offloads
net/mlx5: support packet tunnel type
net/mlx5: split flow RSS handling logic
net/mlx5: support tunnel RSS level
net/mlx5: support 16 hardware priorities
net/mlx5: add hardware flow debug dump
net/mlx5: fix control flow create failure
net/mlx5: introduce new tunnel VXLAN-GPE
net/mlx5: allow flow tunnel ID 0 with outer pattern
doc: update mlx5 guide on tunnel offloading
doc: remove announce of ethdev API change for RSS configuration
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
net/mlx5: support MPLS-in-GRE and MPLS-in-UDP flow pattern
app/test-pmd/cmdline_flow.c | 51 ++-
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 ++++-
app/test-pmd/parameters.c | 12 +-
app/test-pmd/testpmd.h | 2 +
doc/guides/nics/mlx5.rst | 4 +-
doc/guides/rel_notes/deprecation.rst | 4 -
doc/guides/testpmd_app_ug/run_app.rst | 5 +
drivers/net/mlx5/Makefile | 6 +-
drivers/net/mlx5/mlx5.c | 39 +-
drivers/net/mlx5/mlx5.h | 4 +-
drivers/net/mlx5/mlx5_flow.c | 696 ++++++++++++++++++++++++++++------
drivers/net/mlx5/mlx5_rxq.c | 61 ++-
drivers/net/mlx5/mlx5_rxtx.c | 33 +-
drivers/net/mlx5/mlx5_rxtx.h | 11 +-
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 21 +-
drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 17 +-
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_ethdev.h | 9 +
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 +++
lib/librte_net/rte_ether.h | 25 ++
26 files changed, 986 insertions(+), 204 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 01/21] ethdev: support tunnel RSS level
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
2018-02-27 13:09 ` Ferruh Yigit
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 00/21] MLX5 tunnel Rx offloading Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 02/21] app/testpmd: support flow RSS level parsing Xueming Li
` (37 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Currently PMD implementations default RSS on either tunnel outer or
inner fields. This patch introduced RSS level to allow user to specify
RSS hash field level of tunneled packets.
0: outer RSS.
1: inner RSS.
2-255: deep RSS level.
Please note that tunnels that tightly nested without IP/UDP/TCP layer
interlaced are deemed as one level. For example the following packet can
only use level 0 or 1:
eth / ipv4 / GRE / MPLS / ipv4 / udp
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_ether/rte_ethdev.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0361533..baaeb3c 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -398,6 +398,15 @@ struct rte_eth_rss_conf {
uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */
uint8_t rss_key_len; /**< hash key length in bytes. */
uint64_t rss_hf; /**< Hash functions to apply - see below. */
+ /**
+ * RSS hash calculation on tunnel level:
+ * 0: outer RSS, default.
+ * 1: inner RSS.
+ * 2-255: deep RSS level.
+ * Please note that tunnels not interlaced with [IP|TCP|UDP] are
+ * deemed as one level, such as MPLS over GRE.
+ */
+ uint8_t rss_level;
};
/*
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 02/21] app/testpmd: support flow RSS level parsing
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (2 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 01/21] ethdev: support tunnel RSS level Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 03/21] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (36 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Support new flow RSS level parameter to select inner or outer RSS
fields. Example:
flow create 0 ingress pattern eth / ipv4 / udp dst is 4789 / vxlan /
end actions rss queues 1 2 end level 1 / end
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index a5cf84f..921220d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -169,6 +169,7 @@ enum index {
ACTION_RSS,
ACTION_RSS_QUEUES,
ACTION_RSS_QUEUE,
+ ACTION_RSS_LEVEL,
ACTION_PF,
ACTION_VF,
ACTION_VF_ORIGINAL,
@@ -190,7 +191,8 @@ enum index {
/** Storage size for struct rte_flow_action_rss including queues. */
#define ACTION_RSS_SIZE \
(offsetof(struct rte_flow_action_rss, queue) + \
- sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM)
+ sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM + \
+ sizeof(struct rte_eth_rss_conf))
/** Maximum number of subsequent tokens and arguments on the stack. */
#define CTX_STACK_SIZE 16
@@ -623,6 +625,7 @@ struct parse_action_priv {
static const enum index action_rss[] = {
ACTION_RSS_QUEUES,
+ ACTION_RSS_LEVEL,
ACTION_NEXT,
ZERO,
};
@@ -640,6 +643,12 @@ struct parse_action_priv {
ZERO,
};
+static struct arg rss_level_arg = {
+ .offset = ACTION_RSS_SIZE - sizeof(struct rte_eth_rss_conf) +
+ offsetof(struct rte_eth_rss_conf, rss_level),
+ .size = sizeof(((struct rte_eth_rss_conf *)0)->rss_level),
+};
+
static int parse_init(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
@@ -1589,6 +1598,13 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
.call = parse_vc_action_rss_queue,
.comp = comp_vc_action_rss_queue,
},
+ [ACTION_RSS_LEVEL] = {
+ .name = "level",
+ .help = "rss on tunnel level",
+ .next = NEXT(action_rss, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(&rss_level_arg),
+ .call = parse_vc_conf,
+ },
[ACTION_PF] = {
.name = "pf",
.help = "redirect packets to physical device function",
@@ -1890,6 +1906,7 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
sizeof(double));
if ((uint8_t *)item + sizeof(*item) > data)
return -1;
+ memset(data, 0, data_size);
*item = (struct rte_flow_item){
.type = priv->type,
};
@@ -1907,14 +1924,20 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
sizeof(double));
if ((uint8_t *)action + sizeof(*action) > data)
return -1;
+ memset(data, 0, data_size);
*action = (struct rte_flow_action){
.type = priv->type,
};
+ if (ctx->curr == ACTION_RSS) {
+ struct rte_flow_action_rss *rss = (void *)data;
+
+ rss->rss_conf = RTE_PTR_ADD(rss, data_size -
+ sizeof(*rss->rss_conf));
+ }
++out->args.vc.actions_n;
ctx->object = action;
ctx->objmask = NULL;
}
- memset(data, 0, data_size);
out->args.vc.data = data;
ctx->objdata = data_size;
return len;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 03/21] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (3 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 02/21] app/testpmd: support flow RSS level parsing Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 04/21] app/testpmd: " Xueming Li
` (35 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
8 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59a..5ea8ae2 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 38f2d27..a32242a 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -49,6 +49,7 @@ struct rte_flow_desc_data {
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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),
MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 13e4202..8fa0397 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -244,6 +244,13 @@ enum rte_flow_item_type {
RTE_FLOW_ITEM_TYPE_VXLAN,
/**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+
+ /**
* Matches a E_TAG header.
*
* See struct rte_flow_item_e_tag.
@@ -630,6 +637,26 @@ struct rte_flow_item_vxlan {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flag). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* RTE_FLOW_ITEM_TYPE_E_TAG.
*
* Matches a E-tag header.
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 091d388..dc90379 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -439,6 +440,8 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 6274025..1839cf2 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefac..49106c7 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a3381..7caf833 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index 45daa91..fe02ad8 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -310,6 +310,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header.
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 04/21] app/testpmd: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (4 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 03/21] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 05/21] app/testpmd: add more GRE extension support to csum engine Xueming Li
` (34 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 24 ++++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 +++
6 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 921220d..ec451dd 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -133,6 +133,8 @@ enum index {
ITEM_SCTP_CKSUM,
ITEM_VXLAN,
ITEM_VXLAN_VNI,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
ITEM_E_TAG,
ITEM_E_TAG_GRP_ECID_B,
ITEM_NVGRE,
@@ -429,6 +431,7 @@ struct parse_action_priv {
ITEM_TCP,
ITEM_SCTP,
ITEM_VXLAN,
+ ITEM_VXLAN_GPE,
ITEM_E_TAG,
ITEM_NVGRE,
ITEM_MPLS,
@@ -551,6 +554,12 @@ struct parse_action_priv {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index item_e_tag[] = {
ITEM_E_TAG_GRP_ECID_B,
ITEM_NEXT,
@@ -1363,6 +1372,21 @@ static int comp_vc_action_rss_queue(struct context *, const struct token *,
.next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
[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 4bb255c..2f74a7b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -971,6 +971,7 @@ struct rss_type_info {
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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
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)),
@@ -3016,6 +3017,7 @@ struct igb_ring_desc_16_bytes {
{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
{"port", RTE_ETH_FLOW_PORT},
{"vxlan", RTE_ETH_FLOW_VXLAN},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
};
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64..2138883 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ struct simple_gre_hdr {
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* check udp destination port, 4790 is the default vxlan-gpe port */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPv4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ struct simple_gre_hdr {
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ struct simple_gre_hdr {
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 97d22b8..d7489bc 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -186,6 +186,7 @@
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -621,6 +622,7 @@
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1092,6 +1094,14 @@
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 153abea..4cec239 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -433,6 +433,8 @@ enum tx_pkt_split {
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd5395..2e8690f 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -479,3 +479,8 @@ The commandline options are:
Set the hexadecimal bitmask of TX queue offloads.
The default value is 0.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 05/21] app/testpmd: add more GRE extension support to csum engine
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (5 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 04/21] app/testpmd: " Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 06/21] net/mlx5: fix tunnel offloads cap query Xueming Li
` (33 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 2138883..b73b8fe 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ struct simple_gre_hdr {
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ struct simple_gre_hdr {
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 06/21] net/mlx5: fix tunnel offloads cap query
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (6 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 05/21] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 07/21] net/mlx5: support GRE tunnel flow Xueming Li
` (32 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: dev, stable
From: Shahaf Shuler <shahafs@mellanox.com>
The query for the tunnel stateless offloads is wrongly implemented
because of:
1. It was using the device id to query for the offloads.
2. It was using a compilation flag for Verbs which no longer exits.
The main reason was lack of proper API from Verbs.
Fixing the query to use rdma-core API. The capability returned from
rdma-core refer to both Tx and Rx sides.
Eventhough there is a separate cap for GRE and VXLAN, implementation merge
them into a single flag in order to simplify the checks on the data
path.
Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Fixes: f5fde5205101 ("net/mlx5: add hardware checksum offload for tunnel packets")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
drivers/net/mlx5/Makefile | 6 +++---
drivers/net/mlx5/mlx5.c | 39 +++++++++++++++------------------------
drivers/net/mlx5/mlx5.h | 4 ++--
drivers/net/mlx5/mlx5_rxq.c | 2 +-
4 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 3bc9736..afda411 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -125,9 +125,9 @@ mlx5_autoconf.h.new: FORCE
mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
$Q $(RM) -f -- '$@'
$Q sh -- '$<' '$@' \
- HAVE_IBV_DEVICE_VXLAN_SUPPORT \
- infiniband/verbs.h \
- enum IBV_DEVICE_VXLAN_SUPPORT \
+ HAVE_IBV_DEVICE_TUNNEL_SUPPORT \
+ infiniband/mlx5dv.h \
+ enum MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS \
$(AUTOCONF_OUTPUT)
$Q sh -- '$<' '$@' \
HAVE_IBV_WQ_FLAG_RX_END_PADDING \
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 6c0985b..61cb931 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -584,7 +584,7 @@
unsigned int tunnel_en = 0;
int idx;
int i;
- struct mlx5dv_context attrs_out;
+ struct mlx5dv_context attrs_out = {0};
#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
struct ibv_counter_set_description cs_desc;
#endif
@@ -633,20 +633,6 @@
PCI_DEVICE_ID_MELLANOX_CONNECTX5VF) ||
(pci_dev->id.device_id ==
PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF));
- switch (pci_dev->id.device_id) {
- case PCI_DEVICE_ID_MELLANOX_CONNECTX4:
- tunnel_en = 1;
- break;
- case PCI_DEVICE_ID_MELLANOX_CONNECTX4LX:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5VF:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5EX:
- case PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF:
- tunnel_en = 1;
- break;
- default:
- break;
- }
INFO("PCI information matches, using device \"%s\""
" (SR-IOV: %s)",
list[i]->name,
@@ -675,6 +661,9 @@
* Multi-packet send is supported by ConnectX-4 Lx PF as well
* as all ConnectX-5 devices.
*/
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ attrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS;
+#endif
mlx5_glue->dv_query_device(attr_ctx, &attrs_out);
if (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED) {
if (attrs_out.flags & MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW) {
@@ -693,6 +682,17 @@
cqe_comp = 0;
else
cqe_comp = 1;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ if (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS) {
+ tunnel_en = ((attrs_out.tunnel_offloads_caps &
+ MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN) &&
+ (attrs_out.tunnel_offloads_caps &
+ MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE));
+ }
+ DEBUG("Tunnel offloading is %ssupported", tunnel_en ? "" : "not ");
+#else
+ WARN("Tunnel offloading disabled due to old OFED/rdma-core version");
+#endif
if (mlx5_glue->query_device_ex(attr_ctx, NULL, &device_attr))
goto error;
INFO("%u port(s) detected", device_attr.orig_attr.phys_port_cnt);
@@ -838,15 +838,6 @@
IBV_DEVICE_RAW_IP_CSUM);
DEBUG("checksum offloading is %ssupported",
(config.hw_csum ? "" : "not "));
-
-#ifdef HAVE_IBV_DEVICE_VXLAN_SUPPORT
- config.hw_csum_l2tun =
- !!(exp_device_attr.exp_device_cap_flags &
- IBV_DEVICE_VXLAN_SUPPORT);
-#endif
- DEBUG("Rx L2 tunnel checksum offloads are %ssupported",
- (config.hw_csum_l2tun ? "" : "not "));
-
#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
config.flow_counter_en = !!(device_attr.max_counter_sets);
mlx5_glue->describe_counter_set(ctx, 0, &cs_desc);
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 965c19f..3e2d96a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -75,13 +75,13 @@ struct mlx5_xstats_ctrl {
*/
struct mlx5_dev_config {
unsigned int hw_csum:1; /* Checksum offload is supported. */
- unsigned int hw_csum_l2tun:1; /* Same for L2 tunnels. */
unsigned int hw_vlan_strip:1; /* VLAN stripping is supported. */
unsigned int hw_fcs_strip:1; /* FCS stripping is supported. */
unsigned int hw_padding:1; /* End alignment padding is supported. */
unsigned int sriov:1; /* This is a VF or PF with VF devices. */
unsigned int mps:2; /* Multi-packet send supported mode. */
- unsigned int tunnel_en:1; /* Whether tunnel is supported. */
+ unsigned int tunnel_en:1;
+ /* Whether tunnel stateless offloads are supported. */
unsigned int flow_counter_en:1; /* Whether flow counter is supported. */
unsigned int cqe_comp:1; /* CQE compression is enabled. */
unsigned int tso:1; /* Whether TSO is supported. */
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index ff58c49..238fa7e 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1006,7 +1006,7 @@ struct mlx5_rxq_ctrl*
/* Toggle RX checksum offload if hardware supports it. */
tmpl->rxq.csum = !!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM);
tmpl->rxq.csum_l2tun = (!!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM) &&
- priv->config.hw_csum_l2tun);
+ priv->config.tunnel_en);
tmpl->rxq.hw_timestamp = !!(conf->offloads & DEV_RX_OFFLOAD_TIMESTAMP);
/* Configure VLAN stripping. */
tmpl->rxq.vlan_strip = !!(conf->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 07/21] net/mlx5: support GRE tunnel flow
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (7 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 06/21] net/mlx5: fix tunnel offloads cap query Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 08/21] net/mlx5: support L3 vxlan Xueming Li
` (31 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Support GRE tunnel type in RTE FLOW.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 67 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 60 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 26002c4..2acd42b 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -79,6 +79,11 @@ struct ibv_flow_spec_counter_action {
const void *default_mask,
void *data);
+static int
+mlx5_flow_create_gre(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data);
+
struct mlx5_flow_parse;
static void
@@ -222,6 +227,10 @@ struct rte_flow {
__VA_ARGS__, RTE_FLOW_ITEM_TYPE_END, \
}
+#define IS_TUNNEL(type) ( \
+ (type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
+ (type) == RTE_FLOW_ITEM_TYPE_GRE)
+
/** Structure to generate a simple graph of layers supported by the NIC. */
struct mlx5_flow_items {
/** List of possible actions for these items. */
@@ -274,7 +283,8 @@ struct mlx5_flow_items {
static const struct mlx5_flow_items mlx5_flow_items[] = {
[RTE_FLOW_ITEM_TYPE_END] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
- RTE_FLOW_ITEM_TYPE_VXLAN),
+ RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_GRE),
},
[RTE_FLOW_ITEM_TYPE_ETH] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_VLAN,
@@ -305,7 +315,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_IPV4] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_UDP,
- RTE_FLOW_ITEM_TYPE_TCP),
+ RTE_FLOW_ITEM_TYPE_TCP,
+ RTE_FLOW_ITEM_TYPE_GRE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_ipv4){
.hdr = {
@@ -322,7 +333,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_IPV6] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_UDP,
- RTE_FLOW_ITEM_TYPE_TCP),
+ RTE_FLOW_ITEM_TYPE_TCP,
+ RTE_FLOW_ITEM_TYPE_GRE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_ipv6){
.hdr = {
@@ -375,6 +387,18 @@ struct mlx5_flow_items {
.convert = mlx5_flow_create_tcp,
.dst_sz = sizeof(struct ibv_flow_spec_tcp_udp),
},
+ [RTE_FLOW_ITEM_TYPE_GRE] = {
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
+ .actions = valid_actions,
+ .mask = &(const struct rte_flow_item_gre){
+ .protocol = -1,
+ },
+ .default_mask = &rte_flow_item_gre_mask,
+ .mask_sz = sizeof(struct rte_flow_item_gre),
+ .convert = mlx5_flow_create_gre,
+ .dst_sz = sizeof(struct ibv_flow_spec_tunnel),
+ },
[RTE_FLOW_ITEM_TYPE_VXLAN] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH),
.actions = valid_actions,
@@ -390,7 +414,7 @@ struct mlx5_flow_items {
/** Structure to pass to the conversion function. */
struct mlx5_flow_parse {
- uint32_t inner; /**< Set once VXLAN is encountered. */
+ uint32_t inner; /**< Verb spec, set once tunnel is encountered. */
uint32_t create:1;
/**< Whether resources should remain after a validate. */
uint32_t drop:1; /**< Target is a drop queue. */
@@ -815,13 +839,13 @@ struct ibv_spec_header {
cur_item->mask_sz);
if (err)
goto exit_item_not_supported;
- if (items->type == RTE_FLOW_ITEM_TYPE_VXLAN) {
+ if (IS_TUNNEL(items->type)) {
if (parser->inner) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
- "cannot recognize multiple"
- " VXLAN encapsulations");
+ "Cannot recognize multiple"
+ " tunnel encapsulations.");
return -rte_errno;
}
parser->inner = IBV_FLOW_SPEC_INNER;
@@ -1548,6 +1572,35 @@ struct ibv_spec_header {
}
/**
+ * Convert GRE item to Verbs specification.
+ *
+ * @param item[in]
+ * Item specification.
+ * @param default_mask[in]
+ * Default bit-masks to use when item->mask is not provided.
+ * @param data[in, out]
+ * User structure.
+ */
+static int
+mlx5_flow_create_gre(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data)
+{
+ struct mlx5_flow_parse *parser = (struct mlx5_flow_parse *)data;
+ unsigned int size = sizeof(struct ibv_flow_spec_tunnel);
+ struct ibv_flow_spec_tunnel tunnel = {
+ .type = parser->inner | IBV_FLOW_SPEC_VXLAN_TUNNEL,
+ .size = size,
+ };
+
+ (void)item;
+ (void)default_mask;
+ parser->inner = IBV_FLOW_SPEC_INNER;
+ mlx5_flow_create_copy(parser, &tunnel, size);
+ return 0;
+}
+
+/**
* Convert mark/flag action to Verbs specification.
*
* @param parser
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 08/21] net/mlx5: support L3 vxlan
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (8 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 07/21] net/mlx5: support GRE tunnel flow Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 09/21] net/mlx5: support tunnel inner csum offloads Xueming Li
` (30 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
This patch add L3 vxlan support which don't have inner L2 header
comparing to standard vxlan protocol.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2acd42b..10f6413 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -400,7 +400,9 @@ struct mlx5_flow_items {
.dst_sz = sizeof(struct ibv_flow_spec_tunnel),
},
[RTE_FLOW_ITEM_TYPE_VXLAN] = {
- .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH),
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_vxlan){
.vni = "\xff\xff\xff",
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 09/21] net/mlx5: support tunnel inner csum offloads
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (9 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 08/21] net/mlx5: support L3 vxlan Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 10/21] net/mlx5: support packet tunnel type Xueming Li
` (29 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
PKT_RX_IP_CKSUM_GOOD and PKT_RX_L4_CKSUM_GOOD of mubf.ol_flags now are
inner header checksum when packet is tunneled.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 13 +++++++++++++
drivers/net/mlx5/mlx5_rxq.c | 2 --
drivers/net/mlx5/mlx5_rxtx.c | 18 ++++--------------
drivers/net/mlx5/mlx5_rxtx.h | 1 -
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 10f6413..755355e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -812,8 +812,15 @@ struct ibv_spec_header {
{
const struct mlx5_flow_items *cur_item = mlx5_flow_items;
unsigned int i;
+ int csum_en = 0;
+ struct mlx5_rxq_data *q;
(void)priv;
+ /* Check if checksum offloading */
+ for (i = 0; i != parser->queues_n; ++i) {
+ q = (*priv->rxqs)[parser->queues[i]];
+ csum_en |= q->csum;
+ }
/* Initialise the offsets to start after verbs attribute. */
for (i = 0; i != hash_rxq_init_n; ++i)
parser->queue[i].offset = sizeof(struct ibv_flow_attr);
@@ -850,6 +857,12 @@ struct ibv_spec_header {
" tunnel encapsulations.");
return -rte_errno;
}
+ if (!priv->config.tunnel_en && csum_en)
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ items,
+ "Cannot support hw tunnel checksum "
+ "offloads");
parser->inner = IBV_FLOW_SPEC_INNER;
}
if (parser->drop) {
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 238fa7e..9bc8b30 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1005,8 +1005,6 @@ struct mlx5_rxq_ctrl*
}
/* Toggle RX checksum offload if hardware supports it. */
tmpl->rxq.csum = !!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM);
- tmpl->rxq.csum_l2tun = (!!(conf->offloads & DEV_RX_OFFLOAD_CHECKSUM) &&
- priv->config.tunnel_en);
tmpl->rxq.hw_timestamp = !!(conf->offloads & DEV_RX_OFFLOAD_TIMESTAMP);
/* Configure VLAN stripping. */
tmpl->rxq.vlan_strip = !!(conf->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index dc4ead9..d9bfc9b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -41,7 +41,7 @@
uint16_t cqe_cnt, uint32_t *rss_hash);
static __rte_always_inline uint32_t
-rxq_cq_to_ol_flags(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe);
+rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe);
uint32_t mlx5_ptype_table[] __rte_cache_aligned = {
[0xff] = RTE_PTYPE_ALL_MASK, /* Last entry for errored packet. */
@@ -1688,8 +1688,6 @@
/**
* Translate RX completion flags to offload flags.
*
- * @param[in] rxq
- * Pointer to RX queue structure.
* @param[in] cqe
* Pointer to CQE.
*
@@ -1697,7 +1695,7 @@
* Offload flags (ol_flags) for struct rte_mbuf.
*/
static inline uint32_t
-rxq_cq_to_ol_flags(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe)
+rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe)
{
uint32_t ol_flags = 0;
uint16_t flags = rte_be_to_cpu_16(cqe->hdr_type_etc);
@@ -1709,14 +1707,6 @@
TRANSPOSE(flags,
MLX5_CQE_RX_L4_HDR_VALID,
PKT_RX_L4_CKSUM_GOOD);
- if ((cqe->pkt_info & MLX5_CQE_RX_TUNNEL_PACKET) && (rxq->csum_l2tun))
- ol_flags |=
- TRANSPOSE(flags,
- MLX5_CQE_RX_L3_HDR_VALID,
- PKT_RX_IP_CKSUM_GOOD) |
- TRANSPOSE(flags,
- MLX5_CQE_RX_L4_HDR_VALID,
- PKT_RX_L4_CKSUM_GOOD);
return ol_flags;
}
@@ -1815,8 +1805,8 @@
mlx5_flow_mark_get(mark);
}
}
- if (rxq->csum | rxq->csum_l2tun)
- pkt->ol_flags |= rxq_cq_to_ol_flags(rxq, cqe);
+ if (rxq->csum)
+ pkt->ol_flags |= rxq_cq_to_ol_flags(cqe);
if (rxq->vlan_strip &&
(cqe->hdr_type_etc &
rte_cpu_to_be_16(MLX5_CQE_VLAN_STRIPPED))) {
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index d7e8905..7fce001 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -77,7 +77,6 @@ struct rxq_zip {
/* RX queue descriptor. */
struct mlx5_rxq_data {
unsigned int csum:1; /* Enable checksum offloading. */
- unsigned int csum_l2tun:1; /* Same for L2 tunnels. */
unsigned int hw_timestamp:1; /* Enable HW timestamp. */
unsigned int vlan_strip:1; /* Enable VLAN stripping. */
unsigned int crc_present:1; /* CRC must be subtracted. */
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 10/21] net/mlx5: support packet tunnel type
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (10 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 09/21] net/mlx5: support tunnel inner csum offloads Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 11/21] net/mlx5: split flow RSS handling logic Xueming Li
` (28 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Support packet tunnel type identification based on rte_flow rule.
If rules of multiple tunnel types specified on same queue,
RTE_PTYPE_TUNNEL_MASK will be returned as tunnel type, it's user's
responsibility to set bits in flow mark as tunnel type identifier.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 72 +++++++++++++++++++++++++++++++----
drivers/net/mlx5/mlx5_rxq.c | 13 ++++++-
drivers/net/mlx5/mlx5_rxtx.c | 12 ++++--
drivers/net/mlx5/mlx5_rxtx.h | 7 +++-
drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 21 ++++++----
drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 17 +++++++--
6 files changed, 115 insertions(+), 27 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 755355e..0f59de6 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -215,6 +215,7 @@ struct rte_flow {
uint16_t (*queues)[]; /**< Queues indexes to use. */
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
+ uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counters for the rule. */
struct mlx5_flow_counter_stats counter_stats;/**<The counter stats. */
struct mlx5_flow frxq[RTE_DIM(hash_rxq_init)];
@@ -231,6 +232,18 @@ struct rte_flow {
(type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
(type) == RTE_FLOW_ITEM_TYPE_GRE)
+const uint32_t rte_ptype[] = {
+ [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+};
+
+#define PTYPE_TUN(t) ((RTE_PTYPE_TUNNEL_MASK & (t)) >> 12)
+static const uint32_t ptype_flow_type[] = {
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
+};
+
/** Structure to generate a simple graph of layers supported by the NIC. */
struct mlx5_flow_items {
/** List of possible actions for these items. */
@@ -428,6 +441,7 @@ struct mlx5_flow_parse {
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
enum hash_rxq_type layer; /**< Last pattern layer detected. */
+ uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counter set for the rule */
struct {
struct ibv_flow_attr *ibv_attr;
@@ -849,7 +863,7 @@ struct ibv_spec_header {
if (err)
goto exit_item_not_supported;
if (IS_TUNNEL(items->type)) {
- if (parser->inner) {
+ if (parser->tunnel) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
@@ -864,6 +878,7 @@ struct ibv_spec_header {
"Cannot support hw tunnel checksum "
"offloads");
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[items->type];
}
if (parser->drop) {
parser->queue[HASH_RXQ_ETH].offset += cur_item->dst_sz;
@@ -1132,6 +1147,7 @@ struct ibv_spec_header {
}
/* Third step. Conversion parse, fill the specifications. */
parser->inner = 0;
+ parser->tunnel = 0;
for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) {
if (items->type == RTE_FLOW_ITEM_TYPE_VOID)
continue;
@@ -1562,6 +1578,7 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
if (spec) {
if (!mask)
mask = default_mask;
@@ -1611,6 +1628,7 @@ struct ibv_spec_header {
(void)item;
(void)default_mask;
parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
mlx5_flow_create_copy(parser, &tunnel, size);
return 0;
}
@@ -1783,7 +1801,8 @@ struct ibv_spec_header {
parser->rss_conf.rss_key_len,
hash_fields,
parser->queues,
- parser->queues_n);
+ parser->queues_n,
+ parser->tunnel);
if (flow->frxq[i].hrxq)
continue;
flow->frxq[i].hrxq =
@@ -1792,7 +1811,8 @@ struct ibv_spec_header {
parser->rss_conf.rss_key_len,
hash_fields,
parser->queues,
- parser->queues_n);
+ parser->queues_n,
+ parser->tunnel);
if (!flow->frxq[i].hrxq) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
@@ -1858,8 +1878,16 @@ struct ibv_spec_header {
for (i = 0; i != parser->queues_n; ++i) {
struct mlx5_rxq_data *q =
(*priv->rxqs)[parser->queues[i]];
+ struct mlx5_rxq_ctrl *rxq_ctrl =
+ container_of(q, struct mlx5_rxq_ctrl, rxq);
+ uint8_t tunnel = PTYPE_TUN(parser->tunnel);
q->mark |= parser->mark;
+ if (parser->tunnel)
+ rxq_ctrl->tunnel_types[tunnel] += 1;
+ if (q->tunnel != parser->tunnel)
+ q->tunnel = q->tunnel ? RTE_PTYPE_TUNNEL_MASK :
+ parser->tunnel;
}
return 0;
error:
@@ -1932,6 +1960,7 @@ struct ibv_spec_header {
flow->queues = (uint16_t (*)[])(flow + 1);
memcpy(flow->queues, parser.queues, parser.queues_n * sizeof(uint16_t));
flow->queues_n = parser.queues_n;
+ flow->tunnel = parser.tunnel;
flow->mark = parser.mark;
/* Copy RSS configuration. */
flow->rss_conf = parser.rss_conf;
@@ -2021,9 +2050,36 @@ struct rte_flow *
{
unsigned int i;
- if (flow->drop || !flow->mark)
+ if (flow->drop)
goto free;
- for (i = 0; i != flow->queues_n; ++i) {
+ for (i = 0; flow->tunnel && i != flow->queues_n; ++i) {
+ /* Update queue tunnel type. */
+ struct mlx5_rxq_data *rxq = (*priv->rxqs)[(*flow->queues)[i]];
+ struct mlx5_rxq_ctrl *rxq_ctrl =
+ container_of(rxq, struct mlx5_rxq_ctrl, rxq);
+ uint8_t tunnel = PTYPE_TUN(flow->tunnel);
+
+ RTE_ASSERT(rxq_ctrl->tunnel_types[tunnel] > 0);
+ rxq_ctrl->tunnel_types[tunnel] -= 1;
+ if (!rxq_ctrl->tunnel_types[tunnel]) {
+ /* Update tunnel type. */
+ uint8_t j;
+ uint8_t types = 0;
+ uint8_t last;
+
+ for (j = 0; j < RTE_DIM(rxq_ctrl->tunnel_types); j++)
+ if (rxq_ctrl->tunnel_types[j]) {
+ types += 1;
+ last = j;
+ }
+ /* Keep same if more than one tunnel types left. */
+ if (types == 1)
+ rxq->tunnel = rte_ptype[ptype_flow_type[last]];
+ else if (types == 0) /* No tunnel type left. */
+ rxq->tunnel = 0;
+ }
+ }
+ for (i = 0; flow->mark && i != flow->queues_n; ++i) {
struct rte_flow *tmp;
int mark = 0;
@@ -2315,7 +2371,8 @@ struct rte_flow *
flow->rss_conf.rss_key_len,
hash_rxq_init[i].hash_fields,
(*flow->queues),
- flow->queues_n);
+ flow->queues_n,
+ flow->tunnel);
if (flow->frxq[i].hrxq)
goto flow_create;
flow->frxq[i].hrxq =
@@ -2323,7 +2380,8 @@ struct rte_flow *
flow->rss_conf.rss_key_len,
hash_rxq_init[i].hash_fields,
(*flow->queues),
- flow->queues_n);
+ flow->queues_n,
+ flow->tunnel);
if (!flow->frxq[i].hrxq) {
DEBUG("Flow %p cannot be applied",
(void *)flow);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 9bc8b30..09ef189 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1325,13 +1325,16 @@ struct mlx5_ind_table_ibv*
* first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
+ * @param tunnel
+ * Tunnel type.
*
* @return
* An hash Rx queue on success.
*/
struct mlx5_hrxq*
mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
- uint64_t hash_fields, uint16_t queues[], uint16_t queues_n)
+ uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
+ uint32_t tunnel)
{
struct mlx5_hrxq *hrxq;
struct mlx5_ind_table_ibv *ind_tbl;
@@ -1369,6 +1372,7 @@ struct mlx5_hrxq*
hrxq->qp = qp;
hrxq->rss_key_len = rss_key_len;
hrxq->hash_fields = hash_fields;
+ hrxq->tunnel = tunnel;
memcpy(hrxq->rss_key, rss_key, rss_key_len);
rte_atomic32_inc(&hrxq->refcnt);
LIST_INSERT_HEAD(&priv->hrxqs, hrxq, next);
@@ -1394,13 +1398,16 @@ struct mlx5_hrxq*
* first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
+ * @param tunnel
+ * Tunnel type.
*
* @return
* An hash Rx queue on success.
*/
struct mlx5_hrxq*
mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
- uint64_t hash_fields, uint16_t queues[], uint16_t queues_n)
+ uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
+ uint32_t tunnel)
{
struct mlx5_hrxq *hrxq;
@@ -1414,6 +1421,8 @@ struct mlx5_hrxq*
continue;
if (hrxq->hash_fields != hash_fields)
continue;
+ if (hrxq->tunnel != tunnel)
+ continue;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
if (!ind_tbl)
continue;
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d9bfc9b..926e11d 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -34,7 +34,7 @@
#include "mlx5_prm.h"
static __rte_always_inline uint32_t
-rxq_cq_to_pkt_type(volatile struct mlx5_cqe *cqe);
+rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe);
static __rte_always_inline int
mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
@@ -109,12 +109,14 @@
(*p)[0x8a] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_L4_UDP;
/* Tunneled - L3 */
+ (*p)[0x40] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
(*p)[0x41] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
(*p)[0x42] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
+ (*p)[0xc0] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
(*p)[0xc1] = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
RTE_PTYPE_INNER_L4_NONFRAG;
@@ -1541,6 +1543,8 @@
/**
* Translate RX completion flags to packet type.
*
+ * @param[in] rxq
+ * Pointer to RX queue structure.
* @param[in] cqe
* Pointer to CQE.
*
@@ -1550,7 +1554,7 @@
* Packet type for struct rte_mbuf.
*/
static inline uint32_t
-rxq_cq_to_pkt_type(volatile struct mlx5_cqe *cqe)
+rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe)
{
uint8_t idx;
uint8_t pinfo = cqe->pkt_info;
@@ -1565,7 +1569,7 @@
* bit[7] = outer_l3_type
*/
idx = ((pinfo & 0x3) << 6) | ((ptype & 0xfc00) >> 10);
- return mlx5_ptype_table[idx];
+ return mlx5_ptype_table[idx] | rxq->tunnel * !!(idx & (1 << 6));
}
/**
@@ -1787,7 +1791,7 @@
pkt = seg;
assert(len >= (rxq->crc_present << 2));
/* Update packet information. */
- pkt->packet_type = rxq_cq_to_pkt_type(cqe);
+ pkt->packet_type = rxq_cq_to_pkt_type(rxq, cqe);
pkt->ol_flags = 0;
if (rss_hash_res && rxq->rss_hash) {
pkt->hash.rss = rss_hash_res;
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 7fce001..7763641 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -103,6 +103,7 @@ struct mlx5_rxq_data {
void *cq_uar; /* CQ user access region. */
uint32_t cqn; /* CQ number. */
uint8_t cq_arm_sn; /* CQ arm seq number. */
+ uint32_t tunnel; /* Tunnel type. */
} __rte_cache_aligned;
/* Verbs Rx queue elements. */
@@ -124,6 +125,7 @@ struct mlx5_rxq_ctrl {
struct mlx5_rxq_ibv *ibv; /* Verbs elements. */
struct mlx5_rxq_data rxq; /* Data path structure. */
unsigned int socket; /* CPU socket ID for allocations. */
+ uint32_t tunnel_types[16]; /* Tunnel type counter. */
unsigned int irq:1; /* Whether IRQ is enabled. */
};
@@ -143,6 +145,7 @@ struct mlx5_hrxq {
struct mlx5_ind_table_ibv *ind_table; /* Indirection table. */
struct ibv_qp *qp; /* Verbs queue pair. */
uint64_t hash_fields; /* Verbs Hash fields. */
+ uint32_t tunnel; /* Tunnel type. */
uint8_t rss_key_len; /* Hash key length in bytes. */
uint8_t rss_key[]; /* Hash key. */
};
@@ -240,9 +243,9 @@ struct mlx5_ind_table_ibv *mlx5_priv_ind_table_ibv_get(struct priv *,
int mlx5_priv_ind_table_ibv_release(struct priv *, struct mlx5_ind_table_ibv *);
int mlx5_priv_ind_table_ibv_verify(struct priv *);
struct mlx5_hrxq *mlx5_priv_hrxq_new(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t);
+ uint64_t, uint16_t [], uint16_t, uint32_t);
struct mlx5_hrxq *mlx5_priv_hrxq_get(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t);
+ uint64_t, uint16_t [], uint16_t, uint32_t);
int mlx5_priv_hrxq_release(struct priv *, struct mlx5_hrxq *);
int mlx5_priv_hrxq_ibv_verify(struct priv *);
uint64_t mlx5_priv_get_rx_port_offloads(struct priv *);
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index bbe1818..9f91361 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -551,6 +551,7 @@
const uint64x1_t mbuf_init = vld1_u64(&rxq->mbuf_initializer);
const uint64x1_t r32_mask = vcreate_u64(0xffffffff);
uint64x2_t rearm0, rearm1, rearm2, rearm3;
+ uint8_t pt_idx0, pt_idx1, pt_idx2, pt_idx3;
if (rxq->mark) {
const uint32x4_t ft_def = vdupq_n_u32(MLX5_FLOW_MARK_DEFAULT);
@@ -583,14 +584,18 @@
ptype = vshrn_n_u32(ptype_info, 10);
/* Errored packets will have RTE_PTYPE_ALL_MASK. */
ptype = vorr_u16(ptype, op_err);
- pkts[0]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 6)];
- pkts[1]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 4)];
- pkts[2]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 2)];
- pkts[3]->packet_type =
- mlx5_ptype_table[vget_lane_u8(vreinterpret_u8_u16(ptype), 0)];
+ pt_idx0 = vget_lane_u8(vreinterpret_u8_u16(ptype), 6);
+ pt_idx1 = vget_lane_u8(vreinterpret_u8_u16(ptype), 4);
+ pt_idx2 = vget_lane_u8(vreinterpret_u8_u16(ptype), 2);
+ pt_idx3 = vget_lane_u8(vreinterpret_u8_u16(ptype), 0);
+ pkts[0]->packet_type = mlx5_ptype_table[pt_idx0] |
+ !!(pt_idx0 & (1 << 6)) * rxq->tunnel;
+ pkts[1]->packet_type = mlx5_ptype_table[pt_idx1] |
+ !!(pt_idx1 & (1 << 6)) * rxq->tunnel;
+ pkts[2]->packet_type = mlx5_ptype_table[pt_idx2] |
+ !!(pt_idx2 & (1 << 6)) * rxq->tunnel;
+ pkts[3]->packet_type = mlx5_ptype_table[pt_idx3] |
+ !!(pt_idx3 & (1 << 6)) * rxq->tunnel;
/* Fill flags for checksum and VLAN. */
pinfo = vandq_u32(ptype_info, ptype_ol_mask);
pinfo = vreinterpretq_u32_u8(
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index c088bcb..d249248 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -542,6 +542,7 @@
const __m128i mbuf_init =
_mm_loadl_epi64((__m128i *)&rxq->mbuf_initializer);
__m128i rearm0, rearm1, rearm2, rearm3;
+ uint8_t pt_idx0, pt_idx1, pt_idx2, pt_idx3;
/* Extract pkt_info field. */
pinfo0 = _mm_unpacklo_epi32(cqes[0], cqes[1]);
@@ -595,10 +596,18 @@
/* Errored packets will have RTE_PTYPE_ALL_MASK. */
op_err = _mm_srli_epi16(op_err, 8);
ptype = _mm_or_si128(ptype, op_err);
- pkts[0]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 0)];
- pkts[1]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 2)];
- pkts[2]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 4)];
- pkts[3]->packet_type = mlx5_ptype_table[_mm_extract_epi8(ptype, 6)];
+ pt_idx0 = _mm_extract_epi8(ptype, 0);
+ pt_idx1 = _mm_extract_epi8(ptype, 2);
+ pt_idx2 = _mm_extract_epi8(ptype, 4);
+ pt_idx3 = _mm_extract_epi8(ptype, 6);
+ pkts[0]->packet_type = mlx5_ptype_table[pt_idx0] |
+ !!(pt_idx0 & (1 << 6)) * rxq->tunnel;
+ pkts[1]->packet_type = mlx5_ptype_table[pt_idx1] |
+ !!(pt_idx1 & (1 << 6)) * rxq->tunnel;
+ pkts[2]->packet_type = mlx5_ptype_table[pt_idx2] |
+ !!(pt_idx2 & (1 << 6)) * rxq->tunnel;
+ pkts[3]->packet_type = mlx5_ptype_table[pt_idx3] |
+ !!(pt_idx3 & (1 << 6)) * rxq->tunnel;
/* Fill flags for checksum and VLAN. */
pinfo = _mm_and_si128(pinfo, ptype_ol_mask);
pinfo = _mm_shuffle_epi8(cv_flag_sel, pinfo);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 11/21] net/mlx5: split flow RSS handling logic
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (11 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 10/21] net/mlx5: support packet tunnel type Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 12/21] net/mlx5: support tunnel RSS level Xueming Li
` (27 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Refactor and split out flow RSS hash field handling logic to dedicate
function.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 94 +++++++++++++++++++++++++-------------------
1 file changed, 53 insertions(+), 41 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0f59de6..090ddf4 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -956,50 +956,9 @@ struct ibv_spec_header {
static void
priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser)
{
- const unsigned int ipv4 =
- hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
- const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
- const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
- const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
- const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
- const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
unsigned int i;
(void)priv;
- if (parser->layer == HASH_RXQ_ETH) {
- goto fill;
- } else {
- /*
- * This layer becomes useless as the pattern define under
- * layers.
- */
- rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
- parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
- }
- /* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
- for (i = ohmin; i != (ohmax + 1); ++i) {
- if (!parser->queue[i].ibv_attr)
- continue;
- rte_free(parser->queue[i].ibv_attr);
- parser->queue[i].ibv_attr = NULL;
- }
- /* Remove impossible flow according to the RSS configuration. */
- if (hash_rxq_init[parser->layer].dpdk_rss_hf &
- parser->rss_conf.rss_hf) {
- /* Remove any other flow. */
- for (i = hmin; i != (hmax + 1); ++i) {
- if ((i == parser->layer) ||
- (!parser->queue[i].ibv_attr))
- continue;
- rte_free(parser->queue[i].ibv_attr);
- parser->queue[i].ibv_attr = NULL;
- }
- } else if (!parser->queue[ip].ibv_attr) {
- /* no RSS possible with the current configuration. */
- parser->queues_n = 1;
- return;
- }
-fill:
/*
* Fill missing layers in verbs specifications, or compute the correct
* offset to allocate the memory space for the attributes and
@@ -1062,6 +1021,56 @@ struct ibv_spec_header {
}
/**
+ * Update flows according to pattern and RSS hash fields.
+ *
+ * @param priv
+ * Pointer to private structure.
+ * @param[in, out] parser
+ * Internal parser structure.
+ */
+static int
+priv_flow_convert_rss(struct priv *priv, struct mlx5_flow_parse *parser)
+{
+ const unsigned int ipv4 =
+ hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
+ const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
+ const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
+ const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
+ const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ unsigned int i;
+
+ (void)priv;
+ if (parser->layer == HASH_RXQ_ETH)
+ return 0;
+ /* This layer becomes useless as the pattern define under layers. */
+ rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
+ parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
+ /* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
+ for (i = ohmin; i != (ohmax + 1); ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ /* Remove impossible flow according to the RSS configuration. */
+ if (hash_rxq_init[parser->layer].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ /* Remove any other flow. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if (i == parser->layer || !parser->queue[i].ibv_attr)
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ } else if (!parser->queue[ip].ibv_attr) {
+ /* no RSS possible with the current configuration. */
+ parser->queues_n = 1;
+ }
+ return 0;
+}
+
+/**
* Validate and convert a flow supported by the NIC.
*
* @param priv
@@ -1176,6 +1185,9 @@ struct ibv_spec_header {
* configuration.
*/
if (!parser->drop) {
+ ret = priv_flow_convert_rss(priv, parser);
+ if (ret)
+ goto exit_free;
priv_flow_convert_finalise(priv, parser);
} else {
parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 12/21] net/mlx5: support tunnel RSS level
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (12 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 11/21] net/mlx5: split flow RSS handling logic Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 13/21] net/mlx5: support 16 hardware priorities Xueming Li
` (26 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
RTE flow tunnel RSS level give user a choice to do RSS hash calculation
on inner or outer RSS fields. This path make mlx5 PMD support rte_flow
tunel RSS level. Testpmd flow command examples:
GRE tunnel with inner TCP, UDP and IP RSS:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 1 / end
GRE tunnel rule with specific inner pattern and same RSS queue as above
rule:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / ipv4 /
tcp / end actions rss queues 1 2 end level 1 / end
GRE tunnel rule with outer IP RSS:
flow create 0 ingress pattern eth / ipv4 proto is 47 / gre / end
actions rss queues 1 2 end level 0 / end
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Conflicts:
drivers/net/mlx5/mlx5_flow.c
---
drivers/net/mlx5/mlx5_flow.c | 242 +++++++++++++++++++++++++++++++------------
drivers/net/mlx5/mlx5_rxq.c | 50 ++++++++-
drivers/net/mlx5/mlx5_rxtx.h | 7 +-
3 files changed, 226 insertions(+), 73 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 090ddf4..27183d5 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -105,6 +105,7 @@ enum hash_rxq_type {
HASH_RXQ_UDPV6,
HASH_RXQ_IPV6,
HASH_RXQ_ETH,
+ HASH_RXQ_TUNNEL,
};
/* Initialization data for hash RX queue. */
@@ -441,6 +442,7 @@ struct mlx5_flow_parse {
struct rte_eth_rss_conf rss_conf; /**< RSS configuration */
uint8_t rss_key[40]; /**< copy of the RSS key. */
enum hash_rxq_type layer; /**< Last pattern layer detected. */
+ enum hash_rxq_type out_layer; /**< Last outer pattern layer detected. */
uint32_t tunnel; /* Tunnel type as RTE_PTYPE_TUNNEL_XXX. */
struct ibv_counter_set *cs; /**< Holds the counter set for the rule */
struct {
@@ -448,6 +450,7 @@ struct mlx5_flow_parse {
/**< Pointer to Verbs attributes. */
unsigned int offset;
/**< Current position or total size of the attribute. */
+ uint64_t hash_fields; /**< verbs hash fields. */
} queue[RTE_DIM(hash_rxq_init)];
};
@@ -579,7 +582,7 @@ struct ibv_spec_header {
if (rss_conf) {
if (rss_conf->rss_hf & MLX5_RSS_HF_MASK)
return EINVAL;
- if (rss_conf->rss_key_len != 40)
+ if (rss_conf->rss_key_len > 0 && rss_conf->rss_key_len != 40)
return EINVAL;
if (rss_conf->rss_key_len && rss_conf->rss_key) {
parser->rss_conf.rss_key_len = rss_conf->rss_key_len;
@@ -587,7 +590,9 @@ struct ibv_spec_header {
rss_conf->rss_key_len);
parser->rss_conf.rss_key = parser->rss_key;
}
- parser->rss_conf.rss_hf = rss_conf->rss_hf;
+ if (rss_conf->rss_hf)
+ parser->rss_conf.rss_hf = rss_conf->rss_hf;
+ parser->rss_conf.rss_level = rss_conf->rss_level;
}
return 0;
}
@@ -759,6 +764,13 @@ struct ibv_spec_header {
"wrong RSS configuration");
return -rte_errno;
}
+ if (parser->rss_conf.rss_level > 1) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ actions,
+ "wrong RSS level");
+ return -rte_errno;
+ }
} else if (actions->type == RTE_FLOW_ACTION_TYPE_MARK) {
const struct rte_flow_action_mark *mark =
(const struct rte_flow_action_mark *)
@@ -875,10 +887,19 @@ struct ibv_spec_header {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
- "Cannot support hw tunnel checksum "
+ "Cannot support tunnel checksum "
"offloads");
+ if (!priv->config.tunnel_en &&
+ parser->rss_conf.rss_level)
+ rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ items,
+ "Cannot support tunnel inner RSS");
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[items->type];
+ parser->layer = HASH_RXQ_TUNNEL;
+ } else {
+ parser->layer = HASH_RXQ_ETH;
}
if (parser->drop) {
parser->queue[HASH_RXQ_ETH].offset += cur_item->dst_sz;
@@ -957,8 +978,12 @@ struct ibv_spec_header {
priv_flow_convert_finalise(struct priv *priv, struct mlx5_flow_parse *parser)
{
unsigned int i;
+ uint32_t inner = parser->inner;
(void)priv;
+ /* Don't create extra flows for outer RSS. */
+ if (parser->tunnel && !parser->rss_conf.rss_level)
+ return;
/*
* Fill missing layers in verbs specifications, or compute the correct
* offset to allocate the memory space for the attributes and
@@ -969,23 +994,25 @@ struct ibv_spec_header {
struct ibv_flow_spec_ipv4_ext ipv4;
struct ibv_flow_spec_ipv6 ipv6;
struct ibv_flow_spec_tcp_udp udp_tcp;
+ struct ibv_flow_spec_eth eth;
} specs;
void *dst;
uint16_t size;
if (i == parser->layer)
continue;
- if (parser->layer == HASH_RXQ_ETH) {
+ if (parser->layer == HASH_RXQ_ETH ||
+ parser->layer == HASH_RXQ_TUNNEL) {
if (hash_rxq_init[i].ip_version == MLX5_IPV4) {
size = sizeof(struct ibv_flow_spec_ipv4_ext);
specs.ipv4 = (struct ibv_flow_spec_ipv4_ext){
- .type = IBV_FLOW_SPEC_IPV4_EXT,
+ .type = inner | IBV_FLOW_SPEC_IPV4_EXT,
.size = size,
};
} else {
size = sizeof(struct ibv_flow_spec_ipv6);
specs.ipv6 = (struct ibv_flow_spec_ipv6){
- .type = IBV_FLOW_SPEC_IPV6,
+ .type = inner | IBV_FLOW_SPEC_IPV6,
.size = size,
};
}
@@ -1002,7 +1029,7 @@ struct ibv_spec_header {
(i == HASH_RXQ_UDPV6) || (i == HASH_RXQ_TCPV6)) {
size = sizeof(struct ibv_flow_spec_tcp_udp);
specs.udp_tcp = (struct ibv_flow_spec_tcp_udp) {
- .type = ((i == HASH_RXQ_UDPV4 ||
+ .type = inner | ((i == HASH_RXQ_UDPV4 ||
i == HASH_RXQ_UDPV6) ?
IBV_FLOW_SPEC_UDP :
IBV_FLOW_SPEC_TCP),
@@ -1025,25 +1052,72 @@ struct ibv_spec_header {
*
* @param priv
* Pointer to private structure.
+ * @param[out] error
+ * Perform verbose error reporting if not NULL.
* @param[in, out] parser
* Internal parser structure.
*/
static int
-priv_flow_convert_rss(struct priv *priv, struct mlx5_flow_parse *parser)
+priv_flow_convert_rss(struct priv *priv, struct rte_flow_error *error,
+ struct mlx5_flow_parse *parser)
{
- const unsigned int ipv4 =
+ unsigned int ipv4 =
hash_rxq_init[parser->layer].ip_version == MLX5_IPV4;
const enum hash_rxq_type hmin = ipv4 ? HASH_RXQ_TCPV4 : HASH_RXQ_TCPV6;
const enum hash_rxq_type hmax = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
const enum hash_rxq_type ohmin = ipv4 ? HASH_RXQ_TCPV6 : HASH_RXQ_TCPV4;
const enum hash_rxq_type ohmax = ipv4 ? HASH_RXQ_IPV6 : HASH_RXQ_IPV4;
- const enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ enum hash_rxq_type ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
unsigned int i;
+ int found = 0;
(void)priv;
- if (parser->layer == HASH_RXQ_ETH)
+ /*
+ * Outer RSS.
+ * HASH_RXQ_ETH is the only rule since tunnel packet match this
+ * rule must match outer pattern.
+ */
+ if (parser->tunnel && !parser->rss_conf.rss_level) {
+ /* Remove flows other than default. */
+ for (i = 0; i != hash_rxq_init_n - 1; ++i) {
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ ipv4 = hash_rxq_init[parser->out_layer].ip_version == MLX5_IPV4;
+ ip = ipv4 ? HASH_RXQ_IPV4 : HASH_RXQ_IPV6;
+ if (hash_rxq_init[parser->out_layer].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ parser->queue[HASH_RXQ_ETH].hash_fields =
+ hash_rxq_init[parser->out_layer].hash_fields;
+ } else if (ip && (hash_rxq_init[ip].dpdk_rss_hf &
+ parser->rss_conf.rss_hf)) {
+ parser->queue[HASH_RXQ_ETH].hash_fields =
+ hash_rxq_init[ip].hash_fields;
+ } else if (parser->rss_conf.rss_hf) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+ "rss outer hash function not match pattern");
+ return -rte_errno;
+ }
return 0;
- /* This layer becomes useless as the pattern define under layers. */
+ }
+ if (parser->layer == HASH_RXQ_ETH || parser->layer == HASH_RXQ_TUNNEL) {
+ /* Remove unused flows according to hash function. */
+ for (i = 0; i != hash_rxq_init_n - 1; ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ if (hash_rxq_init[i].dpdk_rss_hf &
+ parser->rss_conf.rss_hf) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[i].hash_fields;
+ continue;
+ }
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ return 0;
+ }
+ /* Remove ETH layer flow. */
rte_free(parser->queue[HASH_RXQ_ETH].ibv_attr);
parser->queue[HASH_RXQ_ETH].ibv_attr = NULL;
/* Remove opposite kind of layer e.g. IPv6 if the pattern is IPv4. */
@@ -1053,9 +1127,54 @@ struct ibv_spec_header {
rte_free(parser->queue[i].ibv_attr);
parser->queue[i].ibv_attr = NULL;
}
- /* Remove impossible flow according to the RSS configuration. */
- if (hash_rxq_init[parser->layer].dpdk_rss_hf &
- parser->rss_conf.rss_hf) {
+ /*
+ * Keep L4 flows as IP pattern has to support L4 RSS.
+ * Otherwise, only keep the flow that match the pattern.
+ */
+ if (parser->layer != ip) {
+ /* Only keep the flow that match the pattern. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if (i == parser->layer)
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ }
+ if (parser->rss_conf.rss_hf) {
+ /* Remove impossible flow according to the RSS configuration. */
+ for (i = hmin; i != (hmax + 1); ++i) {
+ if (!parser->queue[i].ibv_attr)
+ continue;
+ if (parser->rss_conf.rss_hf &
+ hash_rxq_init[i].dpdk_rss_hf) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[i].hash_fields;
+ found = 1;
+ continue;
+ }
+ /* L4 flow could be used for L3 RSS. */
+ if (i == parser->layer && i < ip &&
+ (hash_rxq_init[ip].dpdk_rss_hf &
+ parser->rss_conf.rss_hf)) {
+ parser->queue[i].hash_fields =
+ hash_rxq_init[ip].hash_fields;
+ found = 1;
+ continue;
+ }
+ /* L3 flow and L4 hash: non-rss L3 flow. */
+ if (i == parser->layer && i == ip && found)
+ /* IP pattern and L4 HF. */
+ continue;
+ rte_free(parser->queue[i].ibv_attr);
+ parser->queue[i].ibv_attr = NULL;
+ }
+ if (!found) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "rss hash function not match pattern");
+ return -rte_errno;
+ }
+ } else {
/* Remove any other flow. */
for (i = hmin; i != (hmax + 1); ++i) {
if (i == parser->layer || !parser->queue[i].ibv_attr)
@@ -1063,8 +1182,6 @@ struct ibv_spec_header {
rte_free(parser->queue[i].ibv_attr);
parser->queue[i].ibv_attr = NULL;
}
- } else if (!parser->queue[ip].ibv_attr) {
- /* no RSS possible with the current configuration. */
parser->queues_n = 1;
}
return 0;
@@ -1141,10 +1258,6 @@ struct ibv_spec_header {
hash_rxq_init[i].flow_priority;
unsigned int offset;
- if (!(parser->rss_conf.rss_hf &
- hash_rxq_init[i].dpdk_rss_hf) &&
- (i != HASH_RXQ_ETH))
- continue;
offset = parser->queue[i].offset;
parser->queue[i].ibv_attr =
priv_flow_convert_allocate(priv, priority,
@@ -1157,6 +1270,7 @@ struct ibv_spec_header {
/* Third step. Conversion parse, fill the specifications. */
parser->inner = 0;
parser->tunnel = 0;
+ parser->layer = HASH_RXQ_ETH;
for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) {
if (items->type == RTE_FLOW_ITEM_TYPE_VOID)
continue;
@@ -1173,19 +1287,12 @@ struct ibv_spec_header {
goto exit_free;
}
}
- if (parser->mark)
- mlx5_flow_create_flag_mark(parser, parser->mark_id);
- if (parser->count && parser->create) {
- mlx5_flow_create_count(priv, parser);
- if (!parser->cs)
- goto exit_count_error;
- }
/*
* Last step. Complete missing specification to reach the RSS
* configuration.
*/
if (!parser->drop) {
- ret = priv_flow_convert_rss(priv, parser);
+ ret = priv_flow_convert_rss(priv, error, parser);
if (ret)
goto exit_free;
priv_flow_convert_finalise(priv, parser);
@@ -1194,6 +1301,13 @@ struct ibv_spec_header {
attr->priority +
hash_rxq_init[parser->layer].flow_priority;
}
+ if (parser->mark)
+ mlx5_flow_create_flag_mark(parser, parser->mark_id);
+ if (parser->count && parser->create) {
+ mlx5_flow_create_count(priv, parser);
+ if (!parser->cs)
+ goto exit_count_error;
+ }
exit_free:
/* Only verification is expected, all resources should be released. */
if (!parser->create) {
@@ -1241,17 +1355,11 @@ struct ibv_spec_header {
for (i = 0; i != hash_rxq_init_n; ++i) {
if (!parser->queue[i].ibv_attr)
continue;
- /* Specification must be the same l3 type or none. */
- if (parser->layer == HASH_RXQ_ETH ||
- (hash_rxq_init[parser->layer].ip_version ==
- hash_rxq_init[i].ip_version) ||
- (hash_rxq_init[i].ip_version == 0)) {
- dst = (void *)((uintptr_t)parser->queue[i].ibv_attr +
- parser->queue[i].offset);
- memcpy(dst, src, size);
- ++parser->queue[i].ibv_attr->num_of_specs;
- parser->queue[i].offset += size;
- }
+ dst = (void *)((uintptr_t)parser->queue[i].ibv_attr +
+ parser->queue[i].offset);
+ memcpy(dst, src, size);
+ ++parser->queue[i].ibv_attr->num_of_specs;
+ parser->queue[i].offset += size;
}
}
@@ -1279,9 +1387,7 @@ struct ibv_spec_header {
.size = eth_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_ETH;
+ parser->layer = HASH_RXQ_ETH;
if (spec) {
unsigned int i;
@@ -1368,9 +1474,7 @@ struct ibv_spec_header {
.size = ipv4_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_IPV4;
+ parser->layer = HASH_RXQ_IPV4;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1420,9 +1524,7 @@ struct ibv_spec_header {
.size = ipv6_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner)
- parser->layer = HASH_RXQ_IPV6;
+ parser->layer = HASH_RXQ_IPV6;
if (spec) {
unsigned int i;
uint32_t vtc_flow_val;
@@ -1492,13 +1594,10 @@ struct ibv_spec_header {
.size = udp_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner) {
- if (parser->layer == HASH_RXQ_IPV4)
- parser->layer = HASH_RXQ_UDPV4;
- else
- parser->layer = HASH_RXQ_UDPV6;
- }
+ if (parser->layer == HASH_RXQ_IPV4)
+ parser->layer = HASH_RXQ_UDPV4;
+ else
+ parser->layer = HASH_RXQ_UDPV6;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1538,13 +1637,10 @@ struct ibv_spec_header {
.size = tcp_size,
};
- /* Don't update layer for the inner pattern. */
- if (!parser->inner) {
- if (parser->layer == HASH_RXQ_IPV4)
- parser->layer = HASH_RXQ_TCPV4;
- else
- parser->layer = HASH_RXQ_TCPV6;
- }
+ if (parser->layer == HASH_RXQ_IPV4)
+ parser->layer = HASH_RXQ_TCPV4;
+ else
+ parser->layer = HASH_RXQ_TCPV6;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1591,6 +1687,8 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
if (spec) {
if (!mask)
mask = default_mask;
@@ -1641,6 +1739,8 @@ struct ibv_spec_header {
(void)default_mask;
parser->inner = IBV_FLOW_SPEC_INNER;
parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
mlx5_flow_create_copy(parser, &tunnel, size);
return 0;
}
@@ -1804,7 +1904,7 @@ struct ibv_spec_header {
continue;
flow->frxq[i].ibv_attr = parser->queue[i].ibv_attr;
parser->queue[i].ibv_attr = NULL;
- hash_fields = hash_rxq_init[i].hash_fields;
+ hash_fields = parser->queue[i].hash_fields;
if (!priv->dev->data->dev_started)
continue;
flow->frxq[i].hrxq =
@@ -1814,7 +1914,8 @@ struct ibv_spec_header {
hash_fields,
parser->queues,
parser->queues_n,
- parser->tunnel);
+ parser->tunnel,
+ parser->rss_conf.rss_level);
if (flow->frxq[i].hrxq)
continue;
flow->frxq[i].hrxq =
@@ -1824,7 +1925,8 @@ struct ibv_spec_header {
hash_fields,
parser->queues,
parser->queues_n,
- parser->tunnel);
+ parser->tunnel,
+ parser->rss_conf.rss_level);
if (!flow->frxq[i].hrxq) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
@@ -1884,7 +1986,7 @@ struct ibv_spec_header {
}
DEBUG("%p type %d QP %p ibv_flow %p",
(void *)flow, i,
- (void *)flow->frxq[i].hrxq,
+ (void *)flow->frxq[i].hrxq->qp,
(void *)flow->frxq[i].ibv_flow);
}
for (i = 0; i != parser->queues_n; ++i) {
@@ -2384,7 +2486,8 @@ struct rte_flow *
hash_rxq_init[i].hash_fields,
(*flow->queues),
flow->queues_n,
- flow->tunnel);
+ flow->tunnel,
+ flow->rss_conf.rss_level);
if (flow->frxq[i].hrxq)
goto flow_create;
flow->frxq[i].hrxq =
@@ -2393,7 +2496,8 @@ struct rte_flow *
hash_rxq_init[i].hash_fields,
(*flow->queues),
flow->queues_n,
- flow->tunnel);
+ flow->tunnel,
+ flow->rss_conf.rss_level);
if (!flow->frxq[i].hrxq) {
DEBUG("Flow %p cannot be applied",
(void *)flow);
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 09ef189..470fd2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1327,6 +1327,8 @@ struct mlx5_ind_table_ibv*
* Number of queues.
* @param tunnel
* Tunnel type.
+ * @param rss_level
+ * RSS hash on tunnel level, 0: outer most, 1: inner.
*
* @return
* An hash Rx queue on success.
@@ -1334,11 +1336,14 @@ struct mlx5_ind_table_ibv*
struct mlx5_hrxq*
mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
- uint32_t tunnel)
+ uint32_t tunnel, uint8_t rss_level)
{
struct mlx5_hrxq *hrxq;
struct mlx5_ind_table_ibv *ind_tbl;
struct ibv_qp *qp;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ struct mlx5dv_qp_init_attr qp_init_attr = {0};
+#endif
queues_n = hash_fields ? queues_n : 1;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
@@ -1346,6 +1351,40 @@ struct mlx5_hrxq*
ind_tbl = mlx5_priv_ind_table_ibv_new(priv, queues, queues_n);
if (!ind_tbl)
return NULL;
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ if (tunnel) {
+ qp_init_attr.comp_mask =
+ MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS;
+ qp_init_attr.create_flags = MLX5DV_QP_CREATE_TUNNEL_OFFLOADS;
+ }
+ qp = mlx5dv_create_qp(
+ priv->ctx,
+ &(struct ibv_qp_init_attr_ex){
+ .qp_type = IBV_QPT_RAW_PACKET,
+ .comp_mask =
+ IBV_QP_INIT_ATTR_PD |
+ IBV_QP_INIT_ATTR_IND_TABLE |
+ IBV_QP_INIT_ATTR_RX_HASH,
+ .rx_hash_conf = (struct ibv_rx_hash_conf){
+ .rx_hash_function = IBV_RX_HASH_FUNC_TOEPLITZ,
+ .rx_hash_key_len = rss_key_len,
+ .rx_hash_key = rss_key,
+ .rx_hash_fields_mask = hash_fields |
+ (tunnel && rss_level ?
+ (uint32_t)IBV_RX_HASH_INNER : 0),
+ },
+ .rwq_ind_tbl = ind_tbl->ind_table,
+ .pd = priv->pd,
+ },
+ &qp_init_attr);
+ DEBUG("mxl5dv_create_qp(): %p, hash_fields: %lx ind_tbl:%p dv_attr: "
+ "comp_mask: %lx create_flags:%x",
+ (void *)qp, hash_fields | (tunnel && rss_level ?
+ (uint32_t)IBV_RX_HASH_INNER : 0), (void *)ind_tbl,
+ qp_init_attr.comp_mask, qp_init_attr.create_flags);
+ if (!qp)
+ goto error;
+#else
qp = mlx5_glue->create_qp_ex
(priv->ctx,
&(struct ibv_qp_init_attr_ex){
@@ -1363,6 +1402,7 @@ struct mlx5_hrxq*
.rwq_ind_tbl = ind_tbl->ind_table,
.pd = priv->pd,
});
+#endif
if (!qp)
goto error;
hrxq = rte_calloc(__func__, 1, sizeof(*hrxq) + rss_key_len, 0);
@@ -1373,6 +1413,7 @@ struct mlx5_hrxq*
hrxq->rss_key_len = rss_key_len;
hrxq->hash_fields = hash_fields;
hrxq->tunnel = tunnel;
+ hrxq->rss_level = rss_level;
memcpy(hrxq->rss_key, rss_key, rss_key_len);
rte_atomic32_inc(&hrxq->refcnt);
LIST_INSERT_HEAD(&priv->hrxqs, hrxq, next);
@@ -1380,6 +1421,7 @@ struct mlx5_hrxq*
(void *)hrxq, rte_atomic32_read(&hrxq->refcnt));
return hrxq;
error:
+ ERROR("%p: Error creating Hash Rx queue", (void *)priv);
mlx5_priv_ind_table_ibv_release(priv, ind_tbl);
if (qp)
claim_zero(mlx5_glue->destroy_qp(qp));
@@ -1400,6 +1442,8 @@ struct mlx5_hrxq*
* Number of queues.
* @param tunnel
* Tunnel type.
+ * @param rss_level
+ * RSS hash on tunnel level, 0: outer most, 1: inner
*
* @return
* An hash Rx queue on success.
@@ -1407,7 +1451,7 @@ struct mlx5_hrxq*
struct mlx5_hrxq*
mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
uint64_t hash_fields, uint16_t queues[], uint16_t queues_n,
- uint32_t tunnel)
+ uint32_t tunnel, uint8_t rss_level)
{
struct mlx5_hrxq *hrxq;
@@ -1423,6 +1467,8 @@ struct mlx5_hrxq*
continue;
if (hrxq->tunnel != tunnel)
continue;
+ if (hrxq->rss_level != rss_level)
+ continue;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
if (!ind_tbl)
continue;
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 7763641..626ebe8 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -146,6 +146,7 @@ struct mlx5_hrxq {
struct ibv_qp *qp; /* Verbs queue pair. */
uint64_t hash_fields; /* Verbs Hash fields. */
uint32_t tunnel; /* Tunnel type. */
+ uint8_t rss_level; /* RSS on tunnel level. */
uint8_t rss_key_len; /* Hash key length in bytes. */
uint8_t rss_key[]; /* Hash key. */
};
@@ -243,9 +244,11 @@ struct mlx5_ind_table_ibv *mlx5_priv_ind_table_ibv_get(struct priv *,
int mlx5_priv_ind_table_ibv_release(struct priv *, struct mlx5_ind_table_ibv *);
int mlx5_priv_ind_table_ibv_verify(struct priv *);
struct mlx5_hrxq *mlx5_priv_hrxq_new(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t, uint32_t);
+ uint64_t, uint16_t [], uint16_t,
+ uint32_t, uint8_t);
struct mlx5_hrxq *mlx5_priv_hrxq_get(struct priv *, uint8_t *, uint8_t,
- uint64_t, uint16_t [], uint16_t, uint32_t);
+ uint64_t, uint16_t [], uint16_t,
+ uint32_t, uint8_t);
int mlx5_priv_hrxq_release(struct priv *, struct mlx5_hrxq *);
int mlx5_priv_hrxq_ibv_verify(struct priv *);
uint64_t mlx5_priv_get_rx_port_offloads(struct priv *);
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 13/21] net/mlx5: support 16 hardware priorities
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (13 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 12/21] net/mlx5: support tunnel RSS level Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 14/21] net/mlx5: add hardware flow debug dump Xueming Li
` (25 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Since OFED 4.3-0.1.3.0, new driver support 16 Verbs priorities, adjust
RTE FLOW priority mapping to:
0-3: RTE FLOW tunnel rule
4-7: RTE FLOW non-tunnel rule
8-15: PMD default control flow
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 27183d5..5e5184b 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -28,7 +28,16 @@
#include "mlx5_glue.h"
/* Define minimal priority for control plane flows. */
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+/* 16 verb priorities since OFED 4.3, control flow start from 8. */
+#define MLX5_CTRL_FLOW_PRIORITY 8
+#else
+/* 8 Verb priorities before OFED4.3, control flow start from 4. */
#define MLX5_CTRL_FLOW_PRIORITY 4
+#endif
+
+/* Define verb priority span for each flow. */
+#define MLX5_FLOW_PRIORITY_SPAN 4
/* Internet Protocol versions. */
#define MLX5_IPV4 4
@@ -1215,6 +1224,7 @@ struct ibv_spec_header {
struct mlx5_flow_parse *parser)
{
const struct mlx5_flow_items *cur_item = mlx5_flow_items;
+ unsigned int priority_shift = attr->priority;
unsigned int i;
int ret;
@@ -1234,13 +1244,20 @@ struct ibv_spec_header {
if (ret)
return ret;
priv_flow_convert_finalise(priv, parser);
+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
+ /*
+ * 16 priorities since OFED4.3, tunnel rules use highest priority 0-3,
+ * other user-flows use 4-7, control flows use lowest start from 8.
+ */
+ if (!parser->tunnel)
+ priority_shift += MLX5_FLOW_PRIORITY_SPAN;
+#endif
/*
* Second step.
* Allocate the memory space to store verbs specifications.
*/
if (parser->drop) {
- unsigned int priority =
- attr->priority +
+ unsigned int priority = priority_shift +
hash_rxq_init[HASH_RXQ_ETH].flow_priority;
unsigned int offset = parser->queue[HASH_RXQ_ETH].offset;
@@ -1253,8 +1270,7 @@ struct ibv_spec_header {
sizeof(struct ibv_flow_attr);
} else {
for (i = 0; i != hash_rxq_init_n; ++i) {
- unsigned int priority =
- attr->priority +
+ unsigned int priority = priority_shift +
hash_rxq_init[i].flow_priority;
unsigned int offset;
@@ -1298,7 +1314,7 @@ struct ibv_spec_header {
priv_flow_convert_finalise(priv, parser);
} else {
parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
- attr->priority +
+ priority_shift +
hash_rxq_init[parser->layer].flow_priority;
}
if (parser->mark)
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 14/21] net/mlx5: add hardware flow debug dump
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (14 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 13/21] net/mlx5: support 16 hardware priorities Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 15/21] net/mlx5: fix control flow create failure Xueming Li
` (24 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Dump verb flow detail including each flow spec type and size for debug
purpose.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 5e5184b..139dc72 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1993,6 +1993,30 @@ struct ibv_spec_header {
flow->frxq[i].ibv_flow =
mlx5_glue->create_flow(flow->frxq[i].hrxq->qp,
flow->frxq[i].ibv_attr);
+#ifndef NDEBUG
+ uintptr_t spec_ptr;
+ uint16_t j;
+ char buf[256];
+ uint8_t off;
+
+ spec_ptr = (uintptr_t)(flow->frxq[i].ibv_attr + 1);
+ for (j = 0, off = 0; j < flow->frxq[i].ibv_attr->num_of_specs;
+ j++) {
+ struct ibv_flow_spec *spec = (void *)spec_ptr;
+ off += sprintf(buf + off, " %x(%hu)", spec->hdr.type,
+ spec->hdr.size);
+ spec_ptr += spec->hdr.size;
+ }
+ DEBUG("verb flow: qp:%p n_specs:%hhu, size:%hu, priority:%hu, type:%d, flags:%x, comp_mask:%x specs:%s",
+ (void *)flow->frxq[i].hrxq->qp,
+ flow->frxq[i].ibv_attr->num_of_specs,
+ flow->frxq[i].ibv_attr->size,
+ flow->frxq[i].ibv_attr->priority,
+ flow->frxq[i].ibv_attr->type,
+ flow->frxq[i].ibv_attr->flags,
+ flow->frxq[i].ibv_attr->comp_mask,
+ buf);
+#endif
if (!flow->frxq[i].ibv_flow) {
rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_HANDLE,
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 15/21] net/mlx5: fix control flow create failure
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (15 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 14/21] net/mlx5: add hardware flow debug dump Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 16/21] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
` (23 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev, stable
Fix control flow create failure by initializing temp struct variable.
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 139dc72..1333d51 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2655,6 +2655,7 @@ struct rte_flow *
if (!priv->reta_idx_n)
return EINVAL;
+ memset(&action_rss, 0, sizeof(action_rss));
for (i = 0; i != priv->reta_idx_n; ++i)
action_rss.local.queue[i] = (*priv->reta_idx)[i];
action_rss.local.rss_conf = &priv->rss_conf;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 16/21] net/mlx5: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (16 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 15/21] net/mlx5: fix control flow create failure Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 17/21] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
` (22 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Add VXLAN-GPE support to rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 100 ++++++++++++++++++++++++++++++++++++++++---
drivers/net/mlx5/mlx5_rxtx.c | 3 +-
2 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1333d51..cddf562 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -89,6 +89,11 @@ struct ibv_flow_spec_counter_action {
void *data);
static int
+mlx5_flow_create_vxlan_gpe(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data);
+
+static int
mlx5_flow_create_gre(const struct rte_flow_item *item,
const void *default_mask,
void *data);
@@ -240,18 +245,22 @@ struct rte_flow {
#define IS_TUNNEL(type) ( \
(type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
+ (type) == RTE_FLOW_ITEM_TYPE_VXLAN_GPE || \
(type) == RTE_FLOW_ITEM_TYPE_GRE)
const uint32_t rte_ptype[] = {
- [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
- RTE_PTYPE_L4_UDP,
- [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+ [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = RTE_PTYPE_TUNNEL_VXLAN_GPE |
+ RTE_PTYPE_L4_UDP,
+ [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
};
#define PTYPE_TUN(t) ((RTE_PTYPE_TUNNEL_MASK & (t)) >> 12)
static const uint32_t ptype_flow_type[] = {
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN_GPE)] = RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
};
/** Structure to generate a simple graph of layers supported by the NIC. */
@@ -307,6 +316,7 @@ struct mlx5_flow_items {
[RTE_FLOW_ITEM_TYPE_END] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
RTE_FLOW_ITEM_TYPE_GRE),
},
[RTE_FLOW_ITEM_TYPE_ETH] = {
@@ -384,7 +394,8 @@ struct mlx5_flow_items {
.dst_sz = sizeof(struct ibv_flow_spec_ipv6),
},
[RTE_FLOW_ITEM_TYPE_UDP] = {
- .items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN),
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN,
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_udp){
.hdr = {
@@ -435,6 +446,19 @@ struct mlx5_flow_items {
.convert = mlx5_flow_create_vxlan,
.dst_sz = sizeof(struct ibv_flow_spec_tunnel),
},
+ [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = {
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
+ .actions = valid_actions,
+ .mask = &(const struct rte_flow_item_vxlan_gpe){
+ .vni = "\xff\xff\xff",
+ },
+ .default_mask = &rte_flow_item_vxlan_gpe_mask,
+ .mask_sz = sizeof(struct rte_flow_item_vxlan_gpe),
+ .convert = mlx5_flow_create_vxlan_gpe,
+ .dst_sz = sizeof(struct ibv_flow_spec_tunnel),
+ },
};
/** Structure to pass to the conversion function. */
@@ -1730,6 +1754,70 @@ struct ibv_spec_header {
}
/**
+ * Convert VXLAN-GPE item to Verbs specification.
+ *
+ * @param item[in]
+ * Item specification.
+ * @param default_mask[in]
+ * Default bit-masks to use when item->mask is not provided.
+ * @param data[in, out]
+ * User structure.
+ */
+static int
+mlx5_flow_create_vxlan_gpe(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data)
+{
+ const struct rte_flow_item_vxlan_gpe *spec = item->spec;
+ const struct rte_flow_item_vxlan_gpe *mask = item->mask;
+ struct mlx5_flow_parse *parser = (struct mlx5_flow_parse *)data;
+ unsigned int size = sizeof(struct ibv_flow_spec_tunnel);
+ struct ibv_flow_spec_tunnel vxlan = {
+ .type = parser->inner | IBV_FLOW_SPEC_VXLAN_TUNNEL,
+ .size = size,
+ };
+ union vni {
+ uint32_t vlan_id;
+ uint8_t vni[4];
+ } id;
+ int r;
+
+ id.vni[0] = 0;
+ parser->inner = IBV_FLOW_SPEC_INNER;
+ parser->tunnel = rte_ptype[item->type];
+ parser->out_layer = parser->layer;
+ parser->layer = HASH_RXQ_TUNNEL;
+ if (spec) {
+ if (!mask)
+ mask = default_mask;
+ memcpy(&id.vni[1], spec->vni, 3);
+ vxlan.val.tunnel_id = id.vlan_id;
+ memcpy(&id.vni[1], mask->vni, 3);
+ vxlan.mask.tunnel_id = id.vlan_id;
+ if (spec->protocol) {
+ r = EINVAL;
+ return r;
+ }
+ /* Remove unwanted bits from values. */
+ vxlan.val.tunnel_id &= vxlan.mask.tunnel_id;
+ }
+ /*
+ * Tunnel id 0 is equivalent as not adding a VXLAN layer, if only this
+ * layer is defined in the Verbs specification it is interpreted as
+ * wildcard and all packets will match this rule, if it follows a full
+ * stack layer (ex: eth / ipv4 / udp), all packets matching the layers
+ * before will also match this rule.
+ * To avoid such situation, VNI 0 is currently refused.
+ */
+ if (!vxlan.val.tunnel_id) {
+ r = EINVAL;
+ return r;
+ }
+ mlx5_flow_create_copy(parser, &vxlan, size);
+ return 0;
+}
+
+/**
* Convert GRE item to Verbs specification.
*
* @param item[in]
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 926e11d..7fc367b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -426,8 +426,7 @@
uint8_t vlan_sz =
(buf->ol_flags & PKT_TX_VLAN_PKT) ? 4 : 0;
const uint64_t is_tunneled =
- buf->ol_flags & (PKT_TX_TUNNEL_GRE |
- PKT_TX_TUNNEL_VXLAN);
+ buf->ol_flags & (PKT_TX_TUNNEL_MASK);
tso_header_sz = buf->l2_len + vlan_sz +
buf->l3_len + buf->l4_len;
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 17/21] net/mlx5: allow flow tunnel ID 0 with outer pattern
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (17 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 16/21] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 18/21] doc: update mlx5 guide on tunnel offloading Xueming Li
` (21 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Tunnel w/o tunnel id pattern could match any non-tunneled packet,
thus this patch only allow tunnel pattern with outer spec.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cddf562..bda1a58 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1747,7 +1747,11 @@ struct ibv_spec_header {
* before will also match this rule.
* To avoid such situation, VNI 0 is currently refused.
*/
- if (!vxlan.val.tunnel_id)
+ /*
+ * Tunnel w/o tunnel id pattern could match any non-tunneled packet,
+ * thus only allow tunnel pattern with outer spec.
+ */
+ if (parser->out_layer == HASH_RXQ_ETH && !vxlan.val.tunnel_id)
return EINVAL;
mlx5_flow_create_copy(parser, &vxlan, size);
return 0;
@@ -1809,10 +1813,15 @@ struct ibv_spec_header {
* before will also match this rule.
* To avoid such situation, VNI 0 is currently refused.
*/
- if (!vxlan.val.tunnel_id) {
+ /*
+ * Tunnel w/o tunnel id pattern could match any non-tunneled packet,
+ * thus only allow tunnel pattern with outer spec.
+ */
+ if (parser->out_layer == HASH_RXQ_ETH && !vxlan.val.tunnel_id) {
r = EINVAL;
return r;
}
+
mlx5_flow_create_copy(parser, &vxlan, size);
return 0;
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 18/21] doc: update mlx5 guide on tunnel offloading
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (18 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 17/21] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 19/21] doc: remove announce of ethdev API change for RSS configuration Xueming Li
` (20 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Remove tunnel limitations, add new hardware tunnel offload features.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
doc/guides/nics/mlx5.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 0e6e525..aa8f221 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -100,12 +100,12 @@ Features
- RX interrupts.
- Statistics query including Basic, Extended and per queue.
- Rx HW timestamp.
+- Tunnel types: VXLAN, GRE.
+- Tunnel HW offloads: packet type, inner/outer RSS, IP and UDP checksum verification.
Limitations
-----------
-- Inner RSS for VXLAN frames is not supported yet.
-- Hardware checksum RX offloads for VXLAN inner header are not supported yet.
- For secondary process:
- Forked secondary process not supported.
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 19/21] doc: remove announce of ethdev API change for RSS configuration
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (19 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 18/21] doc: update mlx5 guide on tunnel offloading Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 20/21] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (19 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
Implementation of RSS level provided in this patch set, remove
deprecation.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 9b55761..93ef81d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -111,10 +111,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
than *nb_pkts*, the application will assume that no more packets are present.
Some of the hw queue based hardware can only support smaller burst for RX
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 20/21] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (20 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 19/21] doc: remove announce of ethdev API change for RSS configuration Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 21/21] net/mlx5: support MPLS-in-GRE and MPLS-in-UDP flow pattern Xueming Li
` (18 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7..10abfe8 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf833..a70cc7a 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v1 21/21] net/mlx5: support MPLS-in-GRE and MPLS-in-UDP flow pattern
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (21 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 20/21] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-03-09 11:29 ` Xueming Li
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 0/5] introduce new tunnel types Xueming Li
` (17 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-03-09 11:29 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Adrien Mazarguil, Shahaf Shuler, Olivier Matz
Cc: Xueming Li, dev
This patch supports new tunnel type MPLS-in-GRE and MPLS-in-UDP.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 122 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 104 insertions(+), 18 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index bda1a58..00c705a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -98,6 +98,11 @@ struct ibv_flow_spec_counter_action {
const void *default_mask,
void *data);
+static int
+mlx5_flow_create_mpls(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data);
+
struct mlx5_flow_parse;
static void
@@ -246,21 +251,29 @@ struct rte_flow {
#define IS_TUNNEL(type) ( \
(type) == RTE_FLOW_ITEM_TYPE_VXLAN || \
(type) == RTE_FLOW_ITEM_TYPE_VXLAN_GPE || \
+ (type) == RTE_FLOW_ITEM_TYPE_MPLS || \
(type) == RTE_FLOW_ITEM_TYPE_GRE)
-const uint32_t rte_ptype[] = {
- [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN |
- RTE_PTYPE_L4_UDP,
- [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = RTE_PTYPE_TUNNEL_VXLAN_GPE |
- RTE_PTYPE_L4_UDP,
- [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+const uint32_t flow2ptype[] = {
+ [RTE_FLOW_ITEM_TYPE_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN,
+ [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = RTE_PTYPE_TUNNEL_VXLAN_GPE,
+ [RTE_FLOW_ITEM_TYPE_GRE] = RTE_PTYPE_TUNNEL_GRE,
+ [RTE_FLOW_ITEM_TYPE_MPLS] = RTE_PTYPE_TUNNEL_MPLS_IN_GRE,
};
#define PTYPE_TUN(t) ((RTE_PTYPE_TUNNEL_MASK & (t)) >> 12)
-static const uint32_t ptype_flow_type[] = {
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_FLOW_ITEM_TYPE_VXLAN,
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN_GPE)] = RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
- [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_FLOW_ITEM_TYPE_GRE,
+
+const uint32_t ptype2ptype[] = {
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)] = RTE_PTYPE_TUNNEL_VXLAN |
+ RTE_PTYPE_L4_UDP,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN_GPE)] = RTE_PTYPE_TUNNEL_VXLAN_GPE |
+ RTE_PTYPE_L4_UDP,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)] = RTE_PTYPE_TUNNEL_GRE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_MPLS_IN_GRE)] =
+ RTE_PTYPE_TUNNEL_MPLS_IN_GRE,
+ [PTYPE_TUN(RTE_PTYPE_TUNNEL_MPLS_IN_UDP)] =
+ RTE_PTYPE_TUNNEL_MPLS_IN_GRE |
+ RTE_PTYPE_L4_UDP,
};
/** Structure to generate a simple graph of layers supported by the NIC. */
@@ -395,7 +408,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_UDP] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN,
- RTE_FLOW_ITEM_TYPE_VXLAN_GPE),
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+ RTE_FLOW_ITEM_TYPE_MPLS),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_udp){
.hdr = {
@@ -423,7 +437,8 @@ struct mlx5_flow_items {
},
[RTE_FLOW_ITEM_TYPE_GRE] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_IPV4,
- RTE_FLOW_ITEM_TYPE_IPV6),
+ RTE_FLOW_ITEM_TYPE_IPV6,
+ RTE_FLOW_ITEM_TYPE_MPLS),
.actions = valid_actions,
.mask = &(const struct rte_flow_item_gre){
.protocol = -1,
@@ -459,6 +474,19 @@ struct mlx5_flow_items {
.convert = mlx5_flow_create_vxlan_gpe,
.dst_sz = sizeof(struct ibv_flow_spec_tunnel),
},
+ [RTE_FLOW_ITEM_TYPE_MPLS] = {
+ .items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+ RTE_FLOW_ITEM_TYPE_IPV4,
+ RTE_FLOW_ITEM_TYPE_IPV6),
+ .actions = valid_actions,
+ .mask = &(const struct rte_flow_item_mpls){
+ .label_tc_s = "\xff\xff\xf0",
+ },
+ .default_mask = &rte_flow_item_mpls_mask,
+ .mask_sz = sizeof(struct rte_flow_item_mpls),
+ .convert = mlx5_flow_create_mpls,
+ .dst_sz = sizeof(struct ibv_flow_spec_tunnel),
+ },
};
/** Structure to pass to the conversion function. */
@@ -908,7 +936,9 @@ struct ibv_spec_header {
if (err)
goto exit_item_not_supported;
if (IS_TUNNEL(items->type)) {
- if (parser->tunnel) {
+ if (parser->tunnel &&
+ !(parser->tunnel == RTE_PTYPE_TUNNEL_GRE &&
+ items->type == RTE_FLOW_ITEM_TYPE_MPLS)) {
rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ITEM,
items,
@@ -929,7 +959,7 @@ struct ibv_spec_header {
items,
"Cannot support tunnel inner RSS");
parser->inner = IBV_FLOW_SPEC_INNER;
- parser->tunnel = rte_ptype[items->type];
+ parser->tunnel = flow2ptype[items->type];
parser->layer = HASH_RXQ_TUNNEL;
} else {
parser->layer = HASH_RXQ_ETH;
@@ -1726,7 +1756,7 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
- parser->tunnel = rte_ptype[item->type];
+ parser->tunnel = ptype2ptype[PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN)];
parser->out_layer = parser->layer;
parser->layer = HASH_RXQ_TUNNEL;
if (spec) {
@@ -1788,7 +1818,7 @@ struct ibv_spec_header {
id.vni[0] = 0;
parser->inner = IBV_FLOW_SPEC_INNER;
- parser->tunnel = rte_ptype[item->type];
+ parser->tunnel = ptype2ptype[PTYPE_TUN(RTE_PTYPE_TUNNEL_VXLAN_GPE)];
parser->out_layer = parser->layer;
parser->layer = HASH_RXQ_TUNNEL;
if (spec) {
@@ -1827,6 +1857,62 @@ struct ibv_spec_header {
}
/**
+ * Convert MPLS item to Verbs specification.
+ * Tunnel types currently supported are MPLS-in-GRE and MPLS-in-UDP.
+ *
+ * @param item[in]
+ * Item specification.
+ * @param default_mask[in]
+ * Default bit-masks to use when item->mask is not provided.
+ * @param data[in, out]
+ * User structure.
+ */
+static int
+mlx5_flow_create_mpls(const struct rte_flow_item *item,
+ const void *default_mask,
+ void *data)
+{
+ const struct rte_flow_item_mpls *spec = item->spec;
+ const struct rte_flow_item_mpls *mask = item->mask;
+ struct mlx5_flow_parse *parser = (struct mlx5_flow_parse *)data;
+ unsigned int size = sizeof(struct ibv_flow_spec_tunnel);
+ struct ibv_flow_spec_tunnel mpls = {
+ .type = parser->inner | IBV_FLOW_SPEC_VXLAN_TUNNEL,
+ .size = size,
+ };
+ union vni {
+ uint32_t vlan_id;
+ uint8_t vni[4];
+ } id;
+
+ id.vni[0] = 0;
+ parser->inner = IBV_FLOW_SPEC_INNER;
+ if (parser->layer == HASH_RXQ_UDPV4 ||
+ parser->layer == HASH_RXQ_UDPV6) {
+ parser->tunnel =
+ ptype2ptype[PTYPE_TUN(RTE_PTYPE_TUNNEL_MPLS_IN_UDP)];
+ parser->out_layer = parser->layer;
+ } else {
+ parser->tunnel =
+ ptype2ptype[PTYPE_TUN(RTE_PTYPE_TUNNEL_MPLS_IN_GRE)];
+ }
+ parser->layer = HASH_RXQ_TUNNEL;
+ if (spec) {
+ if (!mask)
+ mask = default_mask;
+ memcpy(&id.vni[1], spec->label_tc_s, 3);
+ mpls.val.tunnel_id = id.vlan_id;
+ memcpy(&id.vni[1], mask->label_tc_s, 3);
+ mpls.mask.tunnel_id = id.vlan_id;
+ /* Remove unwanted bits from values. */
+ mpls.val.tunnel_id &= mpls.mask.tunnel_id;
+ }
+
+ mlx5_flow_create_copy(parser, &mpls, size);
+ return 0;
+}
+
+/**
* Convert GRE item to Verbs specification.
*
* @param item[in]
@@ -1851,7 +1937,7 @@ struct ibv_spec_header {
(void)item;
(void)default_mask;
parser->inner = IBV_FLOW_SPEC_INNER;
- parser->tunnel = rte_ptype[item->type];
+ parser->tunnel = ptype2ptype[PTYPE_TUN(RTE_PTYPE_TUNNEL_GRE)];
parser->out_layer = parser->layer;
parser->layer = HASH_RXQ_TUNNEL;
mlx5_flow_create_copy(parser, &tunnel, size);
@@ -2325,7 +2411,7 @@ struct rte_flow *
}
/* Keep same if more than one tunnel types left. */
if (types == 1)
- rxq->tunnel = rte_ptype[ptype_flow_type[last]];
+ rxq->tunnel = ptype2ptype[last];
else if (types == 0) /* No tunnel type left. */
rxq->tunnel = 0;
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 0/5] introduce new tunnel types
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (22 preceding siblings ...)
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 21/21] net/mlx5: support MPLS-in-GRE and MPLS-in-UDP flow pattern Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement Xueming Li
` (16 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (5):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 ++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 ++++++++++++++++++++++++++++++----
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 ++++++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++
15 files changed, 245 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (23 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 0/5] introduce new tunnel types Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-11 9:57 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (15 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ec70b5fa9..8b8af47e3 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -108,10 +108,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
than *nb_pkts*, the application will assume that no more packets are present.
Some of the hw queue based hardware can only support smaller burst for RX
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (24 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-11 9:59 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (14 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
8 files changed, 73 insertions(+), 1 deletion(-)
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 3d8116ebd..fb710fff7 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -50,6 +50,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),
MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index bed727df8..c7cfc201a 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -256,6 +256,13 @@ enum rte_flow_item_type {
RTE_FLOW_ITEM_TYPE_VXLAN,
/**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+
+ /**
* Matches a E_TAG header.
*
* See struct rte_flow_item_e_tag.
@@ -676,6 +683,26 @@ static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flag). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* RTE_FLOW_ITEM_TYPE_E_TAG.
*
* Matches a E-tag header.
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 091d388d3..dc90379e5 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 62740254d..1839cf2ed 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..a64814179 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header.
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (25 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-11 9:58 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
` (13 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..10abfe89c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..a70cc7a4e 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (26 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-10 14:07 ` Nélio Laranjeiro
2018-04-11 9:59 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
` (12 subsequent siblings)
40 siblings, 2 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 24 ++++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 +++
6 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index f85c1c57f..f5abd589d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -137,6 +137,8 @@ enum index {
ITEM_SCTP_CKSUM,
ITEM_VXLAN,
ITEM_VXLAN_VNI,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
ITEM_E_TAG,
ITEM_E_TAG_GRP_ECID_B,
ITEM_NVGRE,
@@ -461,6 +463,7 @@ static const enum index next_item[] = {
ITEM_TCP,
ITEM_SCTP,
ITEM_VXLAN,
+ ITEM_VXLAN_GPE,
ITEM_E_TAG,
ITEM_NVGRE,
ITEM_MPLS,
@@ -589,6 +592,12 @@ static const enum index item_vxlan[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index item_e_tag[] = {
ITEM_E_TAG_GRP_ECID_B,
ITEM_NEXT,
@@ -1441,6 +1450,21 @@ 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_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
[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 4a273eff7..1a9bc37ed 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -972,6 +972,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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
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)),
@@ -3080,6 +3081,7 @@ flowtype_to_str(uint16_t flow_type)
{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
{"port", RTE_ETH_FLOW_PORT},
{"vxlan", RTE_ETH_FLOW_VXLAN},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
};
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..213888374 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* check udp destination port, 4790 is the default vxlan-gpe port */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPv4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2192bdcdf..68063b7a4 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -186,6 +186,7 @@ usage(char* progname)
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 593ae2160..b270602d9 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd53958a..2e8690f41 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -479,3 +479,8 @@ The commandline options are:
Set the hexadecimal bitmask of TX queue offloads.
The default value is 0.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v2 5/5] app/testpmd: add more GRE extension support to csum engine
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (27 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-10 13:00 ` Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 0/5] introduce new tunnel types Xueming Li
` (11 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-10 13:00 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 213888374..b73b8fe68 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-10 14:07 ` Nélio Laranjeiro
2018-04-11 9:59 ` Adrien Mazarguil
1 sibling, 0 replies; 111+ messages in thread
From: Nélio Laranjeiro @ 2018-04-10 14:07 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Shahaf Shuler, dev,
Olivier Matz
On Tue, Apr 10, 2018 at 09:00:35PM +0800, Xueming Li wrote:
> Add VXLAN-GPE support to csum forwarding engine and rte flow.
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
> app/test-pmd/cmdline_flow.c | 24 ++++++++++
> app/test-pmd/config.c | 2 +
> app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
> app/test-pmd/parameters.c | 12 ++++-
> app/test-pmd/testpmd.h | 2 +
> doc/guides/testpmd_app_ug/run_app.rst | 5 +++
> 6 files changed, 124 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index f85c1c57f..f5abd589d 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -137,6 +137,8 @@ enum index {
> ITEM_SCTP_CKSUM,
> ITEM_VXLAN,
> ITEM_VXLAN_VNI,
> + ITEM_VXLAN_GPE,
> + ITEM_VXLAN_GPE_VNI,
> ITEM_E_TAG,
> ITEM_E_TAG_GRP_ECID_B,
> ITEM_NVGRE,
> @@ -461,6 +463,7 @@ static const enum index next_item[] = {
> ITEM_TCP,
> ITEM_SCTP,
> ITEM_VXLAN,
> + ITEM_VXLAN_GPE,
> ITEM_E_TAG,
> ITEM_NVGRE,
> ITEM_MPLS,
> @@ -589,6 +592,12 @@ static const enum index item_vxlan[] = {
> ZERO,
> };
>
> +static const enum index item_vxlan_gpe[] = {
> + ITEM_VXLAN_GPE_VNI,
> + ITEM_NEXT,
> + ZERO,
> +};
> +
> static const enum index item_e_tag[] = {
> ITEM_E_TAG_GRP_ECID_B,
> ITEM_NEXT,
> @@ -1441,6 +1450,21 @@ 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_VXLAN_GPE] = {
> + .name = "vxlan-gpe",
> + .help = "match VXLAN-GPE header",
> + .priv = PRIV_ITEM(VXLAN_GPE,
> + sizeof(struct rte_flow_item_vxlan_gpe)),
> + .next = NEXT(item_vxlan_gpe),
> + .call = parse_vc,
> + },
> + [ITEM_VXLAN_GPE_VNI] = {
> + .name = "vni",
> + .help = "VXLAN-GPE identifier",
> + .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
> + vni)),
> + },
> [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 4a273eff7..1a9bc37ed 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -972,6 +972,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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
> 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)),
> @@ -3080,6 +3081,7 @@ flowtype_to_str(uint16_t flow_type)
> {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
> {"port", RTE_ETH_FLOW_PORT},
> {"vxlan", RTE_ETH_FLOW_VXLAN},
> + {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
> {"geneve", RTE_ETH_FLOW_GENEVE},
> {"nvgre", RTE_ETH_FLOW_NVGRE},
> };
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index 5f5ab64aa..213888374 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -60,6 +60,8 @@
> #define _htons(x) (x)
> #endif
>
> +uint16_t vxlan_gpe_udp_port = 4790;
> +
> /* structure that caches offload info for the current packet */
> struct testpmd_offload_info {
> uint16_t ethertype;
> @@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
> info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
> }
>
> +/* Parse a vxlan-gpe header */
> +static void
> +parse_vxlan_gpe(struct udp_hdr *udp_hdr,
> + struct testpmd_offload_info *info)
> +{
> + struct ether_hdr *eth_hdr;
> + struct ipv4_hdr *ipv4_hdr;
> + struct ipv6_hdr *ipv6_hdr;
> + struct vxlan_gpe_hdr *vxlan_gpe_hdr;
> + uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
> +
> + /* check udp destination port, 4790 is the default vxlan-gpe port */
The second part of the comment should be with the global variable. At
this stage, the user may already have changed the udp port and it is no
more comparing with the default value.
> + if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
> + return;
> +
> + vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
> + sizeof(struct udp_hdr));
> +
> + if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
> + VXLAN_GPE_TYPE_IPv4) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ipv4(ipv4_hdr, info);
> + info->ethertype = _htons(ETHER_TYPE_IPv4);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + info->ethertype = _htons(ETHER_TYPE_IPv6);
> + parse_ipv6(ipv6_hdr, info);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ethernet(eth_hdr, info);
> + } else
> + return;
> +
> + info->l2_len += ETHER_VXLAN_GPE_HLEN;
> +}
> +
> /* Parse a gre header */
> static void
> parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
> @@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
> * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
> * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
> * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
> + * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
> + * UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
> @@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>
> udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
> info.l3_len);
> - parse_vxlan(udp_hdr, &info, m->packet_type);
> - if (info.is_tunnel)
> - tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
> + parse_vxlan_gpe(udp_hdr, &info);
> + if (info.is_tunnel) {
> + tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
> + } else {
> + parse_vxlan(udp_hdr, &info,
> + m->packet_type);
> + if (info.is_tunnel)
> + tx_ol_flags |=
> + PKT_TX_TUNNEL_VXLAN;
> + }
> } else if (info.l4_proto == IPPROTO_GRE) {
> struct simple_gre_hdr *gre_hdr;
>
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 2192bdcdf..68063b7a4 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -70,7 +70,7 @@ usage(char* progname)
> "--rss-ip | --rss-udp | "
> "--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
> "--txpt= | --txht= | --txwt= | --txfreet= | "
> - "--txrst= | --tx-offloads ]\n",
> + "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
> progname);
> #ifdef RTE_LIBRTE_CMDLINE
> printf(" --interactive: run in interactive mode.\n");
> @@ -186,6 +186,7 @@ usage(char* progname)
> printf(" --flow-isolate-all: "
> "requests flow API isolated mode on all ports at initialization time.\n");
> printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
> + printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
> }
>
> #ifdef RTE_LIBRTE_CMDLINE
> @@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
> { "print-event", 1, 0, 0 },
> { "mask-event", 1, 0, 0 },
> { "tx-offloads", 1, 0, 0 },
> + { "vxlan-gpe-port", 1, 0, 0 },
> { 0, 0, 0, 0 },
> };
>
> @@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
> rte_exit(EXIT_FAILURE,
> "tx-offloads must be >= 0\n");
> }
> + if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
> + n = atoi(optarg);
> + if (n >= 0)
> + vxlan_gpe_udp_port = (uint16_t)n;
> + else
> + rte_exit(EXIT_FAILURE,
> + "vxlan-gpe-port must be >= 0\n");
> + }
> if (!strcmp(lgopts[opt_idx].name, "print-event"))
> if (parse_event_printing_config(optarg, 1)) {
> rte_exit(EXIT_FAILURE,
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 593ae2160..b270602d9 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
> extern struct fwd_lcore **fwd_lcores;
> extern struct fwd_stream **fwd_streams;
>
> +extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
> +
> extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
> extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
>
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
> index 1fd53958a..2e8690f41 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -479,3 +479,8 @@ The commandline options are:
>
> Set the hexadecimal bitmask of TX queue offloads.
> The default value is 0.
> +
> +* ``--vxlan-gpe-port=N``
> +
> + Set the UDP port number of tunnel VXLAN-GPE to N.
> + The default value is 4790.
> --
> 2.13.3
>
--
Nélio Laranjeiro
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-11 9:57 ` Adrien Mazarguil
0 siblings, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-11 9:57 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Tue, Apr 10, 2018 at 09:00:32PM +0800, Xueming Li wrote:
> Remove deprecation as implementation of RSS level provided in Adrien's
> patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
For next iterations I suggest to replace the above link with a proper commit
reference (once linked patch is applied), i.e.:
commit 0123456789ab ("ethdev: add encap level to RSS flow API action")
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-11 9:58 ` Adrien Mazarguil
0 siblings, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-11 9:58 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Tue, Apr 10, 2018 at 09:00:34PM +0800, Xueming Li wrote:
> This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
>
> MPLS-in-GRE protocol link:
> https://tools.ietf.org/html/rfc4023
>
> MPLS-in-UDP protocol link:
> https://tools.ietf.org/html/rfc7510
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Minor comments below, otherwise:
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
> lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
> index 49106c7df..10abfe89c 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.c
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.c
> @@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
> case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
> case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
> case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
> + case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
> + case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
> default: return "TUNNEL_UNKNOWN";
> }
> }
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
> index 7caf83312..a70cc7a4e 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.h
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.h
> @@ -436,6 +436,40 @@ extern "C" {
> */
> #define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
> /**
> + * MPLS-in-GRE tunneling packet type.
How about mentioning "(RFC 4023)"?
> + *
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=47
> + * | 'protocol'=0x8847>
> + * or,
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=47
> + * | 'protocol'=0x8848>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'protocol'=47
> + * | 'protocol'=0x8847>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=47
> + * | 'protocol'=0x8848>
> + */
> +#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
> +/**
> + * MPLS-in-UDP tunneling packet type.
Here also with "(RFC 7510)".
> + *
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=17
> + * | 'destination port'=6635>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=17
> + * | 'destination port'=6635>
> + */
> +#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
> +/**
> * Mask of tunneling packet types.
> */
> #define RTE_PTYPE_TUNNEL_MASK 0x0000f000
> --
> 2.13.3
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-11 9:59 ` Adrien Mazarguil
2018-04-11 12:04 ` Xueming(Steven) Li
0 siblings, 1 reply; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-11 9:59 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Tue, Apr 10, 2018 at 09:00:33PM +0800, Xueming Li wrote:
> VXLAN-GPE enables VXLAN for all protocols. Protocol link:
> https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Adding a new rte_flow pattern item in the middle of enum rte_flow_item_type
breaks ABI compatibility. It's fine for 18.05 because prior series already
destroyed it, however for this patch you need to choose between:
- Adding the new entry at the end of the enum and modifying the rest of the
code to follow the same order (preferred approach when not doing a full
API overhaul).
*or*
- Stating in the commit log what functions are impacted by ABI changes as in
"ethdev: remove DUP action from flow API" [1].
Also you must add a new "Item: ``VXLAN_GPE``" section to
doc/guides/prog_guide/rte_flow.rst (look for "VXLAN" for clues).
Otherwise patch is mostly fine, just a few comments below.
[1] http://dpdk.org/ml/archives/dev/2018-April/096526.html
> ---
> lib/librte_ether/rte_eth_ctrl.h | 3 ++-
> lib/librte_ether/rte_flow.c | 1 +
> lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
> lib/librte_mbuf/rte_mbuf.c | 3 +++
> lib/librte_mbuf/rte_mbuf.h | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
> lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
> 8 files changed, 73 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
> index 668f59acb..5ea8ae24c 100644
> --- a/lib/librte_ether/rte_eth_ctrl.h
> +++ b/lib/librte_ether/rte_eth_ctrl.h
> @@ -54,7 +54,8 @@ extern "C" {
> #define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
> #define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
> #define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
> -#define RTE_ETH_FLOW_MAX 22
> +#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
> +#define RTE_ETH_FLOW_MAX 23
>
> /**
> * Feature filter types
> diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
> index 3d8116ebd..fb710fff7 100644
> --- a/lib/librte_ether/rte_flow.c
> +++ b/lib/librte_ether/rte_flow.c
> @@ -50,6 +50,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
> 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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
Should be at the end of this array if you choose to not impact ABI.
> MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),
> MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
> MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
> diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
> index bed727df8..c7cfc201a 100644
> --- a/lib/librte_ether/rte_flow.h
> +++ b/lib/librte_ether/rte_flow.h
> @@ -256,6 +256,13 @@ enum rte_flow_item_type {
> RTE_FLOW_ITEM_TYPE_VXLAN,
>
> /**
> + * Matches a VXLAN-GPE header.
> + *
> + * See struct rte_flow_item_vxlan_gpe.
> + */
> + RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
> +
> + /**
Ditto for the enum definition.
> * Matches a E_TAG header.
> *
> * See struct rte_flow_item_e_tag.
> @@ -676,6 +683,26 @@ static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
> #endif
>
> /**
> + * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
> + *
> + * Matches a VXLAN-GPE header.
You should name the current IETF draft pending a proper RFC:
Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
> + */
> +struct rte_flow_item_vxlan_gpe {
> + uint8_t flags; /**< Normally 0x0c (I and P flag). */
> + uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
> + uint8_t protocol; /**< Protocol type. */
> + uint8_t vni[3]; /**< VXLAN identifier. */
> + uint8_t rsvd1; /**< Reserved, normally 0x00. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
> + .vni = "\xff\xff\xff",
> +};
> +#endif
Again if you choose to not impact ABI, this should be moved further down,
after the last item definition for consistency.
> +
> +/**
> * RTE_FLOW_ITEM_TYPE_E_TAG.
> *
> * Matches a E-tag header.
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> index 091d388d3..dc90379e5 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
> case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
> case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
> case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
> + case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
> case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
> case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
> default: return NULL;
> @@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
> "PKT_TX_TUNNEL_NONE" },
> { PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
> "PKT_TX_TUNNEL_NONE" },
> + { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
> + "PKT_TX_TUNNEL_NONE" },
> { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
> { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
> };
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 62740254d..1839cf2ed 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -210,6 +210,7 @@ extern "C" {
> #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
> /**< TX packet with MPLS-in-UDP RFC 7510 header. */
> #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
> +#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
> /* add new TX TUNNEL type here */
> #define PKT_TX_TUNNEL_MASK (0xFULL << 45)
>
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
> index 1feefacc6..49106c7df 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.c
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.c
> @@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
> case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
> case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
> case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
> + case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
> default: return "TUNNEL_UNKNOWN";
> }
> }
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
> index b9a338110..7caf83312 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.h
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.h
> @@ -423,6 +423,19 @@ extern "C" {
> */
> #define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
> /**
> + * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
> + *
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=17
> + * | 'destination port'=4790>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=17
> + * | 'destination port'=4790>
> + */
> +#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
> +/**
> * Mask of tunneling packet types.
> */
> #define RTE_PTYPE_TUNNEL_MASK 0x0000f000
> diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> index a271d1c86..a64814179 100644
> --- a/lib/librte_net/rte_ether.h
> +++ b/lib/librte_net/rte_ether.h
> @@ -311,6 +311,31 @@ struct vxlan_hdr {
> /**< VXLAN tunnel header length. */
>
> /**
> + * VXLAN-GPE protocol header.
> + * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
> + * Identifier and Reserved fields (16 bits and 8 bits).
Another reference to the current IETF draft here shouldn't hurt.
> + */
> +struct vxlan_gpe_hdr {
> + uint8_t vx_flags; /**< flag (8). */
> + uint8_t reserved[2]; /**< Reserved (16). */
> + uint8_t proto; /**< next-protocol (8). */
> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> +} __attribute__((__packed__));
> +
> +/* VXLAN-GPE next protocol types */
> +#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
> +#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
> +#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
> +#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
> +#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
> +#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
> +#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
> +
> +#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
> + sizeof(struct vxlan_gpe_hdr))
> +/**< VXLAN-GPE tunnel header length. */
> +
> +/**
> * Extract VLAN tag information into mbuf
> *
> * Software version of VLAN stripping
> --
> 2.13.3
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-10 14:07 ` Nélio Laranjeiro
@ 2018-04-11 9:59 ` Adrien Mazarguil
1 sibling, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-11 9:59 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Tue, Apr 10, 2018 at 09:00:35PM +0800, Xueming Li wrote:
> Add VXLAN-GPE support to csum forwarding engine and rte flow.
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Depending on whether you chose to impact ABI compatibility in the second
patch of the series, you may need to reorder all VXLAN_GPE definitions in
this patch to match that of the rte_flow API.
A few more comments below.
> ---
> app/test-pmd/cmdline_flow.c | 24 ++++++++++
> app/test-pmd/config.c | 2 +
> app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
> app/test-pmd/parameters.c | 12 ++++-
> app/test-pmd/testpmd.h | 2 +
> doc/guides/testpmd_app_ug/run_app.rst | 5 +++
> 6 files changed, 124 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index f85c1c57f..f5abd589d 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -137,6 +137,8 @@ enum index {
> ITEM_SCTP_CKSUM,
> ITEM_VXLAN,
> ITEM_VXLAN_VNI,
> + ITEM_VXLAN_GPE,
> + ITEM_VXLAN_GPE_VNI,
> ITEM_E_TAG,
> ITEM_E_TAG_GRP_ECID_B,
> ITEM_NVGRE,
> @@ -461,6 +463,7 @@ static const enum index next_item[] = {
> ITEM_TCP,
> ITEM_SCTP,
> ITEM_VXLAN,
> + ITEM_VXLAN_GPE,
> ITEM_E_TAG,
> ITEM_NVGRE,
> ITEM_MPLS,
> @@ -589,6 +592,12 @@ static const enum index item_vxlan[] = {
> ZERO,
> };
>
> +static const enum index item_vxlan_gpe[] = {
> + ITEM_VXLAN_GPE_VNI,
> + ITEM_NEXT,
> + ZERO,
> +};
> +
> static const enum index item_e_tag[] = {
> ITEM_E_TAG_GRP_ECID_B,
> ITEM_NEXT,
> @@ -1441,6 +1450,21 @@ 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_VXLAN_GPE] = {
> + .name = "vxlan-gpe",
> + .help = "match VXLAN-GPE header",
> + .priv = PRIV_ITEM(VXLAN_GPE,
> + sizeof(struct rte_flow_item_vxlan_gpe)),
> + .next = NEXT(item_vxlan_gpe),
> + .call = parse_vc,
> + },
> + [ITEM_VXLAN_GPE_VNI] = {
> + .name = "vni",
> + .help = "VXLAN-GPE identifier",
> + .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
> + vni)),
> + },
> [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 4a273eff7..1a9bc37ed 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -972,6 +972,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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
> 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)),
My first comment applies to all the above hunks.
> @@ -3080,6 +3081,7 @@ flowtype_to_str(uint16_t flow_type)
> {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
> {"port", RTE_ETH_FLOW_PORT},
> {"vxlan", RTE_ETH_FLOW_VXLAN},
> + {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
> {"geneve", RTE_ETH_FLOW_GENEVE},
> {"nvgre", RTE_ETH_FLOW_NVGRE},
> };
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index 5f5ab64aa..213888374 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -60,6 +60,8 @@
> #define _htons(x) (x)
> #endif
>
> +uint16_t vxlan_gpe_udp_port = 4790;
> +
> /* structure that caches offload info for the current packet */
> struct testpmd_offload_info {
> uint16_t ethertype;
> @@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
> info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
> }
>
> +/* Parse a vxlan-gpe header */
> +static void
> +parse_vxlan_gpe(struct udp_hdr *udp_hdr,
> + struct testpmd_offload_info *info)
> +{
> + struct ether_hdr *eth_hdr;
> + struct ipv4_hdr *ipv4_hdr;
> + struct ipv6_hdr *ipv6_hdr;
> + struct vxlan_gpe_hdr *vxlan_gpe_hdr;
> + uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
> +
> + /* check udp destination port, 4790 is the default vxlan-gpe port */
> + if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
> + return;
> +
> + vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
> + sizeof(struct udp_hdr));
> +
> + if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
> + VXLAN_GPE_TYPE_IPv4) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ipv4(ipv4_hdr, info);
> + info->ethertype = _htons(ETHER_TYPE_IPv4);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + info->ethertype = _htons(ETHER_TYPE_IPv6);
> + parse_ipv6(ipv6_hdr, info);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ethernet(eth_hdr, info);
> + } else
> + return;
> +
> + info->l2_len += ETHER_VXLAN_GPE_HLEN;
> +}
> +
> /* Parse a gre header */
> static void
> parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
> @@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
> * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
> * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
> * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
> + * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
> + * UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
> @@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>
> udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
> info.l3_len);
> - parse_vxlan(udp_hdr, &info, m->packet_type);
> - if (info.is_tunnel)
> - tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
> + parse_vxlan_gpe(udp_hdr, &info);
> + if (info.is_tunnel) {
> + tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
> + } else {
> + parse_vxlan(udp_hdr, &info,
> + m->packet_type);
> + if (info.is_tunnel)
> + tx_ol_flags |=
> + PKT_TX_TUNNEL_VXLAN;
> + }
> } else if (info.l4_proto == IPPROTO_GRE) {
> struct simple_gre_hdr *gre_hdr;
>
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 2192bdcdf..68063b7a4 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -70,7 +70,7 @@ usage(char* progname)
> "--rss-ip | --rss-udp | "
> "--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
> "--txpt= | --txht= | --txwt= | --txfreet= | "
> - "--txrst= | --tx-offloads ]\n",
> + "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
> progname);
> #ifdef RTE_LIBRTE_CMDLINE
> printf(" --interactive: run in interactive mode.\n");
> @@ -186,6 +186,7 @@ usage(char* progname)
> printf(" --flow-isolate-all: "
> "requests flow API isolated mode on all ports at initialization time.\n");
> printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
> + printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
> }
>
> #ifdef RTE_LIBRTE_CMDLINE
> @@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
> { "print-event", 1, 0, 0 },
> { "mask-event", 1, 0, 0 },
> { "tx-offloads", 1, 0, 0 },
> + { "vxlan-gpe-port", 1, 0, 0 },
> { 0, 0, 0, 0 },
> };
>
> @@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
> rte_exit(EXIT_FAILURE,
> "tx-offloads must be >= 0\n");
> }
> + if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
> + n = atoi(optarg);
> + if (n >= 0)
> + vxlan_gpe_udp_port = (uint16_t)n;
> + else
> + rte_exit(EXIT_FAILURE,
> + "vxlan-gpe-port must be >= 0\n");
> + }
> if (!strcmp(lgopts[opt_idx].name, "print-event"))
> if (parse_event_printing_config(optarg, 1)) {
> rte_exit(EXIT_FAILURE,
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 593ae2160..b270602d9 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
> extern struct fwd_lcore **fwd_lcores;
> extern struct fwd_stream **fwd_streams;
>
> +extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
> +
> extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
> extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
>
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
> index 1fd53958a..2e8690f41 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -479,3 +479,8 @@ The commandline options are:
>
> Set the hexadecimal bitmask of TX queue offloads.
> The default value is 0.
> +
> +* ``--vxlan-gpe-port=N``
> +
> + Set the UDP port number of tunnel VXLAN-GPE to N.
> + The default value is 4790.
You need to update the "Pattern items" section of the flow command
documentation as well.
> --
> 2.13.3
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-11 9:59 ` Adrien Mazarguil
@ 2018-04-11 12:04 ` Xueming(Steven) Li
0 siblings, 0 replies; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-04-11 12:04 UTC (permalink / raw)
To: Adrien Mazarguil
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nélio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
Hi Adrien,
> -----Original Message-----
> From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Sent: Wednesday, April 11, 2018 5:59 PM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>
> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing Wu <jingjing.wu@intel.com>;
> Thomas Monjalon <thomas@monjalon.net>; Nélio Laranjeiro
> <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-
> GPE
>
> On Tue, Apr 10, 2018 at 09:00:33PM +0800, Xueming Li wrote:
> > VXLAN-GPE enables VXLAN for all protocols. Protocol link:
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdat
> > atracker.ietf.org%2Fdoc%2Fdraft-ietf-nvo3-vxlan-gpe%2F&data=02%7C01%7C
> > xuemingl%40mellanox.com%7Ce69c95d98f5f457c966908d59f92e393%7Ca652971c7
> > d2e4d9ba6a4d149256f461b%7C0%7C0%7C636590375601220397&sdata=XZ6kpgEIrbB
> > wHrpODaZiByf6a2NQl4J6MadYYAsuNsc%3D&reserved=0
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
>
> Adding a new rte_flow pattern item in the middle of enum
> rte_flow_item_type breaks ABI compatibility. It's fine for 18.05 because
> prior series already destroyed it, however for this patch you need to
> choose between:
>
> - Adding the new entry at the end of the enum and modifying the rest of
> the
> code to follow the same order (preferred approach when not doing a full
> API overhaul).
>
> *or*
>
> - Stating in the commit log what functions are impacted by ABI changes as
> in
> "ethdev: remove DUP action from flow API" [1].
>
> Also you must add a new "Item: ``VXLAN_GPE``" section to
> doc/guides/prog_guide/rte_flow.rst (look for "VXLAN" for clues).
>
> Otherwise patch is mostly fine, just a few comments below.
>
> [1]
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpdk.org
> %2Fml%2Farchives%2Fdev%2F2018-
> April%2F096526.html&data=02%7C01%7Cxuemingl%40mellanox.com%7Ce69c95d98f5f4
> 57c966908d59f92e393%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636590375
> 601220397&sdata=8Q%2FMigA8hSHmM25UWUvhTOtVuit%2FxQRFBA6iF6lYxv8%3D&reserve
> d=0
>
Thanks, I've update code according to option 1.
> > ---
> > lib/librte_ether/rte_eth_ctrl.h | 3 ++-
> > lib/librte_ether/rte_flow.c | 1 +
> > lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
> > lib/librte_mbuf/rte_mbuf.c | 3 +++
> > lib/librte_mbuf/rte_mbuf.h | 1 +
> > lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> > lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
> > lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
> > 8 files changed, 73 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_ether/rte_eth_ctrl.h
> > b/lib/librte_ether/rte_eth_ctrl.h index 668f59acb..5ea8ae24c 100644
> > --- a/lib/librte_ether/rte_eth_ctrl.h
> > +++ b/lib/librte_ether/rte_eth_ctrl.h
> > @@ -54,7 +54,8 @@ extern "C" {
> > #define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based
> flow */
> > #define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based
> flow */
> > #define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based
> flow */
> > -#define RTE_ETH_FLOW_MAX 22
> > +#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol
> based flow */
> > +#define RTE_ETH_FLOW_MAX 23
> >
> > /**
> > * Feature filter types
> > diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
> > index 3d8116ebd..fb710fff7 100644
> > --- a/lib/librte_ether/rte_flow.c
> > +++ b/lib/librte_ether/rte_flow.c
> > @@ -50,6 +50,7 @@ static const struct rte_flow_desc_data
> rte_flow_desc_item[] = {
> > 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(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
>
> Should be at the end of this array if you choose to not impact ABI.
>
> > MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),
> > MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
> > MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)), diff --git
> > a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index
> > bed727df8..c7cfc201a 100644
> > --- a/lib/librte_ether/rte_flow.h
> > +++ b/lib/librte_ether/rte_flow.h
> > @@ -256,6 +256,13 @@ enum rte_flow_item_type {
> > RTE_FLOW_ITEM_TYPE_VXLAN,
> >
> > /**
> > + * Matches a VXLAN-GPE header.
> > + *
> > + * See struct rte_flow_item_vxlan_gpe.
> > + */
> > + RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
> > +
> > + /**
>
> Ditto for the enum definition.
>
> > * Matches a E_TAG header.
> > *
> > * See struct rte_flow_item_e_tag.
> > @@ -676,6 +683,26 @@ static const struct rte_flow_item_vxlan
> > rte_flow_item_vxlan_mask = { #endif
> >
> > /**
> > + * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
> > + *
> > + * Matches a VXLAN-GPE header.
>
> You should name the current IETF draft pending a proper RFC:
>
> Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
>
> > + */
> > +struct rte_flow_item_vxlan_gpe {
> > + uint8_t flags; /**< Normally 0x0c (I and P flag). */
> > + uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
> > + uint8_t protocol; /**< Protocol type. */
> > + uint8_t vni[3]; /**< VXLAN identifier. */
> > + uint8_t rsvd1; /**< Reserved, normally 0x00. */ };
> > +
> > +/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */ #ifndef
> > +__cplusplus static const struct rte_flow_item_vxlan_gpe
> > +rte_flow_item_vxlan_gpe_mask = {
> > + .vni = "\xff\xff\xff",
> > +};
> > +#endif
>
> Again if you choose to not impact ABI, this should be moved further down,
> after the last item definition for consistency.
>
> > +
> > +/**
> > * RTE_FLOW_ITEM_TYPE_E_TAG.
> > *
> > * Matches a E-tag header.
> > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> > index 091d388d3..dc90379e5 100644
> > --- a/lib/librte_mbuf/rte_mbuf.c
> > +++ b/lib/librte_mbuf/rte_mbuf.c
> > @@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
> > case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
> > case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
> > case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
> > + case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
> > case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
> > case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
> > default: return NULL;
> > @@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf,
> size_t buflen)
> > "PKT_TX_TUNNEL_NONE" },
> > { PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
> > "PKT_TX_TUNNEL_NONE" },
> > + { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
> > + "PKT_TX_TUNNEL_NONE" },
> > { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
> > { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
> > };
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index 62740254d..1839cf2ed 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -210,6 +210,7 @@ extern "C" {
> > #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45) /**< TX packet with
> > MPLS-in-UDP RFC 7510 header. */ #define PKT_TX_TUNNEL_MPLSINUDP
> > (0x5ULL << 45)
> > +#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
> > /* add new TX TUNNEL type here */
> > #define PKT_TX_TUNNEL_MASK (0xFULL << 45)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c
> > b/lib/librte_mbuf/rte_mbuf_ptype.c
> > index 1feefacc6..49106c7df 100644
> > --- a/lib/librte_mbuf/rte_mbuf_ptype.c
> > +++ b/lib/librte_mbuf/rte_mbuf_ptype.c
> > @@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
> > case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
> > case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
> > case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
> > + case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
> > default: return "TUNNEL_UNKNOWN";
> > }
> > }
> > diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h
> > b/lib/librte_mbuf/rte_mbuf_ptype.h
> > index b9a338110..7caf83312 100644
> > --- a/lib/librte_mbuf/rte_mbuf_ptype.h
> > +++ b/lib/librte_mbuf/rte_mbuf_ptype.h
> > @@ -423,6 +423,19 @@ extern "C" {
> > */
> > #define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
> > /**
> > + * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
> > + *
> > + * Packet format:
> > + * <'ether type'=0x0800
> > + * | 'version'=4, 'protocol'=17
> > + * | 'destination port'=4790>
> > + * or,
> > + * <'ether type'=0x86DD
> > + * | 'version'=6, 'next header'=17
> > + * | 'destination port'=4790>
> > + */
> > +#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
> > +/**
> > * Mask of tunneling packet types.
> > */
> > #define RTE_PTYPE_TUNNEL_MASK 0x0000f000
> > diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> > index a271d1c86..a64814179 100644
> > --- a/lib/librte_net/rte_ether.h
> > +++ b/lib/librte_net/rte_ether.h
> > @@ -311,6 +311,31 @@ struct vxlan_hdr { /**< VXLAN tunnel header
> > length. */
> >
> > /**
> > + * VXLAN-GPE protocol header.
> > + * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
> > + * Identifier and Reserved fields (16 bits and 8 bits).
>
> Another reference to the current IETF draft here shouldn't hurt.
>
> > + */
> > +struct vxlan_gpe_hdr {
> > + uint8_t vx_flags; /**< flag (8). */
> > + uint8_t reserved[2]; /**< Reserved (16). */
> > + uint8_t proto; /**< next-protocol (8). */
> > + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> > +} __attribute__((__packed__));
> > +
> > +/* VXLAN-GPE next protocol types */
> > +#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */ #define
> > +VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */ #define
> > +VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */ #define
> > +VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */ #define
> > +VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */ #define
> > +VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */ #define
> > +VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
> > +
> > +#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
> > + sizeof(struct vxlan_gpe_hdr)) /**< VXLAN-GPE
> tunnel header
> > +length. */
> > +
> > +/**
> > * Extract VLAN tag information into mbuf
> > *
> > * Software version of VLAN stripping
> > --
> > 2.13.3
>
> --
> Adrien Mazarguil
> 6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 0/5] introduce new tunnel types
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (28 preceding siblings ...)
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 1/5] doc: remove RSS configuration change announcement Xueming Li
` (10 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v3:
- Change VXLAN-GPE definition order to avoid ABI compatibility issue.
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (5):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 ++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 ++++++++++++++++++++++++++++++----
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/prog_guide/rte_flow.rst | 12 ++++
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 ++++++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++
16 files changed, 257 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 1/5] doc: remove RSS configuration change announcement
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (29 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 0/5] introduce new tunnel types Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (9 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ec70b5fa9..8b8af47e3 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -108,10 +108,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
than *nb_pkts*, the application will assume that no more packets are present.
Some of the hw queue based hardware can only support smaller burst for RX
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (30 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-12 12:01 ` Adrien Mazarguil
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (8 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 91dbd61a0..9d92d4e1e 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1044,6 +1044,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flag).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 3d8116ebd..58ec80f42 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index bed727df8..fefd69920 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -335,6 +335,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -864,6 +871,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flag). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 091d388d3..dc90379e5 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 62740254d..1839cf2ed 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..19af00a02 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (31 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
` (7 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..10abfe89c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..79ea31425 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type (RFC 4023).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type (RFC 7510).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (32 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-12 12:01 ` Adrien Mazarguil
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
` (6 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline_flow.c | 24 ++++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 +++
6 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index f85c1c57f..0d3c62599 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -154,6 +154,8 @@ enum index {
ITEM_GENEVE,
ITEM_GENEVE_VNI,
ITEM_GENEVE_PROTO,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
/* Validate/create actions. */
ACTIONS,
@@ -470,6 +472,7 @@ static const enum index next_item[] = {
ITEM_GTPC,
ITEM_GTPU,
ITEM_GENEVE,
+ ITEM_VXLAN_GPE,
ZERO,
};
@@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
@@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
protocol)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 4a273eff7..349eb9015 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -981,6 +981,7 @@ static const struct {
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)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Pattern item specification types. */
@@ -3082,6 +3083,7 @@ flowtype_to_str(uint16_t flow_type)
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..d98c51648 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* Check udp destination port. */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPv4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2192bdcdf..68063b7a4 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -186,6 +186,7 @@ usage(char* progname)
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 593ae2160..b270602d9 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd53958a..2e8690f41 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -479,3 +479,8 @@ The commandline options are:
Set the hexadecimal bitmask of TX queue offloads.
The default value is 0.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v3 5/5] app/testpmd: add more GRE extension support to csum engine
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (33 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-12 7:33 ` Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (5 subsequent siblings)
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-12 7:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index d98c51648..d32fb70e2 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-12 12:01 ` Adrien Mazarguil
0 siblings, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-12 12:01 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Thu, Apr 12, 2018 at 03:33:21PM +0800, Xueming Li wrote:
> VXLAN-GPE enables VXLAN for all protocols. Protocol link:
> https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
A couple of remaining minor comments, see below. Once addressed:
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
> lib/librte_ether/rte_eth_ctrl.h | 3 ++-
> lib/librte_ether/rte_flow.c | 1 +
> lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
> lib/librte_mbuf/rte_mbuf.c | 3 +++
> lib/librte_mbuf/rte_mbuf.h | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
> lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
> 9 files changed, 85 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 91dbd61a0..9d92d4e1e 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1044,6 +1044,18 @@ Matches a GENEVE header.
> - ``rsvd1``: reserved, normally 0x00.
> - Default ``mask`` matches VNI only.
>
> +Item: ``VXLAN-GPE``
> +^^^^^^^^^^^^^^^^^^^
> +
> +Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
> +
> +- ``flags``: normally 0x0C (I and P flag).
Minor nit:
=> - ``flags``: normally 0x0c (I and P flags).
> +- ``rsvd0``: reserved, normally 0x0000.
> +- ``protocol``: protocol type.
> +- ``vni``: VXLAN network identifier.
> +- ``rsvd1``: reserved, normally 0x00.
> +- Default ``mask`` matches VNI only.
> +
> Actions
> ~~~~~~~
>
> diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
> index 668f59acb..5ea8ae24c 100644
> --- a/lib/librte_ether/rte_eth_ctrl.h
> +++ b/lib/librte_ether/rte_eth_ctrl.h
> @@ -54,7 +54,8 @@ extern "C" {
> #define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
> #define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
> #define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
> -#define RTE_ETH_FLOW_MAX 22
> +#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
> +#define RTE_ETH_FLOW_MAX 23
>
> /**
> * Feature filter types
> diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
> index 3d8116ebd..58ec80f42 100644
> --- a/lib/librte_ether/rte_flow.c
> +++ b/lib/librte_ether/rte_flow.c
> @@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
> 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(GENEVE, sizeof(struct rte_flow_item_geneve)),
> + MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
> };
>
> /** Generate flow_action[] entry. */
> diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
> index bed727df8..fefd69920 100644
> --- a/lib/librte_ether/rte_flow.h
> +++ b/lib/librte_ether/rte_flow.h
> @@ -335,6 +335,13 @@ enum rte_flow_item_type {
> * See struct rte_flow_item_geneve.
> */
> RTE_FLOW_ITEM_TYPE_GENEVE,
> +
> + /**
> + * Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
Draft reference is unnecessary here, it should be provided further down with
the structure definition as for VXLAN.
> + *
> + * See struct rte_flow_item_vxlan_gpe.
> + */
> + RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
> };
>
> /**
> @@ -864,6 +871,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
> #endif
>
> /**
> + * RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
> + *
> + * Matches a VXLAN-GPE header.
Here:
=> Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
> + */
> +struct rte_flow_item_vxlan_gpe {
> + uint8_t flags; /**< Normally 0x0c (I and P flag). */
flag => flags
> + uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
> + uint8_t protocol; /**< Protocol type. */
> + uint8_t vni[3]; /**< VXLAN identifier. */
> + uint8_t rsvd1; /**< Reserved, normally 0x00. */
> +};
> +
> +/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
> +#ifndef __cplusplus
> +static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
> + .vni = "\xff\xff\xff",
> +};
> +#endif
> +
> +/**
> * Matching pattern item definition.
> *
> * A pattern is formed by stacking items starting from the lowest protocol
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> index 091d388d3..dc90379e5 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
> case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
> case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
> case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
> + case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
> case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
> case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
> default: return NULL;
> @@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
> "PKT_TX_TUNNEL_NONE" },
> { PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
> "PKT_TX_TUNNEL_NONE" },
> + { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
> + "PKT_TX_TUNNEL_NONE" },
> { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
> { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
> };
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 62740254d..1839cf2ed 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -210,6 +210,7 @@ extern "C" {
> #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
> /**< TX packet with MPLS-in-UDP RFC 7510 header. */
> #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
> +#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
> /* add new TX TUNNEL type here */
> #define PKT_TX_TUNNEL_MASK (0xFULL << 45)
>
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
> index 1feefacc6..49106c7df 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.c
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.c
> @@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
> case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
> case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
> case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
> + case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
> default: return "TUNNEL_UNKNOWN";
> }
> }
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
> index b9a338110..7caf83312 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.h
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.h
> @@ -423,6 +423,19 @@ extern "C" {
> */
> #define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
> /**
> + * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
> + *
> + * Packet format:
> + * <'ether type'=0x0800
> + * | 'version'=4, 'protocol'=17
> + * | 'destination port'=4790>
> + * or,
> + * <'ether type'=0x86DD
> + * | 'version'=6, 'next header'=17
> + * | 'destination port'=4790>
> + */
> +#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
> +/**
> * Mask of tunneling packet types.
> */
> #define RTE_PTYPE_TUNNEL_MASK 0x0000f000
> diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
> index a271d1c86..19af00a02 100644
> --- a/lib/librte_net/rte_ether.h
> +++ b/lib/librte_net/rte_ether.h
> @@ -311,6 +311,31 @@ struct vxlan_hdr {
> /**< VXLAN tunnel header length. */
>
> /**
> + * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
> + * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
> + * Identifier and Reserved fields (16 bits and 8 bits).
> + */
> +struct vxlan_gpe_hdr {
> + uint8_t vx_flags; /**< flag (8). */
> + uint8_t reserved[2]; /**< Reserved (16). */
> + uint8_t proto; /**< next-protocol (8). */
> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> +} __attribute__((__packed__));
> +
> +/* VXLAN-GPE next protocol types */
> +#define VXLAN_GPE_TYPE_IPv4 1 /**< IPv4 Protocol. */
> +#define VXLAN_GPE_TYPE_IPv6 2 /**< IPv6 Protocol. */
I suggest using all-caps macro definitions, i.e.:
#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 protocol. */
#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 protocol. */
checkpatch users will thank you :)
> +#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
> +#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
> +#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
> +#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
> +#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
> +
> +#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
> + sizeof(struct vxlan_gpe_hdr))
> +/**< VXLAN-GPE tunnel header length. */
> +
> +/**
> * Extract VLAN tag information into mbuf
> *
> * Software version of VLAN stripping
> --
> 2.13.3
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-12 12:01 ` Adrien Mazarguil
0 siblings, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-12 12:01 UTC (permalink / raw)
To: Xueming Li
Cc: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Nelio Laranjeiro,
Shahaf Shuler, dev, Olivier Matz
On Thu, Apr 12, 2018 at 03:33:23PM +0800, Xueming Li wrote:
> Add VXLAN-GPE support to csum forwarding engine and rte flow.
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
This commit still misses testpmd documentation for the new flow command
parameters ("Pattern items" section in
doc/guides/testpmd_app_ug/testpmd_funcs.rst).
Once addressed, as far as rte_flow is concerned (I did not review the csum
engine nor other configuration changes):
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> app/test-pmd/cmdline_flow.c | 24 ++++++++++
> app/test-pmd/config.c | 2 +
> app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++++++++--
> app/test-pmd/parameters.c | 12 ++++-
> app/test-pmd/testpmd.h | 2 +
> doc/guides/testpmd_app_ug/run_app.rst | 5 +++
> 6 files changed, 124 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index f85c1c57f..0d3c62599 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -154,6 +154,8 @@ enum index {
> ITEM_GENEVE,
> ITEM_GENEVE_VNI,
> ITEM_GENEVE_PROTO,
> + ITEM_VXLAN_GPE,
> + ITEM_VXLAN_GPE_VNI,
>
> /* Validate/create actions. */
> ACTIONS,
> @@ -470,6 +472,7 @@ static const enum index next_item[] = {
> ITEM_GTPC,
> ITEM_GTPU,
> ITEM_GENEVE,
> + ITEM_VXLAN_GPE,
> ZERO,
> };
>
> @@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
> ZERO,
> };
>
> +static const enum index item_vxlan_gpe[] = {
> + ITEM_VXLAN_GPE_VNI,
> + ITEM_NEXT,
> + ZERO,
> +};
> +
> static const enum index next_action[] = {
> ACTION_END,
> ACTION_VOID,
> @@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
> .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
> protocol)),
> },
> + [ITEM_VXLAN_GPE] = {
> + .name = "vxlan-gpe",
> + .help = "match VXLAN-GPE header",
> + .priv = PRIV_ITEM(VXLAN_GPE,
> + sizeof(struct rte_flow_item_vxlan_gpe)),
> + .next = NEXT(item_vxlan_gpe),
> + .call = parse_vc,
> + },
> + [ITEM_VXLAN_GPE_VNI] = {
> + .name = "vni",
> + .help = "VXLAN-GPE identifier",
> + .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
> + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
> + vni)),
> + },
>
> /* Validate/create actions. */
> [ACTIONS] = {
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 4a273eff7..349eb9015 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -981,6 +981,7 @@ static const struct {
> 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)),
> + MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
> };
>
> /** Pattern item specification types. */
> @@ -3082,6 +3083,7 @@ flowtype_to_str(uint16_t flow_type)
> {"vxlan", RTE_ETH_FLOW_VXLAN},
> {"geneve", RTE_ETH_FLOW_GENEVE},
> {"nvgre", RTE_ETH_FLOW_NVGRE},
> + {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
> };
>
> for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index 5f5ab64aa..d98c51648 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -60,6 +60,8 @@
> #define _htons(x) (x)
> #endif
>
> +uint16_t vxlan_gpe_udp_port = 4790;
> +
> /* structure that caches offload info for the current packet */
> struct testpmd_offload_info {
> uint16_t ethertype;
> @@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
> info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
> }
>
> +/* Parse a vxlan-gpe header */
> +static void
> +parse_vxlan_gpe(struct udp_hdr *udp_hdr,
> + struct testpmd_offload_info *info)
> +{
> + struct ether_hdr *eth_hdr;
> + struct ipv4_hdr *ipv4_hdr;
> + struct ipv6_hdr *ipv6_hdr;
> + struct vxlan_gpe_hdr *vxlan_gpe_hdr;
> + uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
> +
> + /* Check udp destination port. */
> + if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
> + return;
> +
> + vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
> + sizeof(struct udp_hdr));
> +
> + if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
> + VXLAN_GPE_TYPE_IPv4) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ipv4(ipv4_hdr, info);
> + info->ethertype = _htons(ETHER_TYPE_IPv4);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPv6) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + info->ethertype = _htons(ETHER_TYPE_IPv6);
> + parse_ipv6(ipv6_hdr, info);
> + info->l2_len = 0;
> +
> + } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
> + info->is_tunnel = 1;
> + info->outer_ethertype = info->ethertype;
> + info->outer_l2_len = info->l2_len;
> + info->outer_l3_len = info->l3_len;
> + info->outer_l4_proto = info->l4_proto;
> +
> + eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
> + vxlan_gpe_len);
> +
> + parse_ethernet(eth_hdr, info);
> + } else
> + return;
> +
> + info->l2_len += ETHER_VXLAN_GPE_HLEN;
> +}
> +
> /* Parse a gre header */
> static void
> parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
> @@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
> * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
> * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
> * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
> + * UDP|TCP|SCTP
> + * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
> + * UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
> * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
> @@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>
> udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
> info.l3_len);
> - parse_vxlan(udp_hdr, &info, m->packet_type);
> - if (info.is_tunnel)
> - tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
> + parse_vxlan_gpe(udp_hdr, &info);
> + if (info.is_tunnel) {
> + tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
> + } else {
> + parse_vxlan(udp_hdr, &info,
> + m->packet_type);
> + if (info.is_tunnel)
> + tx_ol_flags |=
> + PKT_TX_TUNNEL_VXLAN;
> + }
> } else if (info.l4_proto == IPPROTO_GRE) {
> struct simple_gre_hdr *gre_hdr;
>
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 2192bdcdf..68063b7a4 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -70,7 +70,7 @@ usage(char* progname)
> "--rss-ip | --rss-udp | "
> "--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
> "--txpt= | --txht= | --txwt= | --txfreet= | "
> - "--txrst= | --tx-offloads ]\n",
> + "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
> progname);
> #ifdef RTE_LIBRTE_CMDLINE
> printf(" --interactive: run in interactive mode.\n");
> @@ -186,6 +186,7 @@ usage(char* progname)
> printf(" --flow-isolate-all: "
> "requests flow API isolated mode on all ports at initialization time.\n");
> printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
> + printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
> }
>
> #ifdef RTE_LIBRTE_CMDLINE
> @@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
> { "print-event", 1, 0, 0 },
> { "mask-event", 1, 0, 0 },
> { "tx-offloads", 1, 0, 0 },
> + { "vxlan-gpe-port", 1, 0, 0 },
> { 0, 0, 0, 0 },
> };
>
> @@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
> rte_exit(EXIT_FAILURE,
> "tx-offloads must be >= 0\n");
> }
> + if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
> + n = atoi(optarg);
> + if (n >= 0)
> + vxlan_gpe_udp_port = (uint16_t)n;
> + else
> + rte_exit(EXIT_FAILURE,
> + "vxlan-gpe-port must be >= 0\n");
> + }
> if (!strcmp(lgopts[opt_idx].name, "print-event"))
> if (parse_event_printing_config(optarg, 1)) {
> rte_exit(EXIT_FAILURE,
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 593ae2160..b270602d9 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
> extern struct fwd_lcore **fwd_lcores;
> extern struct fwd_stream **fwd_streams;
>
> +extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
> +
> extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
> extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
>
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
> index 1fd53958a..2e8690f41 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -479,3 +479,8 @@ The commandline options are:
>
> Set the hexadecimal bitmask of TX queue offloads.
> The default value is 0.
> +
> +* ``--vxlan-gpe-port=N``
> +
> + Set the UDP port number of tunnel VXLAN-GPE to N.
> + The default value is 4790.
> --
> 2.13.3
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (34 preceding siblings ...)
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-16 22:33 ` Thomas Monjalon
` (12 more replies)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement Xueming Li
` (4 subsequent siblings)
40 siblings, 13 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v4:
- Update testpmd doc for flow VXLAN-GPE paramter.
v3:
- Change VXLAN-GPE definition order to avoid ABI compatibility issue.
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (5):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 +++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/prog_guide/rte_flow.rst | 12 ++++
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++
17 files changed, 261 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (35 preceding siblings ...)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-17 15:16 ` Iremonger, Bernard
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (3 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ec70b5fa9..8b8af47e3 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -108,10 +108,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
than *nb_pkts*, the application will assume that no more packets are present.
Some of the hw queue based hardware can only support smaller burst for RX
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (36 preceding siblings ...)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-16 22:23 ` Thomas Monjalon
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (2 subsequent siblings)
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 91dbd61a0..aa6439a5a 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1044,6 +1044,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flags).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 3d8116ebd..58ec80f42 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index bed727df8..301f44b8c 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -335,6 +335,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -864,6 +871,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flags). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 091d388d3..dc90379e5 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -405,6 +405,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -439,6 +440,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 62740254d..1839cf2ed 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..bd3e68b26 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (37 preceding siblings ...)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..10abfe89c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..79ea31425 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type (RFC 4023).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type (RFC 7510).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (38 preceding siblings ...)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
40 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
app/test-pmd/cmdline_flow.c | 24 +++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
7 files changed, 128 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index f85c1c57f..0d3c62599 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -154,6 +154,8 @@ enum index {
ITEM_GENEVE,
ITEM_GENEVE_VNI,
ITEM_GENEVE_PROTO,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
/* Validate/create actions. */
ACTIONS,
@@ -470,6 +472,7 @@ static const enum index next_item[] = {
ITEM_GTPC,
ITEM_GTPU,
ITEM_GENEVE,
+ ITEM_VXLAN_GPE,
ZERO,
};
@@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
@@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
protocol)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 4a273eff7..349eb9015 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -981,6 +981,7 @@ static const struct {
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)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Pattern item specification types. */
@@ -3082,6 +3083,7 @@ flowtype_to_str(uint16_t flow_type)
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..285709872 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* Check udp destination port. */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPV4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPV6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 2192bdcdf..68063b7a4 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -186,6 +186,7 @@ usage(char* progname)
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1091,6 +1093,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 593ae2160..b270602d9 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -446,6 +446,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd53958a..2e8690f41 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -479,3 +479,8 @@ The commandline options are:
Set the hexadecimal bitmask of TX queue offloads.
The default value is 0.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index e78f26dce..2f3a24c06 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3310,6 +3310,10 @@ This section lists supported pattern items and their attributes, if any.
- ``vni {unsigned}``: virtual network identifier.
- ``protocol {unsigned}``: protocol type.
+- ``vxlan-gpe``: match VXLAN-GPE header.
+
+ - ``vni {unsigned}``: VXLAN-GPE identifier.
+
Actions list
^^^^^^^^^^^^
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
` (39 preceding siblings ...)
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-13 11:02 ` Xueming Li
2018-04-17 15:12 ` Iremonger, Bernard
40 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-13 11:02 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 285709872..53b98412a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-16 22:23 ` Thomas Monjalon
2018-04-17 8:54 ` Mohammad Abdul Awal
0 siblings, 1 reply; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-16 22:23 UTC (permalink / raw)
To: Xueming Li
Cc: dev, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
13/04/2018 13:02, Xueming Li:
> +struct vxlan_gpe_hdr {
> + uint8_t vx_flags; /**< flag (8). */
> + uint8_t reserved[2]; /**< Reserved (16). */
> + uint8_t proto; /**< next-protocol (8). */
> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> +} __attribute__((__packed__));
minor nit: the field comments could be aligned
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
@ 2018-04-16 22:33 ` Thomas Monjalon
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 0/4] " Xueming Li
` (11 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-16 22:33 UTC (permalink / raw)
To: Xueming Li
Cc: dev, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
13/04/2018 13:02, Xueming Li:
> Xueming Li (5):
> doc: remove RSS configuration change announcement
> ethdev: introduce new tunnel VXLAN-GPE
> ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
> app/testpmd: introduce new tunnel VXLAN-GPE
> app/testpmd: add more GRE extension support to csum engine
I would personnaly prefer that the comments of the structures fields
in patch 2 (VXLAN-GPE) are aligned with few spaces.
Except this nit,
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-16 22:23 ` Thomas Monjalon
@ 2018-04-17 8:54 ` Mohammad Abdul Awal
0 siblings, 0 replies; 111+ messages in thread
From: Mohammad Abdul Awal @ 2018-04-17 8:54 UTC (permalink / raw)
To: Thomas Monjalon, Xueming Li
Cc: dev, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
On 16/04/2018 23:23, Thomas Monjalon wrote:
> 13/04/2018 13:02, Xueming Li:
>> +struct vxlan_gpe_hdr {
>> + uint8_t vx_flags; /**< flag (8). */
>> + uint8_t reserved[2]; /**< Reserved (16). */
>> + uint8_t proto; /**< next-protocol (8). */
>> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
>> +} __attribute__((__packed__));
> minor nit: the field comments could be aligned
>
Once addressed the above comment
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
2018-04-16 22:33 ` Thomas Monjalon
@ 2018-04-17 15:04 ` Xueming Li
2018-04-17 16:05 ` Iremonger, Bernard
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 1/4] doc: remove RSS configuration change announcement Xueming Li
` (10 subsequent siblings)
12 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:04 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v5:
- Fixed VXLAN-GPE comment alignment
v4:
- Update testpmd doc for flow VXLAN-GPE paramter.
v3:
- Change VXLAN-GPE definition order to avoid ABI compatibility issue.
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (4):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 +++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/prog_guide/rte_flow.rst | 12 ++++
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 ++++
lib/librte_net/rte_ether.h | 25 +++++++
17 files changed, 225 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 1/4] doc: remove RSS configuration change announcement
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
2018-04-16 22:33 ` Thomas Monjalon
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 0/4] " Xueming Li
@ 2018-04-17 15:04 ` Xueming Li
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (9 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:04 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index fd9def20c..36eb9006c 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -90,10 +90,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: A work is being planned for 18.05 to expose VF port representors
as a mean to perform control and data path operation on the different VFs.
As VF representor is an ethdev port, new fields are needed in order to map
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (2 preceding siblings ...)
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 1/4] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-17 15:04 ` Xueming Li
2018-04-17 20:56 ` Thomas Monjalon
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: " Xueming Li
` (8 subsequent siblings)
12 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:04 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2fb8e9c3f..ea36f307b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1054,6 +1054,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flags).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index cecab59f6..d4d07f7db 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 09a21e531..eecd1f5a3 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -339,6 +339,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -868,6 +875,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flags). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 3f4c83305..615dc1f98 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -390,6 +390,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -424,6 +425,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 06eceba37..242f58f49 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..c8ffa38ef 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 3/4] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (3 preceding siblings ...)
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-17 15:04 ` Xueming Li
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: add more GRE extension support to csum engine Xueming Li
` (7 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:04 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/cmdline_flow.c | 24 +++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
7 files changed, 128 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 32fe6645a..105f7f4c4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -154,6 +154,8 @@ enum index {
ITEM_GENEVE,
ITEM_GENEVE_VNI,
ITEM_GENEVE_PROTO,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
/* Validate/create actions. */
ACTIONS,
@@ -470,6 +472,7 @@ static const enum index next_item[] = {
ITEM_GTPC,
ITEM_GTPU,
ITEM_GENEVE,
+ ITEM_VXLAN_GPE,
ZERO,
};
@@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
@@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
protocol)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e7026011b..dd491c3ea 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -997,6 +997,7 @@ static const struct {
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)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Pattern item specification types. */
@@ -3098,6 +3099,7 @@ flowtype_to_str(uint16_t flow_type)
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..285709872 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* Check udp destination port. */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPV4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPV6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 394fa6d92..43af06589 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -187,6 +187,7 @@ usage(char* progname)
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
printf(" --hot-plug: enable hot plug for device.\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -625,6 +626,7 @@ launch_args_parse(int argc, char** argv)
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
{ "hot-plug", 0, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1121,6 +1123,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 070919822..60dfa09bd 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -448,6 +448,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index b3d98de46..351d826fa 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -485,3 +485,8 @@ The commandline options are:
* ``--hot-plug``
Enable device event monitor machenism for hotplug.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index bfb5ad027..e30adf526 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3310,6 +3310,10 @@ This section lists supported pattern items and their attributes, if any.
- ``vni {unsigned}``: virtual network identifier.
- ``protocol {unsigned}``: protocol type.
+- ``vxlan-gpe``: match VXLAN-GPE header.
+
+ - ``vni {unsigned}``: VXLAN-GPE identifier.
+
Actions list
^^^^^^^^^^^^
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 4/4] app/testpmd: add more GRE extension support to csum engine
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (4 preceding siblings ...)
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: " Xueming Li
@ 2018-04-17 15:04 ` Xueming Li
2018-04-17 15:33 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (6 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:04 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 285709872..53b98412a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-04-17 15:12 ` Iremonger, Bernard
0 siblings, 0 replies; 111+ messages in thread
From: Iremonger, Bernard @ 2018-04-17 15:12 UTC (permalink / raw)
To: Xueming Li, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon, Adrien Mazarguil
Cc: Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Li,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> Sent: Friday, April 13, 2018 12:02 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien
> Mazarguil <adrien.mazarguil@6wind.com>
> Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> Subject: [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension
> support to csum engine
>
> This patch adds GRE checksum and sequence extension supports in addtion to
> key extension to csum forwarding engine.
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
> app/test-pmd/csumonly.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> 285709872..53b98412a 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -49,9 +49,12 @@
> #define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
> #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
>
> -#define GRE_KEY_PRESENT 0x2000
> -#define GRE_KEY_LEN 4
> -#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
> +#define GRE_CHECKSUM_PRESENT 0x8000
> +#define GRE_KEY_PRESENT 0x2000
> +#define GRE_SEQUENCE_PRESENT 0x1000
> +#define GRE_EXT_LEN 4
> +#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT |
> GRE_KEY_PRESENT |\
> + GRE_SEQUENCE_PRESENT)
>
> /* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */ #if
> RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN @@ -269,14 +272,14 @@
> parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
> struct ipv6_hdr *ipv6_hdr;
> uint8_t gre_len = 0;
>
> - /* check which fields are supported */
> - if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
> - return;
> -
> gre_len += sizeof(struct simple_gre_hdr);
>
> if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
> - gre_len += GRE_KEY_LEN;
> + gre_len += GRE_EXT_LEN;
> + if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
> + gre_len += GRE_EXT_LEN;
> + if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
> + gre_len += GRE_EXT_LEN;
>
> if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
> info->is_tunnel = 1;
> @@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>
> /* step 3: fill the mbuf meta data (flags and header lengths) */
>
> + m->tx_offload = 0;
> if (info.is_tunnel == 1) {
> if (info.tunnel_tso_segsz ||
> (tx_offloads &
> --
> 2.13.3
This patch fails to apply to the current master branch.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-17 15:16 ` Iremonger, Bernard
2018-04-17 15:37 ` Xueming(Steven) Li
0 siblings, 1 reply; 111+ messages in thread
From: Iremonger, Bernard @ 2018-04-17 15:16 UTC (permalink / raw)
To: Xueming Li, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon, Adrien Mazarguil
Cc: Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Li,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> Sent: Friday, April 13, 2018 12:02 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien
> Mazarguil <adrien.mazarguil@6wind.com>
> Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> Subject: [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change
> announcement
>
> Remove deprecation as implementation of RSS level provided in Adrien's patch
> set: http://www.dpdk.org/dev/patchwork/patch/37399/
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> doc/guides/rel_notes/deprecation.rst | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index ec70b5fa9..8b8af47e3 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -108,10 +108,6 @@ Deprecation Notices
> Target release for removal of the legacy API will be defined once most
> PMDs have switched to rte_flow.
>
> -* ethdev: A new rss level field planned in 18.05.
> - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
> - of RSS hash calculation on outer or inner header of tunneled packet.
> -
> * ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
> than *nb_pkts*, the application will assume that no more packets are present.
> Some of the hw queue based hardware can only support smaller burst for RX
> --
> 2.13.3
This patch fails to apply to the current master branch.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (5 preceding siblings ...)
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: add more GRE extension support to csum engine Xueming Li
@ 2018-04-17 15:33 ` Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
` (5 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-17 15:33 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2fb8e9c3f..ea36f307b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1054,6 +1054,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flags).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index cecab59f6..d4d07f7db 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 09a21e531..eecd1f5a3 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -339,6 +339,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -868,6 +875,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flags). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 3f4c83305..615dc1f98 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -390,6 +390,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -424,6 +425,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 06eceba37..242f58f49 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..c8ffa38ef 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement
2018-04-17 15:16 ` Iremonger, Bernard
@ 2018-04-17 15:37 ` Xueming(Steven) Li
0 siblings, 0 replies; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-04-17 15:37 UTC (permalink / raw)
To: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon,
Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Bernard,
> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Tuesday, April 17, 2018 11:16 PM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>
> Cc: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org;
> Olivier Matz <olivier.matz@6wind.com>
> Subject: RE: [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement
>
> Hi Li,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> > Sent: Friday, April 13, 2018 12:02 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien
> > Mazarguil <adrien.mazarguil@6wind.com>
> > Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> > <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> > dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> > Subject: [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration
> > change announcement
> >
> > Remove deprecation as implementation of RSS level provided in Adrien's
> > patch
> > set:
> > https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> > dpdk.org%2Fdev%2Fpatchwork%2Fpatch%2F37399%2F&data=02%7C01%7Cxuemingl%
> > 40mellanox.com%7Cd264ab2220ae4151b20208d5a4762fe0%7Ca652971c7d2e4d9ba6
> > a4d149256f461b%7C0%7C0%7C636595749918860284&sdata=r5OtZ18aGoTXy%2Byuv9
> > kTDsRDD0fKF3FcPWJ%2FMRZ6VL8%3D&reserved=0
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > ---
> > doc/guides/rel_notes/deprecation.rst | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> > b/doc/guides/rel_notes/deprecation.rst
> > index ec70b5fa9..8b8af47e3 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -108,10 +108,6 @@ Deprecation Notices
> > Target release for removal of the legacy API will be defined once most
> > PMDs have switched to rte_flow.
> >
> > -* ethdev: A new rss level field planned in 18.05.
> > - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a
> > choice
> > - of RSS hash calculation on outer or inner header of tunneled packet.
> > -
> > * ethdev: Currently, if the rte_eth_rx_burst() function returns a value less
> > than *nb_pkts*, the application will assume that no more packets are present.
> > Some of the hw queue based hardware can only support smaller burst
> > for RX
> > --
> > 2.13.3
>
> This patch fails to apply to the current master branch.
Could you please try v5 version which rebased on latest code:
http://www.dpdk.org/ml/archives/dev/2018-April/097669.html
Thanks,
Xueming Li
>
> Regards,
>
> Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 0/4] " Xueming Li
@ 2018-04-17 16:05 ` Iremonger, Bernard
2018-04-18 11:55 ` Xueming(Steven) Li
0 siblings, 1 reply; 111+ messages in thread
From: Iremonger, Bernard @ 2018-04-17 16:05 UTC (permalink / raw)
To: Xueming Li, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon, Adrien Mazarguil
Cc: Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Li,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> Sent: Tuesday, April 17, 2018 4:04 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien
> Mazarguil <adrien.mazarguil@6wind.com>
> Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> Subject: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
>
> v5:
> - Fixed VXLAN-GPE comment alignment
> v4:
> - Update testpmd doc for flow VXLAN-GPE paramter.
> v3:
> - Change VXLAN-GPE definition order to avoid ABI compatibility issue.
> v2:
> - Split patch set into public and mlx5 two series, this one is the first.
> v1:
> - Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
> - Remove deprecation notes of rss level
>
> This patchset introduced new tunnel type and related testpmd code:
> - New tunnel type VXLAN-GPE
> https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
> - New tunnel type MPLS-in-GRE
> https://tools.ietf.org/html/rfc4023
> - New tunnel type MPLS-in-UDP
> https://tools.ietf.org/html/rfc7510
> - Support GRE extension in testpmd csum forwarding engine
>
> Xueming Li (4):
> doc: remove RSS configuration change announcement
> ethdev: introduce new tunnel VXLAN-GPE
> app/testpmd: introduce new tunnel VXLAN-GPE
> app/testpmd: add more GRE extension support to csum engine
>
> app/test-pmd/cmdline_flow.c | 24 +++++++
> app/test-pmd/config.c | 2 +
> app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
> app/test-pmd/parameters.c | 12 +++-
> app/test-pmd/testpmd.h | 2 +
> doc/guides/prog_guide/rte_flow.rst | 12 ++++
> doc/guides/rel_notes/deprecation.rst | 4 --
> doc/guides/testpmd_app_ug/run_app.rst | 5 ++
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
> lib/librte_ether/rte_eth_ctrl.h | 3 +-
> lib/librte_ether/rte_flow.c | 1 +
> lib/librte_ether/rte_flow.h | 27 ++++++++
> lib/librte_mbuf/rte_mbuf.c | 3 +
> lib/librte_mbuf/rte_mbuf.h | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> lib/librte_mbuf/rte_mbuf_ptype.h | 13 ++++
> lib/librte_net/rte_ether.h | 25 +++++++
> 17 files changed, 225 insertions(+), 17 deletions(-)
>
> --
> 2.13.3
Patch 3 of this patch set fails to apply to the latest master, the other three patches apply ok.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-17 20:56 ` Thomas Monjalon
2018-04-18 8:12 ` Adrien Mazarguil
0 siblings, 1 reply; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-17 20:56 UTC (permalink / raw)
To: Xueming Li
Cc: dev, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
17/04/2018 17:04, Xueming Li:
> +struct rte_flow_item_vxlan_gpe {
> + uint8_t flags; /**< Normally 0x0c (I and P flags). */
> + uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
> + uint8_t protocol; /**< Protocol type. */
> + uint8_t vni[3]; /**< VXLAN identifier. */
> + uint8_t rsvd1; /**< Reserved, normally 0x00. */
> +};
These comments are not aligned.
> +struct vxlan_gpe_hdr {
> + uint8_t vx_flags; /**< flag (8). */
> + uint8_t reserved[2]; /**< Reserved (16). */
> + uint8_t proto; /**< next-protocol (8). */
> + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> +} __attribute__((__packed__));
Alignment must be done with spaces.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE
2018-04-17 20:56 ` Thomas Monjalon
@ 2018-04-18 8:12 ` Adrien Mazarguil
0 siblings, 0 replies; 111+ messages in thread
From: Adrien Mazarguil @ 2018-04-18 8:12 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Xueming Li, dev, Wenzhuo Lu, Jingjing Wu, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
On Tue, Apr 17, 2018 at 10:56:52PM +0200, Thomas Monjalon wrote:
> 17/04/2018 17:04, Xueming Li:
> > +struct rte_flow_item_vxlan_gpe {
> > + uint8_t flags; /**< Normally 0x0c (I and P flags). */
> > + uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
> > + uint8_t protocol; /**< Protocol type. */
> > + uint8_t vni[3]; /**< VXLAN identifier. */
> > + uint8_t rsvd1; /**< Reserved, normally 0x00. */
> > +};
>
> These comments are not aligned.
Regarding this part: it's OK for rte_flow.h since it's the style used in
that file. Besides I favor it as it circumvents the entire alignemnt issue
altogether for subsequent contributions.
> > +struct vxlan_gpe_hdr {
> > + uint8_t vx_flags; /**< flag (8). */
> > + uint8_t reserved[2]; /**< Reserved (16). */
> > + uint8_t proto; /**< next-protocol (8). */
> > + uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
> > +} __attribute__((__packed__));
>
> Alignment must be done with spaces.
>
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-17 16:05 ` Iremonger, Bernard
@ 2018-04-18 11:55 ` Xueming(Steven) Li
2018-04-18 15:11 ` Iremonger, Bernard
0 siblings, 1 reply; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-04-18 11:55 UTC (permalink / raw)
To: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon,
Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, April 18, 2018 12:05 AM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>
> Cc: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org;
> Olivier Matz <olivier.matz@6wind.com>
> Subject: RE: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
>
> Hi Li,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> > Sent: Tuesday, April 17, 2018 4:04 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien
> > Mazarguil <adrien.mazarguil@6wind.com>
> > Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> > <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> > dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> > Subject: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
> >
> > v5:
> > - Fixed VXLAN-GPE comment alignment
> > v4:
> > - Update testpmd doc for flow VXLAN-GPE paramter.
> > v3:
> > - Change VXLAN-GPE definition order to avoid ABI compatibility issue.
> > v2:
> > - Split patch set into public and mlx5 two series, this one is the first.
> > v1:
> > - Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
> > - Remove deprecation notes of rss level
> >
> > This patchset introduced new tunnel type and related testpmd code:
> > - New tunnel type VXLAN-GPE
> >
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdat
> > atracker.ietf.org%2Fdoc%2Fdraft-ietf-nvo3-vxlan-gpe%2F&data=02%7C01%7C
> > xuemingl%40mellanox.com%7C2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7
> > d2e4d9ba6a4d149256f461b%7C0%7C0%7C636595779231620631&sdata=%2Bvx%2FgVB
> > 3e3BHI%2BYxPxOIpqK6CuKvQQ8qej4B1Faxihc%3D&reserved=0
> > - New tunnel type MPLS-in-GRE
> >
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftoo
> > ls.ietf.org%2Fhtml%2Frfc4023&data=02%7C01%7Cxuemingl%40mellanox.com%7C
> > 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b%7C
> > 0%7C0%7C636595779231620631&sdata=wk2wvoB9LSbI2LfHZVvWzmtgS0XQbGNMFL4G1
> > kyr77E%3D&reserved=0
> > - New tunnel type MPLS-in-UDP
> >
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftoo
> > ls.ietf.org%2Fhtml%2Frfc7510&data=02%7C01%7Cxuemingl%40mellanox.com%7C
> > 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b%7C
> > 0%7C0%7C636595779231620631&sdata=4RXbPD9tV7ArcnKsK8IJy%2B9XbKlzKcNBSv1
> > LXVwwuPs%3D&reserved=0
> > - Support GRE extension in testpmd csum forwarding engine
> >
> > Xueming Li (4):
> > doc: remove RSS configuration change announcement
> > ethdev: introduce new tunnel VXLAN-GPE
> > app/testpmd: introduce new tunnel VXLAN-GPE
> > app/testpmd: add more GRE extension support to csum engine
> >
> > app/test-pmd/cmdline_flow.c | 24 +++++++
> > app/test-pmd/config.c | 2 +
> > app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
> > app/test-pmd/parameters.c | 12 +++-
> > app/test-pmd/testpmd.h | 2 +
> > doc/guides/prog_guide/rte_flow.rst | 12 ++++
> > doc/guides/rel_notes/deprecation.rst | 4 --
> > doc/guides/testpmd_app_ug/run_app.rst | 5 ++
> > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
> > lib/librte_ether/rte_eth_ctrl.h | 3 +-
> > lib/librte_ether/rte_flow.c | 1 +
> > lib/librte_ether/rte_flow.h | 27 ++++++++
> > lib/librte_mbuf/rte_mbuf.c | 3 +
> > lib/librte_mbuf/rte_mbuf.h | 1 +
> > lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> > lib/librte_mbuf/rte_mbuf_ptype.h | 13 ++++
> > lib/librte_net/rte_ether.h | 25 +++++++
> > 17 files changed, 225 insertions(+), 17 deletions(-)
> >
> > --
> > 2.13.3
>
> Patch 3 of this patch set fails to apply to the latest master, the other three patches apply ok.
>
> Regards,
>
> Bernard.
>
I tried it with orgin/master branch and it worked for me.
Could you please share more information?
Best Regards,
Xueming Li
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-18 11:55 ` Xueming(Steven) Li
@ 2018-04-18 15:11 ` Iremonger, Bernard
2018-04-19 14:24 ` Xueming(Steven) Li
0 siblings, 1 reply; 111+ messages in thread
From: Iremonger, Bernard @ 2018-04-18 15:11 UTC (permalink / raw)
To: Xueming(Steven) Li, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon,
Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Li
<snip>
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> > > Sent: Tuesday, April 17, 2018 4:04 PM
> > > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > > <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> > > Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > > Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> > > <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>;
> > > dev@dpdk.org; Olivier Matz <olivier.matz@6wind.com>
> > > Subject: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
> > >
> > > v5:
> > > - Fixed VXLAN-GPE comment alignment
> > > v4:
> > > - Update testpmd doc for flow VXLAN-GPE paramter.
> > > v3:
> > > - Change VXLAN-GPE definition order to avoid ABI compatibility issue.
> > > v2:
> > > - Split patch set into public and mlx5 two series, this one is the first.
> > > v1:
> > > - Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
> > > - Remove deprecation notes of rss level
> > >
> > > This patchset introduced new tunnel type and related testpmd code:
> > > - New tunnel type VXLAN-GPE
> > >
> > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fd
> > > at
> > > atracker.ietf.org%2Fdoc%2Fdraft-ietf-nvo3-vxlan-gpe%2F&data=02%7C01%
> > > 7C
> > >
> xuemingl%40mellanox.com%7C2dffef40890b4cf8ff9d08d5a47d0420%7Ca65297
> 1
> > > c7
> > >
> d2e4d9ba6a4d149256f461b%7C0%7C0%7C636595779231620631&sdata=%2Bv
> x%2Fg
> > > VB
> > > 3e3BHI%2BYxPxOIpqK6CuKvQQ8qej4B1Faxihc%3D&reserved=0
> > > - New tunnel type MPLS-in-GRE
> > >
> > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ft
> > > oo
> > >
> ls.ietf.org%2Fhtml%2Frfc4023&data=02%7C01%7Cxuemingl%40mellanox.com%
> > > 7C
> > >
> 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b
> %
> > > 7C
> > >
> 0%7C0%7C636595779231620631&sdata=wk2wvoB9LSbI2LfHZVvWzmtgS0XQbG
> NMFL4
> > > G1
> > > kyr77E%3D&reserved=0
> > > - New tunnel type MPLS-in-UDP
> > >
> > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ft
> > > oo
> > >
> ls.ietf.org%2Fhtml%2Frfc7510&data=02%7C01%7Cxuemingl%40mellanox.com%
> > > 7C
> > >
> 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b
> %
> > > 7C
> > >
> 0%7C0%7C636595779231620631&sdata=4RXbPD9tV7ArcnKsK8IJy%2B9XbKlzKc
> NBS
> > > v1
> > > LXVwwuPs%3D&reserved=0
> > > - Support GRE extension in testpmd csum forwarding engine
> > >
> > > Xueming Li (4):
> > > doc: remove RSS configuration change announcement
> > > ethdev: introduce new tunnel VXLAN-GPE
> > > app/testpmd: introduce new tunnel VXLAN-GPE
> > > app/testpmd: add more GRE extension support to csum engine
> > >
> > > app/test-pmd/cmdline_flow.c | 24 +++++++
> > > app/test-pmd/config.c | 2 +
> > > app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++--
> -
> > > app/test-pmd/parameters.c | 12 +++-
> > > app/test-pmd/testpmd.h | 2 +
> > > doc/guides/prog_guide/rte_flow.rst | 12 ++++
> > > doc/guides/rel_notes/deprecation.rst | 4 --
> > > doc/guides/testpmd_app_ug/run_app.rst | 5 ++
> > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
> > > lib/librte_ether/rte_eth_ctrl.h | 3 +-
> > > lib/librte_ether/rte_flow.c | 1 +
> > > lib/librte_ether/rte_flow.h | 27 ++++++++
> > > lib/librte_mbuf/rte_mbuf.c | 3 +
> > > lib/librte_mbuf/rte_mbuf.h | 1 +
> > > lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> > > lib/librte_mbuf/rte_mbuf_ptype.h | 13 ++++
> > > lib/librte_net/rte_ether.h | 25 +++++++
> > > 17 files changed, 225 insertions(+), 17 deletions(-)
> > >
> > > --
> > > 2.13.3
> >
> > Patch 3 of this patch set fails to apply to the latest master, the other three
> patches apply ok.
> >
> > Regards,
> >
> > Bernard.
> >
> I tried it with orgin/master branch and it worked for me.
> Could you please share more information?
>
> Best Regards,
> Xueming Li
I have just cloned the current dpdk master, patch 3 still fails to apply, dpdk-dev-v5-3-4-app-testpmd-introduce-new-tunnel-VXLAN-GPE.patch
git am ./dpdk-dev-v5-3-4-app-testpmd-introduce-new-tunnel-VXLAN-GPE.patch
Applying: app/testpmd: introduce new tunnel VXLAN-GPE
error: patch failed: app/test-pmd/config.c:997
error: app/test-pmd/config.c: patch does not apply
Patch failed at 0001 app/testpmd: introduce new tunnel VXLAN-GPE
The copy of the patch that failed is found in:
/root/dpdk_temp/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort
Regards,
Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-18 15:11 ` Iremonger, Bernard
@ 2018-04-19 14:24 ` Xueming(Steven) Li
2018-04-19 14:57 ` Thomas Monjalon
0 siblings, 1 reply; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-04-19 14:24 UTC (permalink / raw)
To: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Thomas Monjalon,
Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, April 18, 2018 11:11 PM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>
> Cc: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org;
> Olivier Matz <olivier.matz@6wind.com>
> Subject: RE: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
>
> Hi Li
>
> <snip>
>
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> > > > Sent: Tuesday, April 17, 2018 4:04 PM
> > > > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > > > <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> > > > Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > > > Cc: Xueming Li <xuemingl@mellanox.com>; Nelio Laranjeiro
> > > > <nelio.laranjeiro@6wind.com>; Shahaf Shuler
> > > > <shahafs@mellanox.com>; dev@dpdk.org; Olivier Matz
> > > > <olivier.matz@6wind.com>
> > > > Subject: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
> > > >
> > > > v5:
> > > > - Fixed VXLAN-GPE comment alignment
> > > > v4:
> > > > - Update testpmd doc for flow VXLAN-GPE paramter.
> > > > v3:
> > > > - Change VXLAN-GPE definition order to avoid ABI compatibility issue.
> > > > v2:
> > > > - Split patch set into public and mlx5 two series, this one is the first.
> > > > v1:
> > > > - Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
> > > > - Remove deprecation notes of rss level
> > > >
> > > > This patchset introduced new tunnel type and related testpmd code:
> > > > - New tunnel type VXLAN-GPE
> > > >
> > > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2
> > > > Fd
> > > > at
> > > > atracker.ietf.org%2Fdoc%2Fdraft-ietf-nvo3-vxlan-gpe%2F&data=02%7C0
> > > > 1%
> > > > 7C
> > > >
> > xuemingl%40mellanox.com%7C2dffef40890b4cf8ff9d08d5a47d0420%7Ca65297
> > 1
> > > > c7
> > > >
> > d2e4d9ba6a4d149256f461b%7C0%7C0%7C636595779231620631&sdata=%2Bv
> > x%2Fg
> > > > VB
> > > > 3e3BHI%2BYxPxOIpqK6CuKvQQ8qej4B1Faxihc%3D&reserved=0
> > > > - New tunnel type MPLS-in-GRE
> > > >
> > > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2
> > > > Ft
> > > > oo
> > > >
> > ls.ietf.org%2Fhtml%2Frfc4023&data=02%7C01%7Cxuemingl%40mellanox.com%
> > > > 7C
> > > >
> > 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b
> > %
> > > > 7C
> > > >
> > 0%7C0%7C636595779231620631&sdata=wk2wvoB9LSbI2LfHZVvWzmtgS0XQbG
> > NMFL4
> > > > G1
> > > > kyr77E%3D&reserved=0
> > > > - New tunnel type MPLS-in-UDP
> > > >
> > > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2
> > > > Ft
> > > > oo
> > > >
> > ls.ietf.org%2Fhtml%2Frfc7510&data=02%7C01%7Cxuemingl%40mellanox.com%
> > > > 7C
> > > >
> > 2dffef40890b4cf8ff9d08d5a47d0420%7Ca652971c7d2e4d9ba6a4d149256f461b
> > %
> > > > 7C
> > > >
> > 0%7C0%7C636595779231620631&sdata=4RXbPD9tV7ArcnKsK8IJy%2B9XbKlzKc
> > NBS
> > > > v1
> > > > LXVwwuPs%3D&reserved=0
> > > > - Support GRE extension in testpmd csum forwarding engine
> > > >
> > > > Xueming Li (4):
> > > > doc: remove RSS configuration change announcement
> > > > ethdev: introduce new tunnel VXLAN-GPE
> > > > app/testpmd: introduce new tunnel VXLAN-GPE
> > > > app/testpmd: add more GRE extension support to csum engine
> > > >
> > > > app/test-pmd/cmdline_flow.c | 24 +++++++
> > > > app/test-pmd/config.c | 2 +
> > > > app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++--
> > -
> > > > app/test-pmd/parameters.c | 12 +++-
> > > > app/test-pmd/testpmd.h | 2 +
> > > > doc/guides/prog_guide/rte_flow.rst | 12 ++++
> > > > doc/guides/rel_notes/deprecation.rst | 4 --
> > > > doc/guides/testpmd_app_ug/run_app.rst | 5 ++
> > > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
> > > > lib/librte_ether/rte_eth_ctrl.h | 3 +-
> > > > lib/librte_ether/rte_flow.c | 1 +
> > > > lib/librte_ether/rte_flow.h | 27 ++++++++
> > > > lib/librte_mbuf/rte_mbuf.c | 3 +
> > > > lib/librte_mbuf/rte_mbuf.h | 1 +
> > > > lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
> > > > lib/librte_mbuf/rte_mbuf_ptype.h | 13 ++++
> > > > lib/librte_net/rte_ether.h | 25 +++++++
> > > > 17 files changed, 225 insertions(+), 17 deletions(-)
> > > >
> > > > --
> > > > 2.13.3
> > >
> > > Patch 3 of this patch set fails to apply to the latest master, the
> > > other three
> > patches apply ok.
> > >
> > > Regards,
> > >
> > > Bernard.
> > >
> > I tried it with orgin/master branch and it worked for me.
> > Could you please share more information?
> >
> > Best Regards,
> > Xueming Li
>
> I have just cloned the current dpdk master, patch 3 still fails to apply, dpdk-dev-v5-3-4-app-testpmd-
> introduce-new-tunnel-VXLAN-GPE.patch
>
> git am ./dpdk-dev-v5-3-4-app-testpmd-introduce-new-tunnel-VXLAN-GPE.patch
> Applying: app/testpmd: introduce new tunnel VXLAN-GPE
> error: patch failed: app/test-pmd/config.c:997
> error: app/test-pmd/config.c: patch does not apply Patch failed at 0001 app/testpmd: introduce new
> tunnel VXLAN-GPE The copy of the patch that failed is found in:
> /root/dpdk_temp/.git/rebase-apply/patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort
>
You are correct, I can reproduce it now. Will send out a new v6 series soon, thanks.
> Regards,
>
> Bernard.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-19 14:24 ` Xueming(Steven) Li
@ 2018-04-19 14:57 ` Thomas Monjalon
2018-04-19 19:56 ` Ferruh Yigit
0 siblings, 1 reply; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-19 14:57 UTC (permalink / raw)
To: Xueming(Steven) Li, ferruh.yigit
Cc: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Adrien Mazarguil,
Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
19/04/2018 16:24, Xueming(Steven) Li:
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > I have just cloned the current dpdk master, patch 3 still fails to apply, dpdk-dev-v5-3-4-app-testpmd-
> > introduce-new-tunnel-VXLAN-GPE.patch
> >
> > git am ./dpdk-dev-v5-3-4-app-testpmd-introduce-new-tunnel-VXLAN-GPE.patch
> > Applying: app/testpmd: introduce new tunnel VXLAN-GPE
> > error: patch failed: app/test-pmd/config.c:997
> > error: app/test-pmd/config.c: patch does not apply Patch failed at 0001 app/testpmd: introduce new
> > tunnel VXLAN-GPE The copy of the patch that failed is found in:
> > /root/dpdk_temp/.git/rebase-apply/patch
> > When you have resolved this problem, run "git am --continue".
> > If you prefer to skip this patch, run "git am --skip" instead.
> > To restore the original branch and stop patching, run "git am --abort
> >
>
> You are correct, I can reproduce it now. Will send out a new v6 series soon, thanks.
You should rebase on top of next-net.
Ferruh, you confirm you will take those patches in next-net?
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/4] introduce new tunnel types
2018-04-19 14:57 ` Thomas Monjalon
@ 2018-04-19 19:56 ` Ferruh Yigit
0 siblings, 0 replies; 111+ messages in thread
From: Ferruh Yigit @ 2018-04-19 19:56 UTC (permalink / raw)
To: Thomas Monjalon, Xueming(Steven) Li
Cc: Iremonger, Bernard, Lu, Wenzhuo, Wu, Jingjing, Adrien Mazarguil,
Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
On 4/19/2018 3:57 PM, Thomas Monjalon wrote:
> 19/04/2018 16:24, Xueming(Steven) Li:
>> From: Iremonger, Bernard <bernard.iremonger@intel.com>
>>> I have just cloned the current dpdk master, patch 3 still fails to apply, dpdk-dev-v5-3-4-app-testpmd-
>>> introduce-new-tunnel-VXLAN-GPE.patch
>>>
>>> git am ./dpdk-dev-v5-3-4-app-testpmd-introduce-new-tunnel-VXLAN-GPE.patch
>>> Applying: app/testpmd: introduce new tunnel VXLAN-GPE
>>> error: patch failed: app/test-pmd/config.c:997
>>> error: app/test-pmd/config.c: patch does not apply Patch failed at 0001 app/testpmd: introduce new
>>> tunnel VXLAN-GPE The copy of the patch that failed is found in:
>>> /root/dpdk_temp/.git/rebase-apply/patch
>>> When you have resolved this problem, run "git am --continue".
>>> If you prefer to skip this patch, run "git am --skip" instead.
>>> To restore the original branch and stop patching, run "git am --abort
>>>
>>
>> You are correct, I can reproduce it now. Will send out a new v6 series soon, thanks.
>
> You should rebase on top of next-net.
> Ferruh, you confirm you will take those patches in next-net?
Yes, I was thinking this for next-net, because it is ethdev related
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (6 preceding siblings ...)
2018-04-17 15:33 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 " Xueming Li
` (5 more replies)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 1/5] doc: remove RSS configuration change announcement Xueming Li
` (4 subsequent siblings)
12 siblings, 6 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v6:
- Add MPLS-in-GRE and MPLS-in-UDP back
- UPdate comment alignment
v5:
- Fixed VXLAN-GPE comment alignment
- Removed MPLS-in-GRE and MPLS-in-UDP patch
v4:
- Update testpmd doc for flow VXLAN-GPE paramter.
v3:
- Change VXLAN-GPE definition order to avoid ABI compatibility issue.
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (5):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 +++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/prog_guide/rte_flow.rst | 12 ++++
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++
17 files changed, 261 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 1/5] doc: remove RSS configuration change announcement
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (7 preceding siblings ...)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (3 subsequent siblings)
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 93747bf24..aba50b8ec 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -86,10 +86,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: A work is being planned for 18.05 to expose VF port representors
as a mean to perform control and data path operation on the different VFs.
As VF representor is an ethdev port, new fields are needed in order to map
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (8 preceding siblings ...)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
2018-04-23 9:43 ` Olivier Matz
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (2 subsequent siblings)
12 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2fb8e9c3f..ea36f307b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1054,6 +1054,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flags).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index cecab59f6..d4d07f7db 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 09a21e531..eecd1f5a3 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -339,6 +339,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -868,6 +875,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flags). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 3f4c83305..615dc1f98 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -390,6 +390,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -424,6 +425,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 06eceba37..242f58f49 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..95d0a533f 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (9 preceding siblings ...)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
2018-04-23 9:43 ` Olivier Matz
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
12 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..10abfe89c 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..79ea31425 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type (RFC 4023).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type (RFC 7510).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (10 preceding siblings ...)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/cmdline_flow.c | 24 +++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
7 files changed, 128 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 32fe6645a..105f7f4c4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -154,6 +154,8 @@ enum index {
ITEM_GENEVE,
ITEM_GENEVE_VNI,
ITEM_GENEVE_PROTO,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
/* Validate/create actions. */
ACTIONS,
@@ -470,6 +472,7 @@ static const enum index next_item[] = {
ITEM_GTPC,
ITEM_GTPU,
ITEM_GENEVE,
+ ITEM_VXLAN_GPE,
ZERO,
};
@@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
@@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
protocol)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e7026011b..dd491c3ea 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -997,6 +997,7 @@ static const struct {
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)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Pattern item specification types. */
@@ -3098,6 +3099,7 @@ flowtype_to_str(uint16_t flow_type)
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..285709872 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* Check udp destination port. */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPV4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPV6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 394fa6d92..43af06589 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -187,6 +187,7 @@ usage(char* progname)
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
printf(" --hot-plug: enable hot plug for device.\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -625,6 +626,7 @@ launch_args_parse(int argc, char** argv)
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
{ "hot-plug", 0, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1121,6 +1123,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 070919822..60dfa09bd 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -448,6 +448,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index b3d98de46..351d826fa 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -485,3 +485,8 @@ The commandline options are:
* ``--hot-plug``
Enable device event monitor machenism for hotplug.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index bfb5ad027..e30adf526 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3310,6 +3310,10 @@ This section lists supported pattern items and their attributes, if any.
- ``vni {unsigned}``: virtual network identifier.
- ``protocol {unsigned}``: protocol type.
+- ``vxlan-gpe``: match VXLAN-GPE header.
+
+ - ``vni {unsigned}``: VXLAN-GPE identifier.
+
Actions list
^^^^^^^^^^^^
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v6 5/5] app/testpmd: add more GRE extension support to csum engine
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
` (11 preceding siblings ...)
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-20 11:56 ` Xueming Li
12 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-20 11:56 UTC (permalink / raw)
To: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 285709872..53b98412a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-23 9:43 ` Olivier Matz
0 siblings, 0 replies; 111+ messages in thread
From: Olivier Matz @ 2018-04-23 9:43 UTC (permalink / raw)
To: Xueming Li
Cc: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil, Nelio Laranjeiro, Shahaf Shuler, dev
Hi Xueming,
On Fri, Apr 20, 2018 at 07:56:27PM +0800, Xueming Li wrote:
> This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
>
> MPLS-in-GRE protocol link:
> https://tools.ietf.org/html/rfc4023
>
> MPLS-in-UDP protocol link:
> https://tools.ietf.org/html/rfc7510
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> ---
> lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
> lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
> index 49106c7df..10abfe89c 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.c
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.c
> @@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
> case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
> case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
> case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
> + case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS-IN-UDP";
> + case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS-IN-GRE";
> default: return "TUNNEL_UNKNOWN";
> }
> }
Just one minor comment here:
I suggest "TUNNEL_MPLS_IN_UDP" instead of "TUNNEL_MPLS-IN-UDP", in order
to be consistent with other strings.
Once fixed, feel free to add my ack in the next revision.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-23 9:43 ` Olivier Matz
0 siblings, 0 replies; 111+ messages in thread
From: Olivier Matz @ 2018-04-23 9:43 UTC (permalink / raw)
To: Xueming Li
Cc: Iremonger Bernard, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil, Nelio Laranjeiro, Shahaf Shuler, dev
On Fri, Apr 20, 2018 at 07:56:26PM +0800, Xueming Li wrote:
> VXLAN-GPE enables VXLAN for all protocols. Protocol link:
> https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 0/5] introduce new tunnel types
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
2018-04-25 21:31 ` Ferruh Yigit
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement Xueming Li
` (4 subsequent siblings)
5 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
v7:
- Fixed display name of MPLS-in-GRE and MPLS-in-UDP
v6:
- Add MPLS-in-GRE and MPLS-in-UDP back
- UPdate comment alignment
v5:
- Fixed VXLAN-GPE comment alignment
- Removed MPLS-in-GRE and MPLS-in-UDP patch
v4:
- Update testpmd doc for flow VXLAN-GPE paramter.
v3:
- Change VXLAN-GPE definition order to avoid ABI compatibility issue.
v2:
- Split patch set into public and mlx5 two series, this one is the first.
v1:
- Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
- Remove deprecation notes of rss level
This patchset introduced new tunnel type and related testpmd code:
- New tunnel type VXLAN-GPE
https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
- New tunnel type MPLS-in-GRE
https://tools.ietf.org/html/rfc4023
- New tunnel type MPLS-in-UDP
https://tools.ietf.org/html/rfc7510
- Support GRE extension in testpmd csum forwarding engine
Xueming Li (5):
doc: remove RSS configuration change announcement
ethdev: introduce new tunnel VXLAN-GPE
ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
app/testpmd: introduce new tunnel VXLAN-GPE
app/testpmd: add more GRE extension support to csum engine
app/test-pmd/cmdline_flow.c | 24 +++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 103 +++++++++++++++++++++++++---
app/test-pmd/parameters.c | 12 +++-
app/test-pmd/testpmd.h | 2 +
doc/guides/prog_guide/rte_flow.rst | 12 ++++
doc/guides/rel_notes/deprecation.rst | 4 --
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
lib/librte_ether/rte_eth_ctrl.h | 3 +-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 ++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 3 +
lib/librte_mbuf/rte_mbuf_ptype.h | 47 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++
17 files changed, 261 insertions(+), 17 deletions(-)
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 " Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
2018-04-23 16:13 ` Ferruh Yigit
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
` (3 subsequent siblings)
5 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Remove deprecation as implementation of RSS level provided in Adrien's
patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 93747bf24..aba50b8ec 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -86,10 +86,6 @@ Deprecation Notices
Target release for removal of the legacy API will be defined once most
PMDs have switched to rte_flow.
-* ethdev: A new rss level field planned in 18.05.
- The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
- of RSS hash calculation on outer or inner header of tunneled packet.
-
* ethdev: A work is being planned for 18.05 to expose VF port representors
as a mean to perform control and data path operation on the different VFs.
As VF representor is an ethdev port, new fields are needed in order to map
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 2/5] ethdev: introduce new tunnel VXLAN-GPE
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 " Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
` (2 subsequent siblings)
5 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
VXLAN-GPE enables VXLAN for all protocols. Protocol link:
https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-05.txt
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++
lib/librte_ether/rte_eth_ctrl.h | 3 ++-
lib/librte_ether/rte_flow.c | 1 +
lib/librte_ether/rte_flow.h | 27 +++++++++++++++++++++++++++
lib/librte_mbuf/rte_mbuf.c | 3 +++
lib/librte_mbuf/rte_mbuf.h | 1 +
lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
lib/librte_mbuf/rte_mbuf_ptype.h | 13 +++++++++++++
lib/librte_net/rte_ether.h | 25 +++++++++++++++++++++++++
9 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 2fb8e9c3f..ea36f307b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1054,6 +1054,18 @@ Matches a GENEVE header.
- ``rsvd1``: reserved, normally 0x00.
- Default ``mask`` matches VNI only.
+Item: ``VXLAN-GPE``
+^^^^^^^^^^^^^^^^^^^
+
+Matches a VXLAN-GPE header (draft-ietf-nvo3-vxlan-gpe-05).
+
+- ``flags``: normally 0x0C (I and P flags).
+- ``rsvd0``: reserved, normally 0x0000.
+- ``protocol``: protocol type.
+- ``vni``: VXLAN network identifier.
+- ``rsvd1``: reserved, normally 0x00.
+- Default ``mask`` matches VNI only.
+
Actions
~~~~~~~
diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 668f59acb..5ea8ae24c 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -54,7 +54,8 @@ extern "C" {
#define RTE_ETH_FLOW_VXLAN 19 /**< VXLAN protocol based flow */
#define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */
#define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX 22
+#define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */
+#define RTE_ETH_FLOW_MAX 23
/**
* Feature filter types
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index cecab59f6..d4d07f7db 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -55,6 +55,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = {
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(GENEVE, sizeof(struct rte_flow_item_geneve)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index 09a21e531..eecd1f5a3 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -339,6 +339,13 @@ enum rte_flow_item_type {
* See struct rte_flow_item_geneve.
*/
RTE_FLOW_ITEM_TYPE_GENEVE,
+
+ /**
+ * Matches a VXLAN-GPE header.
+ *
+ * See struct rte_flow_item_vxlan_gpe.
+ */
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
};
/**
@@ -868,6 +875,26 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
#endif
/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+ uint8_t flags; /**< Normally 0x0c (I and P flags). */
+ uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+ uint8_t protocol; /**< Protocol type. */
+ uint8_t vni[3]; /**< VXLAN identifier. */
+ uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+ .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
* Matching pattern item definition.
*
* A pattern is formed by stacking items starting from the lowest protocol
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 3f4c83305..615dc1f98 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -390,6 +390,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+ case PKT_TX_TUNNEL_VXLAN_GPE: return "PKT_TX_TUNNEL_VXLAN_GPE";
case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
default: return NULL;
@@ -424,6 +425,8 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
"PKT_TX_TUNNEL_NONE" },
+ { PKT_TX_TUNNEL_VXLAN_GPE, PKT_TX_TUNNEL_MASK,
+ "PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 06eceba37..242f58f49 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,7 @@ extern "C" {
#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
/**< TX packet with MPLS-in-UDP RFC 7510 header. */
#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+#define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
/* add new TX TUNNEL type here */
#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 1feefacc6..49106c7df 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -65,6 +65,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_GTPU: return "TUNNEL_GTPU";
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
+ case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index b9a338110..7caf83312 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -423,6 +423,19 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000
/**
+ * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=4790>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=4790>
+ */
+#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h
index a271d1c86..95d0a533f 100644
--- a/lib/librte_net/rte_ether.h
+++ b/lib/librte_net/rte_ether.h
@@ -311,6 +311,31 @@ struct vxlan_hdr {
/**< VXLAN tunnel header length. */
/**
+ * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
+ * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
+ * Identifier and Reserved fields (16 bits and 8 bits).
+ */
+struct vxlan_gpe_hdr {
+ uint8_t vx_flags; /**< flag (8). */
+ uint8_t reserved[2]; /**< Reserved (16). */
+ uint8_t proto; /**< next-protocol (8). */
+ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */
+} __attribute__((__packed__));
+
+/* VXLAN-GPE next protocol types */
+#define VXLAN_GPE_TYPE_IPV4 1 /**< IPv4 Protocol. */
+#define VXLAN_GPE_TYPE_IPV6 2 /**< IPv6 Protocol. */
+#define VXLAN_GPE_TYPE_ETH 3 /**< Ethernet Protocol. */
+#define VXLAN_GPE_TYPE_NSH 4 /**< NSH Protocol. */
+#define VXLAN_GPE_TYPE_MPLS 5 /**< MPLS Protocol. */
+#define VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
+#define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
+
+#define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+ sizeof(struct vxlan_gpe_hdr))
+/**< VXLAN-GPE tunnel header length. */
+
+/**
* Extract VLAN tag information into mbuf
*
* Software version of VLAN stripping
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
` (2 preceding siblings ...)
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
2018-04-23 15:15 ` Thomas Monjalon
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
5 siblings, 1 reply; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
MPLS-in-GRE protocol link:
https://tools.ietf.org/html/rfc4023
MPLS-in-UDP protocol link:
https://tools.ietf.org/html/rfc7510
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_mbuf/rte_mbuf_ptype.c | 2 ++
lib/librte_mbuf/rte_mbuf_ptype.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 49106c7df..d7835e283 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -66,6 +66,8 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype)
case RTE_PTYPE_TUNNEL_ESP: return "TUNNEL_ESP";
case RTE_PTYPE_TUNNEL_L2TP: return "TUNNEL_L2TP";
case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS_IN_UDP";
+ case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS_IN_GRE";
default: return "TUNNEL_UNKNOWN";
}
}
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 7caf83312..79ea31425 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -436,6 +436,40 @@ extern "C" {
*/
#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000
/**
+ * MPLS-in-GRE tunneling packet type (RFC 4023).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=47
+ * | 'protocol'=0x8848>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'protocol'=47
+ * | 'protocol'=0x8847>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=47
+ * | 'protocol'=0x8848>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000
+/**
+ * MPLS-in-UDP tunneling packet type (RFC 7510).
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=17
+ * | 'destination port'=6635>
+ * or,
+ * <'ether type'=0x86DD
+ * | 'version'=6, 'next header'=17
+ * | 'destination port'=6635>
+ */
+#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000
+/**
* Mask of tunneling packet types.
*/
#define RTE_PTYPE_TUNNEL_MASK 0x0000f000
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 4/5] app/testpmd: introduce new tunnel VXLAN-GPE
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
` (3 preceding siblings ...)
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
5 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Add VXLAN-GPE support to csum forwarding engine and rte flow.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/cmdline_flow.c | 24 +++++++++
app/test-pmd/config.c | 2 +
app/test-pmd/csumonly.c | 83 +++++++++++++++++++++++++++--
app/test-pmd/parameters.c | 12 ++++-
app/test-pmd/testpmd.h | 2 +
doc/guides/testpmd_app_ug/run_app.rst | 5 ++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++
7 files changed, 128 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 32fe6645a..105f7f4c4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -154,6 +154,8 @@ enum index {
ITEM_GENEVE,
ITEM_GENEVE_VNI,
ITEM_GENEVE_PROTO,
+ ITEM_VXLAN_GPE,
+ ITEM_VXLAN_GPE_VNI,
/* Validate/create actions. */
ACTIONS,
@@ -470,6 +472,7 @@ static const enum index next_item[] = {
ITEM_GTPC,
ITEM_GTPU,
ITEM_GENEVE,
+ ITEM_VXLAN_GPE,
ZERO,
};
@@ -626,6 +629,12 @@ static const enum index item_geneve[] = {
ZERO,
};
+static const enum index item_vxlan_gpe[] = {
+ ITEM_VXLAN_GPE_VNI,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
@@ -1560,6 +1569,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
protocol)),
},
+ [ITEM_VXLAN_GPE] = {
+ .name = "vxlan-gpe",
+ .help = "match VXLAN-GPE header",
+ .priv = PRIV_ITEM(VXLAN_GPE,
+ sizeof(struct rte_flow_item_vxlan_gpe)),
+ .next = NEXT(item_vxlan_gpe),
+ .call = parse_vc,
+ },
+ [ITEM_VXLAN_GPE_VNI] = {
+ .name = "vni",
+ .help = "VXLAN-GPE identifier",
+ .next = NEXT(item_vxlan_gpe, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
+ vni)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index e7026011b..dd491c3ea 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -997,6 +997,7 @@ static const struct {
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)),
+ MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)),
};
/** Pattern item specification types. */
@@ -3098,6 +3099,7 @@ flowtype_to_str(uint16_t flow_type)
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
+ {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5f5ab64aa..285709872 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -60,6 +60,8 @@
#define _htons(x) (x)
#endif
+uint16_t vxlan_gpe_udp_port = 4790;
+
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
@@ -194,6 +196,70 @@ parse_vxlan(struct udp_hdr *udp_hdr,
info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
+/* Parse a vxlan-gpe header */
+static void
+parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+ struct testpmd_offload_info *info)
+{
+ struct ether_hdr *eth_hdr;
+ struct ipv4_hdr *ipv4_hdr;
+ struct ipv6_hdr *ipv6_hdr;
+ struct vxlan_gpe_hdr *vxlan_gpe_hdr;
+ uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
+
+ /* Check udp destination port. */
+ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port))
+ return;
+
+ vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr +
+ sizeof(struct udp_hdr));
+
+ if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
+ VXLAN_GPE_TYPE_IPV4) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ipv4(ipv4_hdr, info);
+ info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPV6) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ info->ethertype = _htons(ETHER_TYPE_IPv6);
+ parse_ipv6(ipv6_hdr, info);
+ info->l2_len = 0;
+
+ } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ info->is_tunnel = 1;
+ info->outer_ethertype = info->ethertype;
+ info->outer_l2_len = info->l2_len;
+ info->outer_l3_len = info->l3_len;
+ info->outer_l4_proto = info->l4_proto;
+
+ eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr +
+ vxlan_gpe_len);
+
+ parse_ethernet(eth_hdr, info);
+ } else
+ return;
+
+ info->l2_len += ETHER_VXLAN_GPE_HLEN;
+}
+
/* Parse a gre header */
static void
parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
@@ -588,6 +654,10 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
* Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
* UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ * UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ * UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
* Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
@@ -691,9 +761,16 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
- parse_vxlan(udp_hdr, &info, m->packet_type);
- if (info.is_tunnel)
- tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
+ parse_vxlan_gpe(udp_hdr, &info);
+ if (info.is_tunnel) {
+ tx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;
+ } else {
+ parse_vxlan(udp_hdr, &info,
+ m->packet_type);
+ if (info.is_tunnel)
+ tx_ol_flags |=
+ PKT_TX_TUNNEL_VXLAN;
+ }
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 394fa6d92..43af06589 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -70,7 +70,7 @@ usage(char* progname)
"--rss-ip | --rss-udp | "
"--rxpt= | --rxht= | --rxwt= | --rxfreet= | "
"--txpt= | --txht= | --txwt= | --txfreet= | "
- "--txrst= | --tx-offloads ]\n",
+ "--txrst= | --tx-offloads= | --vxlan-gpe-port= ]\n",
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
@@ -187,6 +187,7 @@ usage(char* progname)
"requests flow API isolated mode on all ports at initialization time.\n");
printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n");
printf(" --hot-plug: enable hot plug for device.\n");
+ printf(" --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@@ -625,6 +626,7 @@ launch_args_parse(int argc, char** argv)
{ "mask-event", 1, 0, 0 },
{ "tx-offloads", 1, 0, 0 },
{ "hot-plug", 0, 0, 0 },
+ { "vxlan-gpe-port", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@@ -1121,6 +1123,14 @@ launch_args_parse(int argc, char** argv)
rte_exit(EXIT_FAILURE,
"tx-offloads must be >= 0\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "vxlan-gpe-port")) {
+ n = atoi(optarg);
+ if (n >= 0)
+ vxlan_gpe_udp_port = (uint16_t)n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "vxlan-gpe-port must be >= 0\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 070919822..60dfa09bd 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -448,6 +448,8 @@ extern uint32_t retry_enabled;
extern struct fwd_lcore **fwd_lcores;
extern struct fwd_stream **fwd_streams;
+extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */
+
extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */
extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index b3d98de46..351d826fa 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -485,3 +485,8 @@ The commandline options are:
* ``--hot-plug``
Enable device event monitor machenism for hotplug.
+
+* ``--vxlan-gpe-port=N``
+
+ Set the UDP port number of tunnel VXLAN-GPE to N.
+ The default value is 4790.
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index bfb5ad027..e30adf526 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3310,6 +3310,10 @@ This section lists supported pattern items and their attributes, if any.
- ``vni {unsigned}``: virtual network identifier.
- ``protocol {unsigned}``: protocol type.
+- ``vxlan-gpe``: match VXLAN-GPE header.
+
+ - ``vni {unsigned}``: VXLAN-GPE identifier.
+
Actions list
^^^^^^^^^^^^
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* [dpdk-dev] [PATCH v7 5/5] app/testpmd: add more GRE extension support to csum engine
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
` (4 preceding siblings ...)
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
@ 2018-04-23 12:16 ` Xueming Li
5 siblings, 0 replies; 111+ messages in thread
From: Xueming Li @ 2018-04-23 12:16 UTC (permalink / raw)
To: Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Xueming Li, Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
This patch adds GRE checksum and sequence extension supports in addtion
to key extension to csum forwarding engine.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/csumonly.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 285709872..53b98412a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -49,9 +49,12 @@
#define IP_HDRLEN 0x05 /* default IP header length == five 32-bits words. */
#define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
-#define GRE_KEY_PRESENT 0x2000
-#define GRE_KEY_LEN 4
-#define GRE_SUPPORTED_FIELDS GRE_KEY_PRESENT
+#define GRE_CHECKSUM_PRESENT 0x8000
+#define GRE_KEY_PRESENT 0x2000
+#define GRE_SEQUENCE_PRESENT 0x1000
+#define GRE_EXT_LEN 4
+#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | GRE_KEY_PRESENT |\
+ GRE_SEQUENCE_PRESENT)
/* We cannot use rte_cpu_to_be_16() on a constant in a switch/case */
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -269,14 +272,14 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
struct ipv6_hdr *ipv6_hdr;
uint8_t gre_len = 0;
- /* check which fields are supported */
- if ((gre_hdr->flags & _htons(~GRE_SUPPORTED_FIELDS)) != 0)
- return;
-
gre_len += sizeof(struct simple_gre_hdr);
if (gre_hdr->flags & _htons(GRE_KEY_PRESENT))
- gre_len += GRE_KEY_LEN;
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_SEQUENCE_PRESENT))
+ gre_len += GRE_EXT_LEN;
+ if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
+ gre_len += GRE_EXT_LEN;
if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
@@ -815,6 +818,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* step 3: fill the mbuf meta data (flags and header lengths) */
+ m->tx_offload = 0;
if (info.is_tunnel == 1) {
if (info.tunnel_tso_segsz ||
(tx_offloads &
--
2.13.3
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
@ 2018-04-23 15:15 ` Thomas Monjalon
0 siblings, 0 replies; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-23 15:15 UTC (permalink / raw)
To: Xueming Li
Cc: dev, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil, Nelio Laranjeiro,
Shahaf Shuler, Olivier Matz
23/04/2018 14:16, Xueming Li:
> This patch adds new tunnel type for MPLS-in-GRE and MPLS-in-UDP.
>
> MPLS-in-GRE protocol link:
> https://tools.ietf.org/html/rfc4023
>
> MPLS-in-UDP protocol link:
> https://tools.ietf.org/html/rfc7510
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement Xueming Li
@ 2018-04-23 16:13 ` Ferruh Yigit
2018-04-23 16:56 ` Thomas Monjalon
2018-04-24 5:07 ` Xueming(Steven) Li
0 siblings, 2 replies; 111+ messages in thread
From: Ferruh Yigit @ 2018-04-23 16:13 UTC (permalink / raw)
To: Xueming Li, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
On 4/23/2018 1:16 PM, Xueming Li wrote:
> Remove deprecation as implementation of RSS level provided in Adrien's
> patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
Why deprecation notice removed in this set if the implementation is in other
set, or am I missing something?
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> doc/guides/rel_notes/deprecation.rst | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 93747bf24..aba50b8ec 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -86,10 +86,6 @@ Deprecation Notices
> Target release for removal of the legacy API will be defined once most
> PMDs have switched to rte_flow.
>
> -* ethdev: A new rss level field planned in 18.05.
> - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
> - of RSS hash calculation on outer or inner header of tunneled packet.
> -
> * ethdev: A work is being planned for 18.05 to expose VF port representors
> as a mean to perform control and data path operation on the different VFs.
> As VF representor is an ethdev port, new fields are needed in order to map
>
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
2018-04-23 16:13 ` Ferruh Yigit
@ 2018-04-23 16:56 ` Thomas Monjalon
2018-04-24 5:07 ` Xueming(Steven) Li
1 sibling, 0 replies; 111+ messages in thread
From: Thomas Monjalon @ 2018-04-23 16:56 UTC (permalink / raw)
To: Ferruh Yigit
Cc: Xueming Li, Wenzhuo Lu, Jingjing Wu, Adrien Mazarguil,
Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
23/04/2018 18:13, Ferruh Yigit:
> On 4/23/2018 1:16 PM, Xueming Li wrote:
> > Remove deprecation as implementation of RSS level provided in Adrien's
> > patch set: http://www.dpdk.org/dev/patchwork/patch/37399/
>
> Why deprecation notice removed in this set if the implementation is in other
> set, or am I missing something?
If I remember well, Adrien is implementing with rte_flow,
while the deprecation notice was for a different solution
(legacy ethdev config).
> > -* ethdev: A new rss level field planned in 18.05.
> > - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a choice
> > - of RSS hash calculation on outer or inner header of tunneled packet.
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
2018-04-23 16:13 ` Ferruh Yigit
2018-04-23 16:56 ` Thomas Monjalon
@ 2018-04-24 5:07 ` Xueming(Steven) Li
2018-04-25 17:38 ` Ferruh Yigit
1 sibling, 1 reply; 111+ messages in thread
From: Xueming(Steven) Li @ 2018-04-24 5:07 UTC (permalink / raw)
To: Ferruh Yigit, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
Hi Ferruh,
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Tuesday, April 24, 2018 12:13 AM
> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing Wu
> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien Mazarguil
> <adrien.mazarguil@6wind.com>
> Cc: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org;
> Olivier Matz <olivier.matz@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
>
> On 4/23/2018 1:16 PM, Xueming Li wrote:
> > Remove deprecation as implementation of RSS level provided in Adrien's
> > patch set:
> > https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> > dpdk.org%2Fdev%2Fpatchwork%2Fpatch%2F37399%2F&data=02%7C01%7Cxuemingl%
> > 40mellanox.com%7Ca192c13afbc2417d134a08d5a9351b49%7Ca652971c7d2e4d9ba6
> > a4d149256f461b%7C0%7C0%7C636600967922421810&sdata=cm0AJh7XXCnOOaFRGwhp
> > WR1D0HlHUNCyddrCXwPwFDQ%3D&reserved=0
>
> Why deprecation notice removed in this set if the implementation is in other set, or am I missing
> something?
There was a plan to support rss level in this patch set, while Adrien provided a better implementation
with his own deprecation notice. That's why I remove my deprecation here.
>
> >
> > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > Acked-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > doc/guides/rel_notes/deprecation.rst | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> > b/doc/guides/rel_notes/deprecation.rst
> > index 93747bf24..aba50b8ec 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -86,10 +86,6 @@ Deprecation Notices
> > Target release for removal of the legacy API will be defined once most
> > PMDs have switched to rte_flow.
> >
> > -* ethdev: A new rss level field planned in 18.05.
> > - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a
> > choice
> > - of RSS hash calculation on outer or inner header of tunneled packet.
> > -
> > * ethdev: A work is being planned for 18.05 to expose VF port representors
> > as a mean to perform control and data path operation on the different VFs.
> > As VF representor is an ethdev port, new fields are needed in order
> > to map
> >
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
2018-04-24 5:07 ` Xueming(Steven) Li
@ 2018-04-25 17:38 ` Ferruh Yigit
0 siblings, 0 replies; 111+ messages in thread
From: Ferruh Yigit @ 2018-04-25 17:38 UTC (permalink / raw)
To: Xueming(Steven) Li, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon,
Adrien Mazarguil
Cc: Nélio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
On 4/24/2018 6:07 AM, Xueming(Steven) Li wrote:
> Hi Ferruh,
>
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Sent: Tuesday, April 24, 2018 12:13 AM
>> To: Xueming(Steven) Li <xuemingl@mellanox.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>; Jingjing Wu
>> <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Adrien Mazarguil
>> <adrien.mazarguil@6wind.com>
>> Cc: Nélio Laranjeiro <nelio.laranjeiro@6wind.com>; Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org;
>> Olivier Matz <olivier.matz@6wind.com>
>> Subject: Re: [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement
>>
>> On 4/23/2018 1:16 PM, Xueming Li wrote:
>>> Remove deprecation as implementation of RSS level provided in Adrien's
>>> patch set:
>>> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>>> dpdk.org%2Fdev%2Fpatchwork%2Fpatch%2F37399%2F&data=02%7C01%7Cxuemingl%
>>> 40mellanox.com%7Ca192c13afbc2417d134a08d5a9351b49%7Ca652971c7d2e4d9ba6
>>> a4d149256f461b%7C0%7C0%7C636600967922421810&sdata=cm0AJh7XXCnOOaFRGwhp
>>> WR1D0HlHUNCyddrCXwPwFDQ%3D&reserved=0
>>
>> Why deprecation notice removed in this set if the implementation is in other set, or am I missing
>> something?
>
> There was a plan to support rss level in this patch set, while Adrien provided a better implementation
> with his own deprecation notice. That's why I remove my deprecation here.
Deprecation notice updated in Adrien's set [1], will drop this patch from set
while applying.
[1]
https://dpdk.org/dev/patchwork/patch/38933/
>
>>
>>>
>>> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
>>> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>>> Acked-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>> doc/guides/rel_notes/deprecation.rst | 4 ----
>>> 1 file changed, 4 deletions(-)
>>>
>>> diff --git a/doc/guides/rel_notes/deprecation.rst
>>> b/doc/guides/rel_notes/deprecation.rst
>>> index 93747bf24..aba50b8ec 100644
>>> --- a/doc/guides/rel_notes/deprecation.rst
>>> +++ b/doc/guides/rel_notes/deprecation.rst
>>> @@ -86,10 +86,6 @@ Deprecation Notices
>>> Target release for removal of the legacy API will be defined once most
>>> PMDs have switched to rte_flow.
>>>
>>> -* ethdev: A new rss level field planned in 18.05.
>>> - The new API add rss_level field to ``rte_eth_rss_conf`` to enable a
>>> choice
>>> - of RSS hash calculation on outer or inner header of tunneled packet.
>>> -
>>> * ethdev: A work is being planned for 18.05 to expose VF port representors
>>> as a mean to perform control and data path operation on the different VFs.
>>> As VF representor is an ethdev port, new fields are needed in order
>>> to map
>>>
>
^ permalink raw reply [flat|nested] 111+ messages in thread
* Re: [dpdk-dev] [PATCH v7 0/5] introduce new tunnel types
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 " Xueming Li
@ 2018-04-25 21:31 ` Ferruh Yigit
0 siblings, 0 replies; 111+ messages in thread
From: Ferruh Yigit @ 2018-04-25 21:31 UTC (permalink / raw)
To: Xueming Li, Wenzhuo Lu, Jingjing Wu, Thomas Monjalon, Adrien Mazarguil
Cc: Nelio Laranjeiro, Shahaf Shuler, dev, Olivier Matz
On 4/23/2018 1:16 PM, Xueming Li wrote:
> v7:
> - Fixed display name of MPLS-in-GRE and MPLS-in-UDP
> v6:
> - Add MPLS-in-GRE and MPLS-in-UDP back
> - UPdate comment alignment
> v5:
> - Fixed VXLAN-GPE comment alignment
> - Removed MPLS-in-GRE and MPLS-in-UDP patch
> v4:
> - Update testpmd doc for flow VXLAN-GPE paramter.
> v3:
> - Change VXLAN-GPE definition order to avoid ABI compatibility issue.
> v2:
> - Split patch set into public and mlx5 two series, this one is the first.
> v1:
> - Support new tunnel type MPLS-in-GRE and MPLS-in-UDP
> - Remove deprecation notes of rss level
>
> This patchset introduced new tunnel type and related testpmd code:
> - New tunnel type VXLAN-GPE
> https://datatracker.ietf.org/doc/draft-ietf-nvo3-vxlan-gpe/
> - New tunnel type MPLS-in-GRE
> https://tools.ietf.org/html/rfc4023
> - New tunnel type MPLS-in-UDP
> https://tools.ietf.org/html/rfc7510
> - Support GRE extension in testpmd csum forwarding engine
>
>
> Xueming Li (5):
> doc: remove RSS configuration change announcement
> ethdev: introduce new tunnel VXLAN-GPE
> ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP
> app/testpmd: introduce new tunnel VXLAN-GPE
> app/testpmd: add more GRE extension support to csum engine
Series applied to dpdk-next-net/master, thanks.
(Except 1/5)
^ permalink raw reply [flat|nested] 111+ messages in thread
end of thread, other threads:[~2018-04-25 21:32 UTC | newest]
Thread overview: 111+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26 15:09 [dpdk-dev] [PATCH 00/18] MLX5 tunnel Rx offloading Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 01/18] ethdev: support tunnel RSS level Xueming Li
2018-02-27 13:09 ` Ferruh Yigit
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 00/21] MLX5 tunnel Rx offloading Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 01/21] ethdev: support tunnel RSS level Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 02/21] app/testpmd: support flow RSS level parsing Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 03/21] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 04/21] app/testpmd: " Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 05/21] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 06/21] net/mlx5: fix tunnel offloads cap query Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 07/21] net/mlx5: support GRE tunnel flow Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 08/21] net/mlx5: support L3 vxlan Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 09/21] net/mlx5: support tunnel inner csum offloads Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 10/21] net/mlx5: support packet tunnel type Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 11/21] net/mlx5: split flow RSS handling logic Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 12/21] net/mlx5: support tunnel RSS level Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 13/21] net/mlx5: support 16 hardware priorities Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 14/21] net/mlx5: add hardware flow debug dump Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 15/21] net/mlx5: fix control flow create failure Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 16/21] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 17/21] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 18/21] doc: update mlx5 guide on tunnel offloading Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 19/21] doc: remove announce of ethdev API change for RSS configuration Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 20/21] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-03-09 11:29 ` [dpdk-dev] [PATCH v1 21/21] net/mlx5: support MPLS-in-GRE and MPLS-in-UDP flow pattern Xueming Li
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 0/5] introduce new tunnel types Xueming Li
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 1/5] doc: remove RSS configuration change announcement Xueming Li
2018-04-11 9:57 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-11 9:59 ` Adrien Mazarguil
2018-04-11 12:04 ` Xueming(Steven) Li
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-04-11 9:58 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-10 14:07 ` Nélio Laranjeiro
2018-04-11 9:59 ` Adrien Mazarguil
2018-04-10 13:00 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 0/5] introduce new tunnel types Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 1/5] doc: remove RSS configuration change announcement Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-12 12:01 ` Adrien Mazarguil
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-12 12:01 ` Adrien Mazarguil
2018-04-12 7:33 ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 0/5] introduce new tunnel types Xueming Li
2018-04-16 22:33 ` Thomas Monjalon
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 0/4] " Xueming Li
2018-04-17 16:05 ` Iremonger, Bernard
2018-04-18 11:55 ` Xueming(Steven) Li
2018-04-18 15:11 ` Iremonger, Bernard
2018-04-19 14:24 ` Xueming(Steven) Li
2018-04-19 14:57 ` Thomas Monjalon
2018-04-19 19:56 ` Ferruh Yigit
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 1/4] doc: remove RSS configuration change announcement Xueming Li
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-17 20:56 ` Thomas Monjalon
2018-04-18 8:12 ` Adrien Mazarguil
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: " Xueming Li
2018-04-17 15:04 ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-17 15:33 ` [dpdk-dev] [PATCH v5 2/4] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 0/5] introduce new tunnel types Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 " Xueming Li
2018-04-25 21:31 ` Ferruh Yigit
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 1/5] doc: remove RSS configuration change announcement Xueming Li
2018-04-23 16:13 ` Ferruh Yigit
2018-04-23 16:56 ` Thomas Monjalon
2018-04-24 5:07 ` Xueming(Steven) Li
2018-04-25 17:38 ` Ferruh Yigit
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-04-23 15:15 ` Thomas Monjalon
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-23 12:16 ` [dpdk-dev] [PATCH v7 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 1/5] doc: remove RSS configuration change announcement Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-23 9:43 ` Olivier Matz
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-04-23 9:43 ` Olivier Matz
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-20 11:56 ` [dpdk-dev] [PATCH v6 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 1/5] doc: remove RSS configuration change announcement Xueming Li
2018-04-17 15:16 ` Iremonger, Bernard
2018-04-17 15:37 ` Xueming(Steven) Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 2/5] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-16 22:23 ` Thomas Monjalon
2018-04-17 8:54 ` Mohammad Abdul Awal
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 3/5] ethdev: introduce tunnel type MPLS-in-GRE and MPLS-in-UDP Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: introduce new tunnel VXLAN-GPE Xueming Li
2018-04-13 11:02 ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-04-17 15:12 ` Iremonger, Bernard
2018-02-26 15:09 ` [dpdk-dev] [PATCH 02/18] app/testpmd: support flow RSS level parsing Xueming Li
2018-02-27 13:10 ` Ferruh Yigit
2018-03-05 10:36 ` Xueming(Steven) Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 03/18] ethdev: introduce new tunnel VXLAN-GPE Xueming Li
2018-02-27 15:25 ` Mohammad Abdul Awal
2018-02-26 15:09 ` [dpdk-dev] [PATCH 04/18] app/testpmd: " Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 05/18] app/testpmd: add more GRE extension support to csum engine Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 06/18] net/mlx5: fix tunnel offloads cap query Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 07/18] net/mlx5: support GRE tunnel flow Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 08/18] net/mlx5: support L3 vxlan Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 09/18] net/mlx5: support tunnel inner csum offloads Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 10/18] net/mlx5: support packet tunnel type Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 11/18] net/mlx5: split flow RSS handling logic Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 12/18] net/mlx5: support tunnel RSS level Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 13/18] net/mlx5: support 16 hardware priorities Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 14/18] net/mlx5: add hardware flow debug dump Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 15/18] net/mlx5: fix control flow create failure Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 16/18] net/mlx5: introduce new tunnel VXLAN-GPE Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 17/18] net/mlx5: allow flow tunnel ID 0 with outer pattern Xueming Li
2018-02-26 15:09 ` [dpdk-dev] [PATCH 18/18] doc: update mlx5 guide on tunnel offloading Xueming Li
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).