DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH 0/9] net/i40e: ESP support
@ 2019-12-10 12:57 Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
                   ` (19 more replies)
  0 siblings, 20 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director and RSS.

Bernard Iremonger (9):
  app/testpmd: parse flow command line for ESP
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: process ESP flows
  net/i40e: display Flow Director packet
  librte_ethdev: add ESP and AH flow types to RSS
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |  37 ++++++++-
 app/test-pmd/config.c                  |   2 +-
 app/test-pmd/util.c                    |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 ++
 drivers/net/i40e/i40e_ethdev.c         |  52 +++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  25 ++++++
 drivers/net/i40e/i40e_fdir.c           | 148 ++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 113 ++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 lib/librte_ethdev/rte_ethdev.h         |  29 ++++++-
 11 files changed, 400 insertions(+), 23 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 21:12   ` Ori Kam
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

add ITEM_ESP
add ITEM_ESP_SPI
add debug to cmdline_flow.c
improve debug in config.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline_flow.c | 37 ++++++++++++++++++++++++++++++++++---
 app/test-pmd/config.c       |  2 +-
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 99dade7..f1b0610 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -213,6 +213,8 @@ enum index {
 	ITEM_TAG,
 	ITEM_TAG_DATA,
 	ITEM_TAG_INDEX,
+	ITEM_ESP,
+	ITEM_ESP_SPI,
 
 	/* Validate/create actions. */
 	ACTIONS,
@@ -746,6 +748,7 @@ static const enum index next_item[] = {
 	ITEM_PPPOE_PROTO_ID,
 	ITEM_HIGIG2,
 	ITEM_TAG,
+	ITEM_ESP,
 	END_SET,
 	ZERO,
 };
@@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
 	ZERO,
 };
 
+static const enum index item_esp[] = {
+	ITEM_ESP_SPI,
+	ITEM_NEXT,
+	ZERO,
+};
+
 static const enum index next_set_raw[] = {
 	SET_RAW_INDEX,
 	ITEM_ETH,
@@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
 			     NEXT_ENTRY(ITEM_PARAM_IS)),
 		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)),
 	},
+	[ITEM_ESP] = {
+		.name = "esp",
+		.help = "match ESP header",
+		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
+		.next = NEXT(item_esp),
+		.call = parse_vc,
+	},
+	[ITEM_ESP_SPI] = {
+		.name = "spi",
+		.help = "security policy index",
+		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
+				hdr.spi)),
+	},
 	/* Validate/create actions. */
 	[ACTIONS] = {
 		.name = "actions",
@@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
 static void
 cmd_flow_parsed(const struct buffer *in)
 {
+	printf("Flow command line parsed successfully for command=%d.\n",
+			in->command);
+
 	switch (in->command) {
 	case VALIDATE:
 		port_flow_validate(in->port, &in->args.vc.attr,
@@ -6230,14 +6256,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
 	case RTE_FLOW_ITEM_TYPE_GTP:
 		mask = &rte_flow_item_gtp_mask;
 		break;
-	case RTE_FLOW_ITEM_TYPE_ESP:
-		mask = &rte_flow_item_esp_mask;
-		break;
 	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
 		mask = &rte_flow_item_gtp_psc_mask;
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		mask = &rte_flow_item_esp_mask;
+		break;
 	default:
 		break;
 	}
@@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
 		case RTE_FLOW_ITEM_TYPE_GENEVE:
 			size = sizeof(struct rte_flow_item_geneve);
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			size = sizeof(struct rte_flow_item_esp);
+			proto = 0x32;
+			break;
 		default:
 			printf("Error - Not supported item\n");
 			*total_size = 0;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH 2/9] app/testpmd: dump Rx and Tx mbuf
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 3/9] net/i40e: improve RSS debug Bernard Iremonger
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH 3/9] net/i40e: improve RSS debug
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH 4/9] net/i40e: handle ESP tunnel
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (2 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 3/9] net/i40e: improve RSS debug Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 5/9] net/i40e: process ESP flows Bernard Iremonger
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH 5/9] net/i40e: process ESP flows
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (3 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 6/9] net/i40e: display Flow Director packet Bernard Iremonger
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

Process ESP flows on Flow Director and RSS.

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add fill_ip6_head()
add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi
handle ESP and AH pctypes in ESP-AH profile
update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  44 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h |  25 +++++++
 drivers/net/i40e/i40e_fdir.c   | 144 ++++++++++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c   | 113 +++++++++++++++++++++++++++++++-
 4 files changed, 313 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..3566056 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,18 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +538,8 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +556,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +785,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +915,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1025,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..d58cee9 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -971,6 +971,39 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len)
+{
+	struct rte_ipv6_hdr *ip6;
+	uint16_t *ether_type;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+	ether_type = (uint16_t *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,87 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				/**
+				 * The source and destination fields in
+				 * the transmitted packet need to be
+				 * presented in a reversed order with
+				 * respect to the expected received
+				 *  packets.
+				 */
+				udp->src_port =
+					fdir_input->flow.udp4_flow.dst_port;
+				udp->dst_port =
+					fdir_input->flow.udp4_flow.src_port;
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				/**
+				 * The source and destination fields in
+				 * the transmitted packet need to be
+				 * presented in a reversed order with
+				 * respect to the expected received
+				 *  packets.
+				 */
+				udp->src_port =
+					fdir_input->flow.udp6_flow.dst_port;
+				udp->dst_port =
+					fdir_input->flow.udp6_flow.src_port;
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1305,7 +1431,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..f814798 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,27 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2459,6 +2513,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2709,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2779,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2796,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2899,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2934,42 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				filter->input.flow.esp_ipv4_flow.spi =
+					esp_spec->hdr.spi;
+				filter->input.flow.esp_ipv6_flow.spi =
+					esp_spec->hdr.spi;
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH 6/9] net/i40e: display Flow Director packet
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (4 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 5/9] net/i40e: process ESP flows Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index d58cee9..08cbbf6 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,7 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_hexdump.h>
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -803,6 +804,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 			    fdir_input->flow_type);
 		return -1;
 	}
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return len;
 }
 
@@ -952,7 +954,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (5 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 6/9] net/i40e: display Flow Director packet Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 18:27   ` Stephen Hemminger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 8/9] doc: release note for ESP Bernard Iremonger
                   ` (12 subsequent siblings)
  19 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

Add flow types for the following PCTYPE's in the DDP ipsec profile:
14: IPV6 ESP
15: IPV4 ESP
16: IPV6 AH
17: IPV4 AH
18: IPV6 UDP ESP
19: IPV4 UDP ESP

Add the following RSS macros for IPsec:
ETH_RSS_ESP
ETH_RSS_AH
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..39c89cb 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_IPV4_AH            24 /**< IPv4 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV4_ESP           25 /**< IPv4 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV4_UDP_ESP       26 /**< IPv4 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_IPV6_AH            27 /**< IPv6 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV6_ESP           28 /**< IPv6 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV6_UDP_ESP       29 /**< IPv6 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_MAX                30
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +517,13 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_IPV4_AH            (1ULL << 24)
+#define ETH_RSS_IPV4_ESP           (1ULL << 25)
+#define ETH_RSS_IPV4_UDP_ESP       (1ULL << 26)
+#define ETH_RSS_IPV6_AH            (1ULL << 27)
+#define ETH_RSS_IPV6_ESP           (1ULL << 28)
+#define ETH_RSS_IPV6_UDP_ESP       (1ULL << 29)
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +584,20 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_AH ( \
+	ETH_RSS_IPV4_AH | \
+	ETH_RSS_IPV6_AH)
+
+#define ETH_RSS_ESP ( \
+	ETH_RSS_IPV4_ESP | \
+	ETH_RSS_IPV6_ESP | \
+	ETH_RSS_IPV4_UDP_ESP | \
+	ETH_RSS_IPV6_UDP_ESP)
+
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \
-- 
2.7.4


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

* [dpdk-dev] [PATCH 8/9] doc: release note for ESP
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (6 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 9/9] doc: update i40e user guide Bernard Iremonger
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH 9/9] doc: update i40e user guide
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (7 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 8/9] doc: release note for ESP Bernard Iremonger
@ 2019-12-10 12:57 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-10 12:57 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev, bernard.iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2019-12-10 18:27   ` Stephen Hemminger
  0 siblings, 0 replies; 134+ messages in thread
From: Stephen Hemminger @ 2019-12-10 18:27 UTC (permalink / raw)
  To: Bernard Iremonger
  Cc: dev, beilei.xing, qi.z.zhang, declan.doherty, stephen1.byrne,
	konstantin.ananyev

On Tue, 10 Dec 2019 12:57:10 +0000
Bernard Iremonger <bernard.iremonger@intel.com> wrote:

> Add flow types for the following PCTYPE's in the DDP ipsec profile:
> 14: IPV6 ESP
> 15: IPV4 ESP
> 16: IPV6 AH
> 17: IPV4 AH
> 18: IPV6 UDP ESP
> 19: IPV4 UDP ESP
> 
> Add the following RSS macros for IPsec:
> ETH_RSS_ESP
> ETH_RSS_AH
> ETH_RSS_IPSEC
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>

The addition of additional flow matching is good but rte_flow still has problems.
1. There is little to know documentation about the semantics. What happens with the N*M combinations of
   possible flow rules, what is accepted and what does hardware do?
2. Mellanox, Intel, and Broadcom keep adding hardware match rules but there is no corresponding
   baseline in software. The SW flow classifier now is a trivial exercise that only matches tuples;
   it does not have any of the complex semantics of the rest of rte_flow.

If this were a standards body, it would be rejected.

Sorry to pick on this patch, but at some point the base infrastructure needs fixing
before allowing more dog piling on of features.

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

* Re: [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2019-12-10 21:12   ` Ori Kam
  2019-12-11  9:24     ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ori Kam @ 2019-12-10 21:12 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: stephen1.byrne, konstantin.ananyev

Hi Bernard,


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Bernard Iremonger
> Sent: Tuesday, December 10, 2019 2:57 PM
> To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> declan.doherty@intel.com
> Cc: stephen1.byrne@intel.com; konstantin.ananyev@intel.com;
> bernard.iremonger@intel.com
> Subject: [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for
> ESP
> 
> add ITEM_ESP
> add ITEM_ESP_SPI
> add debug to cmdline_flow.c
> improve debug in config.c
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 37
> ++++++++++++++++++++++++++++++++++---
>  app/test-pmd/config.c       |  2 +-
>  2 files changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 99dade7..f1b0610 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -213,6 +213,8 @@ enum index {
>  	ITEM_TAG,
>  	ITEM_TAG_DATA,
>  	ITEM_TAG_INDEX,
> +	ITEM_ESP,
> +	ITEM_ESP_SPI,
> 
>  	/* Validate/create actions. */
>  	ACTIONS,
> @@ -746,6 +748,7 @@ static const enum index next_item[] = {
>  	ITEM_PPPOE_PROTO_ID,
>  	ITEM_HIGIG2,
>  	ITEM_TAG,
> +	ITEM_ESP,
>  	END_SET,
>  	ZERO,
>  };
> @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
>  	ZERO,
>  };
> 
> +static const enum index item_esp[] = {
> +	ITEM_ESP_SPI,
> +	ITEM_NEXT,
> +	ZERO,
> +};
> +
>  static const enum index next_set_raw[] = {
>  	SET_RAW_INDEX,
>  	ITEM_ETH,
> @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
>  			     NEXT_ENTRY(ITEM_PARAM_IS)),
>  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> index)),
>  	},
> +	[ITEM_ESP] = {
> +		.name = "esp",
> +		.help = "match ESP header",
> +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> +		.next = NEXT(item_esp),
> +		.call = parse_vc,
> +	},
> +	[ITEM_ESP_SPI] = {
> +		.name = "spi",
> +		.help = "security policy index",
> +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> +				hdr.spi)),
> +	},
>  	/* Validate/create actions. */
>  	[ACTIONS] = {
>  		.name = "actions",
> @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
>  static void
>  cmd_flow_parsed(const struct buffer *in)
>  {
> +	printf("Flow command line parsed successfully for
> command=%d.\n",
> +			in->command);
> +

Why did you add the printf? Debug?

>  	switch (in->command) {
>  	case VALIDATE:
>  		port_flow_validate(in->port, &in->args.vc.attr,
> @@ -6230,14 +6256,15 @@ flow_item_default_mask(const struct
> rte_flow_item *item)
>  	case RTE_FLOW_ITEM_TYPE_GTP:
>  		mask = &rte_flow_item_gtp_mask;
>  		break;
> -	case RTE_FLOW_ITEM_TYPE_ESP:
> -		mask = &rte_flow_item_esp_mask;
> -		break;
>  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
>  		mask = &rte_flow_item_gtp_psc_mask;
>  		break;
>  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
>  		mask = &rte_flow_item_pppoe_proto_id_mask;
> +		break;
> +	case RTE_FLOW_ITEM_TYPE_ESP:
> +		mask = &rte_flow_item_esp_mask;
> +		break;
>  	default:
>  		break;
>  	}
> @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
>  		case RTE_FLOW_ITEM_TYPE_GENEVE:
>  			size = sizeof(struct rte_flow_item_geneve);
>  			break;
> +		case RTE_FLOW_ITEM_TYPE_ESP:
> +			size = sizeof(struct rte_flow_item_esp);
> +			proto = 0x32;
> +			break;
>  		default:
>  			printf("Error - Not supported item\n");
>  			*total_size = 0;
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index d599682..2753ec5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
>  		errstr = "unknown type";
>  	else
>  		errstr = errstrlist[error->type];
> -	printf("Caught error type %d (%s): %s%s: %s\n",
> +	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n",
> __func__,

I don't think this change is relevant for this commit.

>  	       error->type, errstr,
>  	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
>  					error->cause), buf) : "",
> --
> 2.7.4

Thanks,
Ori 

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

* Re: [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP
  2019-12-10 21:12   ` Ori Kam
@ 2019-12-11  9:24     ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2019-12-11  9:24 UTC (permalink / raw)
  To: Ori Kam, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Byrne, Stephen1, Ananyev, Konstantin

Hi Ori,

<snip>

> > Subject: [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line
> > for ESP
> >
> > add ITEM_ESP
> > add ITEM_ESP_SPI
> > add debug to cmdline_flow.c
> > improve debug in config.c
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  app/test-pmd/cmdline_flow.c | 37
> > ++++++++++++++++++++++++++++++++++---
> >  app/test-pmd/config.c       |  2 +-
> >  2 files changed, 35 insertions(+), 4 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 99dade7..f1b0610 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -213,6 +213,8 @@ enum index {
> >  	ITEM_TAG,
> >  	ITEM_TAG_DATA,
> >  	ITEM_TAG_INDEX,
> > +	ITEM_ESP,
> > +	ITEM_ESP_SPI,
> >
> >  	/* Validate/create actions. */
> >  	ACTIONS,
> > @@ -746,6 +748,7 @@ static const enum index next_item[] = {
> >  	ITEM_PPPOE_PROTO_ID,
> >  	ITEM_HIGIG2,
> >  	ITEM_TAG,
> > +	ITEM_ESP,
> >  	END_SET,
> >  	ZERO,
> >  };
> > @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
> >  	ZERO,
> >  };
> >
> > +static const enum index item_esp[] = {
> > +	ITEM_ESP_SPI,
> > +	ITEM_NEXT,
> > +	ZERO,
> > +};
> > +
> >  static const enum index next_set_raw[] = {
> >  	SET_RAW_INDEX,
> >  	ITEM_ETH,
> > @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
> >  			     NEXT_ENTRY(ITEM_PARAM_IS)),
> >  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> index)),
> >  	},
> > +	[ITEM_ESP] = {
> > +		.name = "esp",
> > +		.help = "match ESP header",
> > +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> > +		.next = NEXT(item_esp),
> > +		.call = parse_vc,
> > +	},
> > +	[ITEM_ESP_SPI] = {
> > +		.name = "spi",
> > +		.help = "security policy index",
> > +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> > item_param),
> > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> > +				hdr.spi)),
> > +	},
> >  	/* Validate/create actions. */
> >  	[ACTIONS] = {
> >  		.name = "actions",
> > @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t
> **hdr,
> > static void  cmd_flow_parsed(const struct buffer *in)  {
> > +	printf("Flow command line parsed successfully for
> > command=%d.\n",
> > +			in->command);
> > +
> 
> Why did you add the printf? Debug?
> 
> >  	switch (in->command) {
> >  	case VALIDATE:
> >  		port_flow_validate(in->port, &in->args.vc.attr, @@ -6230,14
> > +6256,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
> >  	case RTE_FLOW_ITEM_TYPE_GTP:
> >  		mask = &rte_flow_item_gtp_mask;
> >  		break;
> > -	case RTE_FLOW_ITEM_TYPE_ESP:
> > -		mask = &rte_flow_item_esp_mask;
> > -		break;
> >  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
> >  		mask = &rte_flow_item_gtp_psc_mask;
> >  		break;
> >  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
> >  		mask = &rte_flow_item_pppoe_proto_id_mask;
> > +		break;
> > +	case RTE_FLOW_ITEM_TYPE_ESP:
> > +		mask = &rte_flow_item_esp_mask;
> > +		break;
> >  	default:
> >  		break;
> >  	}
> > @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
> >  		case RTE_FLOW_ITEM_TYPE_GENEVE:
> >  			size = sizeof(struct rte_flow_item_geneve);
> >  			break;
> > +		case RTE_FLOW_ITEM_TYPE_ESP:
> > +			size = sizeof(struct rte_flow_item_esp);
> > +			proto = 0x32;
> > +			break;
> >  		default:
> >  			printf("Error - Not supported item\n");
> >  			*total_size = 0;
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > d599682..2753ec5 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error
> *error)
> >  		errstr = "unknown type";
> >  	else
> >  		errstr = errstrlist[error->type];
> > -	printf("Caught error type %d (%s): %s%s: %s\n",
> > +	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n",
> > __func__,
> 
> I don't think this change is relevant for this commit.

This is useful information to have when testing/debugging.
I will move it to a separate patch.

> 
> >  	       error->type, errstr,
> >  	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
> >  					error->cause), buf) : "",
> > --
> > 2.7.4
> 
> Thanks,
> Ori

Regards,

Bernard.


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

* [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (8 preceding siblings ...)
  2019-12-10 12:57 ` [dpdk-dev] [PATCH 9/9] doc: update i40e user guide Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                     ` (9 more replies)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
                   ` (9 subsequent siblings)
  19 siblings, 10 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director and RSS.

Changes in V2:
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c

Bernard Iremonger (10):
  app/testpmd: parse flow command line for ESP
  app/testpmd: improve debug code
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: process ESP flows
  net/i40e: display Flow Director packet
  librte_ethdev: add ESP and AH flow types to RSS
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |  37 ++++++++-
 app/test-pmd/config.c                  |   2 +-
 app/test-pmd/util.c                    |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 ++
 drivers/net/i40e/i40e_ethdev.c         |  52 +++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  25 ++++++
 drivers/net/i40e/i40e_fdir.c           | 146 ++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 119 ++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 lib/librte_ethdev/rte_ethdev.h         |  29 ++++++-
 11 files changed, 404 insertions(+), 23 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (9 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2020-01-08 14:43   ` Ori Kam
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 02/10] app/testpmd: improve debug code Bernard Iremonger
                   ` (8 subsequent siblings)
  19 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

add ITEM_ESP
add ITEM_ESP_SPI
add debug to cmdline_flow.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline_flow.c | 37 ++++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 99dade7..f1b0610 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -213,6 +213,8 @@ enum index {
 	ITEM_TAG,
 	ITEM_TAG_DATA,
 	ITEM_TAG_INDEX,
+	ITEM_ESP,
+	ITEM_ESP_SPI,
 
 	/* Validate/create actions. */
 	ACTIONS,
@@ -746,6 +748,7 @@ static const enum index next_item[] = {
 	ITEM_PPPOE_PROTO_ID,
 	ITEM_HIGIG2,
 	ITEM_TAG,
+	ITEM_ESP,
 	END_SET,
 	ZERO,
 };
@@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
 	ZERO,
 };
 
+static const enum index item_esp[] = {
+	ITEM_ESP_SPI,
+	ITEM_NEXT,
+	ZERO,
+};
+
 static const enum index next_set_raw[] = {
 	SET_RAW_INDEX,
 	ITEM_ETH,
@@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
 			     NEXT_ENTRY(ITEM_PARAM_IS)),
 		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)),
 	},
+	[ITEM_ESP] = {
+		.name = "esp",
+		.help = "match ESP header",
+		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
+		.next = NEXT(item_esp),
+		.call = parse_vc,
+	},
+	[ITEM_ESP_SPI] = {
+		.name = "spi",
+		.help = "security policy index",
+		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
+				hdr.spi)),
+	},
 	/* Validate/create actions. */
 	[ACTIONS] = {
 		.name = "actions",
@@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
 static void
 cmd_flow_parsed(const struct buffer *in)
 {
+	printf("Flow command line parsed successfully for command=%d.\n",
+			in->command);
+
 	switch (in->command) {
 	case VALIDATE:
 		port_flow_validate(in->port, &in->args.vc.attr,
@@ -6230,14 +6256,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
 	case RTE_FLOW_ITEM_TYPE_GTP:
 		mask = &rte_flow_item_gtp_mask;
 		break;
-	case RTE_FLOW_ITEM_TYPE_ESP:
-		mask = &rte_flow_item_esp_mask;
-		break;
 	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
 		mask = &rte_flow_item_gtp_psc_mask;
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		mask = &rte_flow_item_esp_mask;
+		break;
 	default:
 		break;
 	}
@@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
 		case RTE_FLOW_ITEM_TYPE_GENEVE:
 			size = sizeof(struct rte_flow_item_geneve);
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			size = sizeof(struct rte_flow_item_esp);
+			proto = 0x32;
+			break;
 		default:
 			printf("Error - Not supported item\n");
 			*total_size = 0;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 02/10] app/testpmd: improve debug code
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (10 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 03/10] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

improve debug code in config.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 03/10] app/testpmd: dump Rx and Tx mbuf
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (11 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 02/10] app/testpmd: improve debug code Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 04/10] net/i40e: improve RSS debug Bernard Iremonger
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 04/10] net/i40e: improve RSS debug
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (12 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 03/10] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 05/10] net/i40e: handle ESP tunnel Bernard Iremonger
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 05/10] net/i40e: handle ESP tunnel
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (13 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 04/10] net/i40e: improve RSS debug Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 06/10] net/i40e: process ESP flows Bernard Iremonger
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 06/10] net/i40e: process ESP flows
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (14 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 05/10] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 07/10] net/i40e: display Flow Director packet Bernard Iremonger
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

Process ESP flows on Flow Director and RSS.

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add fill_ip6_head()
add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi
handle ESP and AH pctypes in ESP-AH profile
update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  44 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h |  25 ++++++++
 drivers/net/i40e/i40e_fdir.c   | 142 ++++++++++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c   | 119 +++++++++++++++++++++++++++++++++-
 4 files changed, 317 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..3566056 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,18 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +538,8 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +556,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +785,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +915,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1025,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..410e5e7 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -971,6 +971,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1076,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1132,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1158,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1332,87 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				/**
+				 * The source and destination fields in
+				 * the transmitted packet need to be
+				 * presented in a reversed order with
+				 * respect to the expected received
+				 *  packets.
+				 */
+				udp->src_port =
+					fdir_input->flow.udp4_flow.dst_port;
+				udp->dst_port =
+					fdir_input->flow.udp4_flow.src_port;
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				/**
+				 * The source and destination fields in
+				 * the transmitted packet need to be
+				 * presented in a reversed order with
+				 * respect to the expected received
+				 *  packets.
+				 */
+				udp->src_port =
+					fdir_input->flow.udp6_flow.dst_port;
+				udp->dst_port =
+					fdir_input->flow.udp6_flow.src_port;
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1305,7 +1429,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..d182080 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2459,6 +2514,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2710,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2780,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2797,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2900,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2935,47 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV4)
+					filter->input.flow.esp_ipv4_flow.spi =
+						esp_spec->hdr.spi;
+				if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+					filter->input.flow.esp_ipv6_flow.spi =
+						esp_spec->hdr.spi;
+
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 07/10] net/i40e: display Flow Director packet
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (15 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 06/10] net/i40e: process ESP flows Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 08/10] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 410e5e7..7e70cab 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,7 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_hexdump.h>
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -803,6 +804,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 			    fdir_input->flow_type);
 		return -1;
 	}
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return len;
 }
 
@@ -952,7 +954,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 08/10] librte_ethdev: add ESP and AH flow types to RSS
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (16 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 07/10] net/i40e: display Flow Director packet Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 09/10] doc: release note for ESP Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 10/10] doc: update i40e user guide Bernard Iremonger
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

Add flow types for the following PCTYPE's in the DDP ipsec profile:
14: IPV6 ESP
15: IPV4 ESP
16: IPV6 AH
17: IPV4 AH
18: IPV6 UDP ESP
19: IPV4 UDP ESP

Add the following RSS macros for IPsec:
ETH_RSS_ESP
ETH_RSS_AH
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..39c89cb 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_IPV4_AH            24 /**< IPv4 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV4_ESP           25 /**< IPv4 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV4_UDP_ESP       26 /**< IPv4 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_IPV6_AH            27 /**< IPv6 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV6_ESP           28 /**< IPv6 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV6_UDP_ESP       29 /**< IPv6 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_MAX                30
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +517,13 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_IPV4_AH            (1ULL << 24)
+#define ETH_RSS_IPV4_ESP           (1ULL << 25)
+#define ETH_RSS_IPV4_UDP_ESP       (1ULL << 26)
+#define ETH_RSS_IPV6_AH            (1ULL << 27)
+#define ETH_RSS_IPV6_ESP           (1ULL << 28)
+#define ETH_RSS_IPV6_UDP_ESP       (1ULL << 29)
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +584,20 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_AH ( \
+	ETH_RSS_IPV4_AH | \
+	ETH_RSS_IPV6_AH)
+
+#define ETH_RSS_ESP ( \
+	ETH_RSS_IPV4_ESP | \
+	ETH_RSS_IPV6_ESP | \
+	ETH_RSS_IPV4_UDP_ESP | \
+	ETH_RSS_IPV6_UDP_ESP)
+
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 09/10] doc: release note for ESP
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (17 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 08/10] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 10/10] doc: update i40e user guide Bernard Iremonger
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 10/10] doc: update i40e user guide
  2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
                   ` (18 preceding siblings ...)
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 09/10] doc: release note for ESP Bernard Iremonger
@ 2019-12-17 10:15 ` Bernard Iremonger
  19 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2019-12-17 10:15 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, bernard.iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-08 14:43   ` Ori Kam
  2020-01-08 16:16     ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ori Kam @ 2020-01-08 14:43 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev

Hi just small comment inside.
Thanks,
Ori

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Bernard Iremonger
> Sent: Tuesday, December 17, 2019 12:16 PM
> To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> declan.doherty@intel.com
> Cc: konstantin.ananyev@intel.com; bernard.iremonger@intel.com
> Subject: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command
> line for ESP
> 
> add ITEM_ESP
> add ITEM_ESP_SPI
> add debug to cmdline_flow.c
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 37
> ++++++++++++++++++++++++++++++++++---
>  1 file changed, 34 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 99dade7..f1b0610 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -213,6 +213,8 @@ enum index {
>  	ITEM_TAG,
>  	ITEM_TAG_DATA,
>  	ITEM_TAG_INDEX,
> +	ITEM_ESP,
> +	ITEM_ESP_SPI,
> 
>  	/* Validate/create actions. */
>  	ACTIONS,
> @@ -746,6 +748,7 @@ static const enum index next_item[] = {
>  	ITEM_PPPOE_PROTO_ID,
>  	ITEM_HIGIG2,
>  	ITEM_TAG,
> +	ITEM_ESP,
>  	END_SET,
>  	ZERO,
>  };
> @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
>  	ZERO,
>  };
> 
> +static const enum index item_esp[] = {
> +	ITEM_ESP_SPI,
> +	ITEM_NEXT,
> +	ZERO,
> +};
> +
>  static const enum index next_set_raw[] = {
>  	SET_RAW_INDEX,
>  	ITEM_ETH,
> @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
>  			     NEXT_ENTRY(ITEM_PARAM_IS)),
>  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> index)),
>  	},
> +	[ITEM_ESP] = {
> +		.name = "esp",
> +		.help = "match ESP header",
> +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> +		.next = NEXT(item_esp),
> +		.call = parse_vc,
> +	},
> +	[ITEM_ESP_SPI] = {
> +		.name = "spi",
> +		.help = "security policy index",
> +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> +				hdr.spi)),
> +	},
>  	/* Validate/create actions. */
>  	[ACTIONS] = {
>  		.name = "actions",
> @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
>  static void
>  cmd_flow_parsed(const struct buffer *in)
>  {
> +	printf("Flow command line parsed successfully for
> command=%d.\n",
> +			in->command);
> +

Why adding this printf?

>  	switch (in->command) {
>  	case VALIDATE:
>  		port_flow_validate(in->port, &in->args.vc.attr,
> @@ -6230,14 +6256,15 @@ flow_item_default_mask(const struct
> rte_flow_item *item)
>  	case RTE_FLOW_ITEM_TYPE_GTP:
>  		mask = &rte_flow_item_gtp_mask;
>  		break;
> -	case RTE_FLOW_ITEM_TYPE_ESP:
> -		mask = &rte_flow_item_esp_mask;
> -		break;
>  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
>  		mask = &rte_flow_item_gtp_psc_mask;
>  		break;
>  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
>  		mask = &rte_flow_item_pppoe_proto_id_mask;
> +		break;
> +	case RTE_FLOW_ITEM_TYPE_ESP:
> +		mask = &rte_flow_item_esp_mask;
> +		break;
>  	default:
>  		break;
>  	}
> @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
>  		case RTE_FLOW_ITEM_TYPE_GENEVE:
>  			size = sizeof(struct rte_flow_item_geneve);
>  			break;
> +		case RTE_FLOW_ITEM_TYPE_ESP:
> +			size = sizeof(struct rte_flow_item_esp);
> +			proto = 0x32;
> +			break;
>  		default:
>  			printf("Error - Not supported item\n");
>  			*total_size = 0;
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP
  2020-01-08 14:43   ` Ori Kam
@ 2020-01-08 16:16     ` Iremonger, Bernard
  2020-01-09  6:29       ` Ori Kam
  0 siblings, 1 reply; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-08 16:16 UTC (permalink / raw)
  To: Ori Kam, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin

Hi Ori,

Thanks for the review.

<snip>

> Subject: RE: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> command line for ESP
> 
> Hi just small comment inside.
> Thanks,
> Ori
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Bernard Iremonger
> > Sent: Tuesday, December 17, 2019 12:16 PM
> > To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> > declan.doherty@intel.com
> > Cc: konstantin.ananyev@intel.com; bernard.iremonger@intel.com
> > Subject: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command
> > line for ESP
> >
> > add ITEM_ESP
> > add ITEM_ESP_SPI
> > add debug to cmdline_flow.c
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  app/test-pmd/cmdline_flow.c | 37
> > ++++++++++++++++++++++++++++++++++---
> >  1 file changed, 34 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 99dade7..f1b0610 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -213,6 +213,8 @@ enum index {
> >  	ITEM_TAG,
> >  	ITEM_TAG_DATA,
> >  	ITEM_TAG_INDEX,
> > +	ITEM_ESP,
> > +	ITEM_ESP_SPI,
> >
> >  	/* Validate/create actions. */
> >  	ACTIONS,
> > @@ -746,6 +748,7 @@ static const enum index next_item[] = {
> >  	ITEM_PPPOE_PROTO_ID,
> >  	ITEM_HIGIG2,
> >  	ITEM_TAG,
> > +	ITEM_ESP,
> >  	END_SET,
> >  	ZERO,
> >  };
> > @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
> >  	ZERO,
> >  };
> >
> > +static const enum index item_esp[] = {
> > +	ITEM_ESP_SPI,
> > +	ITEM_NEXT,
> > +	ZERO,
> > +};
> > +
> >  static const enum index next_set_raw[] = {
> >  	SET_RAW_INDEX,
> >  	ITEM_ETH,
> > @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
> >  			     NEXT_ENTRY(ITEM_PARAM_IS)),
> >  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> index)),
> >  	},
> > +	[ITEM_ESP] = {
> > +		.name = "esp",
> > +		.help = "match ESP header",
> > +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> > +		.next = NEXT(item_esp),
> > +		.call = parse_vc,
> > +	},
> > +	[ITEM_ESP_SPI] = {
> > +		.name = "spi",
> > +		.help = "security policy index",
> > +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> > item_param),
> > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> > +				hdr.spi)),
> > +	},
> >  	/* Validate/create actions. */
> >  	[ACTIONS] = {
> >  		.name = "actions",
> > @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t
> **hdr,
> > static void  cmd_flow_parsed(const struct buffer *in)  {
> > +	printf("Flow command line parsed successfully for
> > command=%d.\n",
> > +			in->command);
> > +
> 
> Why adding this printf?

It is useful to know that the parsing of the flow command line is successful before going into the PMD code.
I will remove in the v3 if you think it is too verbose.

> 
> >  	switch (in->command) {
> >  	case VALIDATE:
> >  		port_flow_validate(in->port, &in->args.vc.attr, @@ -6230,14
> > +6256,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
> >  	case RTE_FLOW_ITEM_TYPE_GTP:
> >  		mask = &rte_flow_item_gtp_mask;
> >  		break;
> > -	case RTE_FLOW_ITEM_TYPE_ESP:
> > -		mask = &rte_flow_item_esp_mask;
> > -		break;
> >  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
> >  		mask = &rte_flow_item_gtp_psc_mask;
> >  		break;
> >  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
> >  		mask = &rte_flow_item_pppoe_proto_id_mask;
> > +		break;
> > +	case RTE_FLOW_ITEM_TYPE_ESP:
> > +		mask = &rte_flow_item_esp_mask;
> > +		break;
> >  	default:
> >  		break;
> >  	}
> > @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
> >  		case RTE_FLOW_ITEM_TYPE_GENEVE:
> >  			size = sizeof(struct rte_flow_item_geneve);
> >  			break;
> > +		case RTE_FLOW_ITEM_TYPE_ESP:
> > +			size = sizeof(struct rte_flow_item_esp);
> > +			proto = 0x32;
> > +			break;
> >  		default:
> >  			printf("Error - Not supported item\n");
> >  			*total_size = 0;
> > --
> > 2.7.4

Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP
  2020-01-08 16:16     ` Iremonger, Bernard
@ 2020-01-09  6:29       ` Ori Kam
  2020-01-09  9:16         ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ori Kam @ 2020-01-09  6:29 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin

Hi,


> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, January 8, 2020 6:17 PM
> To: Ori Kam <orika@mellanox.com>; dev@dpdk.org; Xing, Beilei
> <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Doherty,
> Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> command line for ESP
> 
> Hi Ori,
> 
> Thanks for the review.
> 
> <snip>
> 
> > Subject: RE: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> > command line for ESP
> >
> > Hi just small comment inside.
> > Thanks,
> > Ori
> >
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Bernard Iremonger
> > > Sent: Tuesday, December 17, 2019 12:16 PM
> > > To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> > > declan.doherty@intel.com
> > > Cc: konstantin.ananyev@intel.com; bernard.iremonger@intel.com
> > > Subject: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> command
> > > line for ESP
> > >
> > > add ITEM_ESP
> > > add ITEM_ESP_SPI
> > > add debug to cmdline_flow.c
> > >
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > >  app/test-pmd/cmdline_flow.c | 37
> > > ++++++++++++++++++++++++++++++++++---
> > >  1 file changed, 34 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-
> pmd/cmdline_flow.c
> > > index 99dade7..f1b0610 100644
> > > --- a/app/test-pmd/cmdline_flow.c
> > > +++ b/app/test-pmd/cmdline_flow.c
> > > @@ -213,6 +213,8 @@ enum index {
> > >  	ITEM_TAG,
> > >  	ITEM_TAG_DATA,
> > >  	ITEM_TAG_INDEX,
> > > +	ITEM_ESP,
> > > +	ITEM_ESP_SPI,
> > >
> > >  	/* Validate/create actions. */
> > >  	ACTIONS,
> > > @@ -746,6 +748,7 @@ static const enum index next_item[] = {
> > >  	ITEM_PPPOE_PROTO_ID,
> > >  	ITEM_HIGIG2,
> > >  	ITEM_TAG,
> > > +	ITEM_ESP,
> > >  	END_SET,
> > >  	ZERO,
> > >  };
> > > @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
> > >  	ZERO,
> > >  };
> > >
> > > +static const enum index item_esp[] = {
> > > +	ITEM_ESP_SPI,
> > > +	ITEM_NEXT,
> > > +	ZERO,
> > > +};
> > > +
> > >  static const enum index next_set_raw[] = {
> > >  	SET_RAW_INDEX,
> > >  	ITEM_ETH,
> > > @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
> > >  			     NEXT_ENTRY(ITEM_PARAM_IS)),
> > >  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> > index)),
> > >  	},
> > > +	[ITEM_ESP] = {
> > > +		.name = "esp",
> > > +		.help = "match ESP header",
> > > +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> > > +		.next = NEXT(item_esp),
> > > +		.call = parse_vc,
> > > +	},
> > > +	[ITEM_ESP_SPI] = {
> > > +		.name = "spi",
> > > +		.help = "security policy index",
> > > +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> > > item_param),
> > > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> > > +				hdr.spi)),
> > > +	},
> > >  	/* Validate/create actions. */
> > >  	[ACTIONS] = {
> > >  		.name = "actions",
> > > @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t
> > **hdr,
> > > static void  cmd_flow_parsed(const struct buffer *in)  {
> > > +	printf("Flow command line parsed successfully for
> > > command=%d.\n",
> > > +			in->command);
> > > +
> >
> > Why adding this printf?
> 
> It is useful to know that the parsing of the flow command line is successful
> before going into the PMD code.
> I will remove in the v3 if you think it is too verbose.
> 

I think it is to verbose, due to the fact that in normal case the parsing will succeed,
Which means there will be a lot of print (In our testing we can have more then 200K commands). 
So I prefer to remove it, but if you think it is critical you can use the verbose_level with high value.
If you remove it feel free to add my ack on v3.

> >
> > >  	switch (in->command) {
> > >  	case VALIDATE:
> > >  		port_flow_validate(in->port, &in->args.vc.attr, @@ -6230,14
> > > +6256,15 @@ flow_item_default_mask(const struct rte_flow_item
> *item)
> > >  	case RTE_FLOW_ITEM_TYPE_GTP:
> > >  		mask = &rte_flow_item_gtp_mask;
> > >  		break;
> > > -	case RTE_FLOW_ITEM_TYPE_ESP:
> > > -		mask = &rte_flow_item_esp_mask;
> > > -		break;
> > >  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
> > >  		mask = &rte_flow_item_gtp_psc_mask;
> > >  		break;
> > >  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
> > >  		mask = &rte_flow_item_pppoe_proto_id_mask;
> > > +		break;
> > > +	case RTE_FLOW_ITEM_TYPE_ESP:
> > > +		mask = &rte_flow_item_esp_mask;
> > > +		break;
> > >  	default:
> > >  		break;
> > >  	}
> > > @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer *in)
> > >  		case RTE_FLOW_ITEM_TYPE_GENEVE:
> > >  			size = sizeof(struct rte_flow_item_geneve);
> > >  			break;
> > > +		case RTE_FLOW_ITEM_TYPE_ESP:
> > > +			size = sizeof(struct rte_flow_item_esp);
> > > +			proto = 0x32;
> > > +			break;
> > >  		default:
> > >  			printf("Error - Not supported item\n");
> > >  			*total_size = 0;
> > > --
> > > 2.7.4
> 
> Regards,
> 
> Bernard.


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

* Re: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP
  2020-01-09  6:29       ` Ori Kam
@ 2020-01-09  9:16         ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-09  9:16 UTC (permalink / raw)
  To: Ori Kam, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin

Hi Ori,

<snip>

> > Subject: RE: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> > command line for ESP
> >
> > Hi Ori,
> >
> > Thanks for the review.
> >
> > <snip>
> >
> > > Subject: RE: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> > > command line for ESP
> > >
> > > Hi just small comment inside.
> > > Thanks,
> > > Ori
> > >
> > > > -----Original Message-----
> > > > From: dev <dev-bounces@dpdk.org> On Behalf Of Bernard Iremonger
> > > > Sent: Tuesday, December 17, 2019 12:16 PM
> > > > To: dev@dpdk.org; beilei.xing@intel.com; qi.z.zhang@intel.com;
> > > > declan.doherty@intel.com
> > > > Cc: konstantin.ananyev@intel.com; bernard.iremonger@intel.com
> > > > Subject: [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow
> > command
> > > > line for ESP
> > > >
> > > > add ITEM_ESP
> > > > add ITEM_ESP_SPI
> > > > add debug to cmdline_flow.c
> > > >
> > > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > > ---
> > > >  app/test-pmd/cmdline_flow.c | 37
> > > > ++++++++++++++++++++++++++++++++++---
> > > >  1 file changed, 34 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-
> > pmd/cmdline_flow.c
> > > > index 99dade7..f1b0610 100644
> > > > --- a/app/test-pmd/cmdline_flow.c
> > > > +++ b/app/test-pmd/cmdline_flow.c
> > > > @@ -213,6 +213,8 @@ enum index {
> > > >  	ITEM_TAG,
> > > >  	ITEM_TAG_DATA,
> > > >  	ITEM_TAG_INDEX,
> > > > +	ITEM_ESP,
> > > > +	ITEM_ESP_SPI,
> > > >
> > > >  	/* Validate/create actions. */
> > > >  	ACTIONS,
> > > > @@ -746,6 +748,7 @@ static const enum index next_item[] = {
> > > >  	ITEM_PPPOE_PROTO_ID,
> > > >  	ITEM_HIGIG2,
> > > >  	ITEM_TAG,
> > > > +	ITEM_ESP,
> > > >  	END_SET,
> > > >  	ZERO,
> > > >  };
> > > > @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
> > > >  	ZERO,
> > > >  };
> > > >
> > > > +static const enum index item_esp[] = {
> > > > +	ITEM_ESP_SPI,
> > > > +	ITEM_NEXT,
> > > > +	ZERO,
> > > > +};
> > > > +
> > > >  static const enum index next_set_raw[] = {
> > > >  	SET_RAW_INDEX,
> > > >  	ITEM_ETH,
> > > > @@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
> > > >  			     NEXT_ENTRY(ITEM_PARAM_IS)),
> > > >  		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag,
> > > index)),
> > > >  	},
> > > > +	[ITEM_ESP] = {
> > > > +		.name = "esp",
> > > > +		.help = "match ESP header",
> > > > +		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
> > > > +		.next = NEXT(item_esp),
> > > > +		.call = parse_vc,
> > > > +	},
> > > > +	[ITEM_ESP_SPI] = {
> > > > +		.name = "spi",
> > > > +		.help = "security policy index",
> > > > +		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED),
> > > > item_param),
> > > > +		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
> > > > +				hdr.spi)),
> > > > +	},
> > > >  	/* Validate/create actions. */
> > > >  	[ACTIONS] = {
> > > >  		.name = "actions",
> > > > @@ -6052,6 +6075,9 @@ cmd_flow_tok(cmdline_parse_token_hdr_t
> > > **hdr,
> > > > static void  cmd_flow_parsed(const struct buffer *in)  {
> > > > +	printf("Flow command line parsed successfully for
> > > > command=%d.\n",
> > > > +			in->command);
> > > > +
> > >
> > > Why adding this printf?
> >
> > It is useful to know that the parsing of the flow command line is
> > successful before going into the PMD code.
> > I will remove in the v3 if you think it is too verbose.
> >
> 
> I think it is to verbose, due to the fact that in normal case the parsing will
> succeed, Which means there will be a lot of print (In our testing we can have
> more then 200K commands).
> So I prefer to remove it, but if you think it is critical you can use the
> verbose_level with high value.
> If you remove it feel free to add my ack on v3.

I will remove it and add your ack in v3.


> > >
> > > >  	switch (in->command) {
> > > >  	case VALIDATE:
> > > >  		port_flow_validate(in->port, &in->args.vc.attr, @@ -6230,14
> > > > +6256,15 @@ flow_item_default_mask(const struct rte_flow_item
> > *item)
> > > >  	case RTE_FLOW_ITEM_TYPE_GTP:
> > > >  		mask = &rte_flow_item_gtp_mask;
> > > >  		break;
> > > > -	case RTE_FLOW_ITEM_TYPE_ESP:
> > > > -		mask = &rte_flow_item_esp_mask;
> > > > -		break;
> > > >  	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
> > > >  		mask = &rte_flow_item_gtp_psc_mask;
> > > >  		break;
> > > >  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
> > > >  		mask = &rte_flow_item_pppoe_proto_id_mask;
> > > > +		break;
> > > > +	case RTE_FLOW_ITEM_TYPE_ESP:
> > > > +		mask = &rte_flow_item_esp_mask;
> > > > +		break;
> > > >  	default:
> > > >  		break;
> > > >  	}
> > > > @@ -6327,6 +6354,10 @@ cmd_set_raw_parsed(const struct buffer
> *in)
> > > >  		case RTE_FLOW_ITEM_TYPE_GENEVE:
> > > >  			size = sizeof(struct rte_flow_item_geneve);
> > > >  			break;
> > > > +		case RTE_FLOW_ITEM_TYPE_ESP:
> > > > +			size = sizeof(struct rte_flow_item_esp);
> > > > +			proto = 0x32;
> > > > +			break;
> > > >  		default:
> > > >  			printf("Error - Not supported item\n");
> > > >  			*total_size = 0;
> > > > --
> > > > 2.7.4


Regards,

Bernard.


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

* [dpdk-dev] [PATCH v3 0/9] net/i40e: ESP support
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
@ 2020-01-09 12:16   ` " Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                       ` (14 more replies)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
                     ` (8 subsequent siblings)
  9 siblings, 15 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director and RSS.

Changes in V3:
-------------
Added i40e_flow_set_filter_spi() function in i40e_flow.c
Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
Split flow structures into 4 instead of 2 in i40e_ethdev.h 
Dropped extra printf from commandline_flow.c

Changes in V2: 
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c

Bernard Iremonger (9):
  app/testpmd: parse flow command line for ESP
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: process ESP flows
  net/i40e: display Flow Director packet
  librte_ethdev: add ESP and AH flow types to RSS
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |   4 +-
 app/test-pmd/util.c                    |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 +++
 drivers/net/i40e/i40e_ethdev.c         |  52 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  38 ++++++++++
 drivers/net/i40e/i40e_fdir.c           | 132 +++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 135 ++++++++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 lib/librte_ethdev/rte_ethdev.h         |  29 ++++++-
 10 files changed, 385 insertions(+), 22 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 1/9] app/testpmd: parse flow command line for ESP
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add ITEM_ESP
add ITEM_ESP_SPI
add debug to cmdline_flow.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 9643148..9c6edb8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -6075,9 +6075,6 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
 static void
 cmd_flow_parsed(const struct buffer *in)
 {
-	printf("Flow command line parsed successfully for command=%d.\n",
-			in->command);
-
 	switch (in->command) {
 	case VALIDATE:
 		port_flow_validate(in->port, &in->args.vc.attr,
@@ -6261,6 +6258,7 @@ flow_item_default_mask(const struct rte_flow_item *item)
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
 	case RTE_FLOW_ITEM_TYPE_ESP:
 		mask = &rte_flow_item_esp_mask;
 		break;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 2/9] app/testpmd: dump Rx and Tx mbuf
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug Bernard Iremonger
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (2 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 13:44     ` Zhang, Qi Z
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
                     ` (5 subsequent siblings)
  9 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (3 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 14:08     ` Zhang, Qi Z
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows Bernard Iremonger
                     ` (4 subsequent siblings)
  9 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (4 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 14:00     ` Zhang, Qi Z
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet Bernard Iremonger
                     ` (3 subsequent siblings)
  9 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Process ESP flows on Flow Director and RSS.

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
add flow structures for above patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()
add fill_ip6_head()
add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi
handle ESP and AH pctypes in ESP-AH profile
update customized code for ESP
hardcode udp destination port to 4500

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  44 +++++++++++++-
 drivers/net/i40e/i40e_ethdev.h |  38 ++++++++++++
 drivers/net/i40e/i40e_fdir.c   | 128 +++++++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c   | 135 ++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 332 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..792a047 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_ipv4_flow ipv4;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_ipv6_flow ipv6;
+	uint32_t spi;	/* SPI in big endian. */
+};
+/* A structure used to define the input for ESP IPV4 UDP flow */
+struct i40e_esp_ipv4_udp_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 UDP flow */
+struct i40e_esp_ipv6_udp_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +549,10 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
+	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
+	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +798,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +928,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1038,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..3fa6297 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -54,6 +54,8 @@
 #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
 #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
 
+#define I40E_FDIR_ESP_DST_PORT              4500
+
 /* Wait time for fdir filter programming */
 #define I40E_FDIR_MAX_WAIT_US 10000
 
@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				udp->dst_port = rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				udp->dst_port =	rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1305,7 +1415,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..c585d8b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 	return I40E_FILTER_PCTYPE_INVALID;
 }
 
+static void
+i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
+	const struct rte_flow_item_esp *esp_spec)
+{
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV4) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv4_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv4_flow.spi =
+				esp_spec->hdr.spi;
+	}
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV6) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv6_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv6_flow.spi =
+				esp_spec->hdr.spi;
+	}
+}
+
 /* 1. Last in item should be NULL as range is not supported.
  * 2. Supported patterns: refer to array i40e_supported_patterns.
  * 3. Default supported flow type and input set: refer to array
@@ -2459,6 +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				i40e_flow_set_filter_spi(filter, esp_spec);
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (5 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 12:44     ` Zhang, Qi Z
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
                     ` (2 subsequent siblings)
  9 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 3fa6297..78329d2 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,7 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_hexdump.h>
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 			    fdir_input->flow_type);
 		return -1;
 	}
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return len;
 }
 
@@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+	rte_hexdump(stdout, NULL, raw_pkt, len);
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 7/9] librte_ethdev: add ESP and AH flow types to RSS
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (6 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 8/9] doc: release note for ESP Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 9/9] doc: update i40e user guide Bernard Iremonger
  9 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow types for the following PCTYPE's in the DDP ipsec profile:
14: IPV6 ESP
15: IPV4 ESP
16: IPV6 AH
17: IPV4 AH
18: IPV6 UDP ESP
19: IPV4 UDP ESP

Add the following RSS macros for IPsec:
ETH_RSS_ESP
ETH_RSS_AH
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..39c89cb 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_IPV4_AH            24 /**< IPv4 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV4_ESP           25 /**< IPv4 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV4_UDP_ESP       26 /**< IPv4 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_IPV6_AH            27 /**< IPv6 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV6_ESP           28 /**< IPv6 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV6_UDP_ESP       29 /**< IPv6 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_MAX                30
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +517,13 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_IPV4_AH            (1ULL << 24)
+#define ETH_RSS_IPV4_ESP           (1ULL << 25)
+#define ETH_RSS_IPV4_UDP_ESP       (1ULL << 26)
+#define ETH_RSS_IPV6_AH            (1ULL << 27)
+#define ETH_RSS_IPV6_ESP           (1ULL << 28)
+#define ETH_RSS_IPV6_UDP_ESP       (1ULL << 29)
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +584,20 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_AH ( \
+	ETH_RSS_IPV4_AH | \
+	ETH_RSS_IPV6_AH)
+
+#define ETH_RSS_ESP ( \
+	ETH_RSS_IPV4_ESP | \
+	ETH_RSS_IPV6_ESP | \
+	ETH_RSS_IPV4_UDP_ESP | \
+	ETH_RSS_IPV6_UDP_ESP)
+
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 8/9] doc: release note for ESP
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (7 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 9/9] doc: update i40e user guide Bernard Iremonger
  9 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 9/9] doc: update i40e user guide
  2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
                     ` (8 preceding siblings ...)
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 8/9] doc: release note for ESP Bernard Iremonger
@ 2020-01-09 12:16   ` Bernard Iremonger
  9 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-09 12:16 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-09 12:44     ` Zhang, Qi Z
  2020-01-09 14:02       ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-09 12:44 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Bernard:

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, January 9, 2020 8:17 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v3 6/9] net/i40e: display Flow Director packet
> 
> call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/i40e_fdir.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index
> 3fa6297..78329d2 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -21,6 +21,7 @@
>  #include <rte_tcp.h>
>  #include <rte_sctp.h>
>  #include <rte_hash_crc.h>
> +#include <rte_hexdump.h>
> 
>  #include "i40e_logs.h"
>  #include "base/i40e_type.h"
> @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> rte_eth_fdir_input *fdir_input,
>  			    fdir_input->flow_type);
>  		return -1;
>  	}
> +	rte_hexdump(stdout, NULL, raw_pkt, len);

Why we need this? Does this just for debug?

Regards
Qi

>  	return len;
>  }
> 
> @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +	rte_hexdump(stdout, NULL, raw_pkt, len);
>  	return 0;
>  }
> 
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-09 13:44     ` Zhang, Qi Z
  0 siblings, 0 replies; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-09 13:44 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, January 9, 2020 8:16 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v3 3/9] net/i40e: improve RSS debug
> 
> improve RSS debug in i40e_ethdev.c
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>


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

* Re: [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows Bernard Iremonger
@ 2020-01-09 14:00     ` Zhang, Qi Z
  2020-01-13 11:56       ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-09 14:00 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Bernard:

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, January 9, 2020 8:17 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v3 5/9] net/i40e: process ESP flows
> 
> Process ESP flows on Flow Director and RSS.
> 
> add eth/ipv4/esp and eth/ipv6/esp patterns add eth/ipv4/udp/esp and
> eth/ipv6/esp/udp patterns add flow structures for above patterns update
> i40e_flow_parse_fdir_filter() add i40e_flow_set_filter_spi() add fill_ip6_head()
> add oip_type in filter add is_udp in filter use tenant_id in filter for spi handle ESP
> and AH pctypes in ESP-AH profile update customized code for ESP hardcode udp
> destination port to 4500

Looks like the patch could be separate into 3 parts for easy review.

One is for the DDP package process,  (rte_pmd_i40e_process_ddp_package -> i40e_update_customized_info -> i40e_update_customized_pctype
One is for fdir related - training packet construction .. etc.
And one for adding all rte_flow parser

Regards
Qi

> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c |  44 +++++++++++++-
> drivers/net/i40e/i40e_ethdev.h |  38 ++++++++++++
>  drivers/net/i40e/i40e_fdir.c   | 128
> +++++++++++++++++++++++++++++++++++---
>  drivers/net/i40e/i40e_flow.c   | 135
> ++++++++++++++++++++++++++++++++++++++++-
>  4 files changed, 332 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 5f1cf8a..a462eba 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
>  	}
> 
>  	pf->gtp_support = false;
> +	pf->esp_support = false;
>  }
> 
>  void
> @@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  			}
>  		}
>  		name[strlen(name) - 1] = '\0';
> +		PMD_DRV_LOG(INFO, "name = %s\n", name);
>  		if (!strcmp(name, "GTPC"))
>  			new_pctype =
>  				i40e_find_customized_pctype(pf,
> @@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  			new_pctype =
>  				i40e_find_customized_pctype(pf,
>  						      I40E_CUSTOMIZED_GTPU);
> +		else if (!strcmp(name, "IPV4_ESP"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV4);
> +		else if (!strcmp(name, "IPV6_ESP"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV6);
> +		else if (!strcmp(name, "IPV4_UDP_ESP"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV4_UDP);
> +		else if (!strcmp(name, "IPV6_UDP_ESP"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV6_UDP);
> +		else if (!strcmp(name, "IPV4_AH"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_AH_IPV4);
> +		else if (!strcmp(name, "IPV6_AH"))
> +			new_pctype =
> +				i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_AH_IPV6);
>  		if (new_pctype) {
>  			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
>  				new_pctype->pctype = pctype_value;
> @@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  					continue;
>  				memset(name, 0, sizeof(name));
>  				strcpy(name, proto[n].name);
> +				PMD_DRV_LOG(INFO, "name = %s\n", name);
>  				if (!strncasecmp(name, "PPPOE", 5))
>  					ptype_mapping[i].sw_ptype |=
>  						RTE_PTYPE_L2_ETHER_PPPOE;
> @@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  					ptype_mapping[i].sw_ptype |=
>  						RTE_PTYPE_TUNNEL_GTPU;
>  					in_tunnel = true;
> +				} else if (!strncasecmp(name, "ESP", 3)) {
> +					ptype_mapping[i].sw_ptype |=
> +						RTE_PTYPE_TUNNEL_ESP;
> +					in_tunnel = true;
>  				} else if (!strncasecmp(name, "GRENAT", 6)) {
>  					ptype_mapping[i].sw_ptype |=
>  						RTE_PTYPE_TUNNEL_GRENAT;
> @@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
>  						ptype_num, 0);
>  	if (ret)
> -		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
> +		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
> 
>  	rte_free(ptype_mapping);
>  	rte_free(ptype);
> @@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct
> rte_eth_dev *dev, uint8_t *pkg,
>  		}
>  	}
> 
> +	/* Check if ESP is supported. */
> +	for (i = 0; i < proto_num; i++) {
> +		if (!strncmp(proto[i].name, "ESP", 3)) {
> +			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
> +				pf->esp_support = true;
> +			else
> +				pf->esp_support = false;
> +			break;
> +		}
> +	}
> +
>  	/* Update customized pctype info */
>  	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
>  					    proto_num, proto, op);
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index 295ad59..792a047 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
>  	struct rte_eth_ipv6_flow ip6;
>  };
> 
> +/* A structure used to define the input for ESP IPV4 flow */ struct
> +i40e_esp_ipv4_flow {
> +	struct rte_eth_ipv4_flow ipv4;
> +	uint32_t spi;	/* SPI in big endian. */
> +};
> +
> +/* A structure used to define the input for ESP IPV6 flow */ struct
> +i40e_esp_ipv6_flow {
> +	struct rte_eth_ipv6_flow ipv6;
> +	uint32_t spi;	/* SPI in big endian. */
> +};
> +/* A structure used to define the input for ESP IPV4 UDP flow */ struct
> +i40e_esp_ipv4_udp_flow {
> +	struct rte_eth_udpv4_flow udp;
> +	uint32_t spi;	/* SPI in big endian. */
> +};
> +
> +/* A structure used to define the input for ESP IPV6 UDP flow */ struct
> +i40e_esp_ipv6_udp_flow {
> +	struct rte_eth_udpv6_flow udp;
> +	uint32_t spi;	/* SPI in big endian. */
> +};
> +
>  /* A structure used to define the input for raw type flow */  struct
> i40e_raw_flow {
>  	uint16_t pctype;
> @@ -526,6 +549,10 @@ union i40e_fdir_flow {
>  	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
>  	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
>  	struct i40e_raw_flow       raw_flow;
> +	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
> +	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
> +	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
> +	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
>  };
> 
>  enum i40e_fdir_ip_type {
> @@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
>  	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
>  	bool inner_ip;   /* If there is inner ip */
>  	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
> +	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
>  	bool customized_pctype; /* If customized pctype is used */
>  	bool pkt_template; /* If raw packet template is used */
> +	bool is_udp; /* ipv4|ipv6 udp flow */
>  };
> 
>  /* A structure used to define the input for a flow director filter entry */ @@
> -769,6 +798,8 @@ enum i40e_tunnel_type {
>  	I40E_TUNNEL_TYPE_QINQ,
>  	I40E_TUNNEL_TYPE_GTPC,
>  	I40E_TUNNEL_TYPE_GTPU,
> +	I40E_TUNNEL_TYPE_ESPoUDP,
> +	I40E_TUNNEL_TYPE_ESPoIP,
>  	I40E_TUNNEL_TYPE_MAX,
>  };
> 
> @@ -897,6 +928,12 @@ enum i40e_new_pctype {
>  	I40E_CUSTOMIZED_GTPU_IPV4,
>  	I40E_CUSTOMIZED_GTPU_IPV6,
>  	I40E_CUSTOMIZED_GTPU,
> +	I40E_CUSTOMIZED_ESP_IPV4,
> +	I40E_CUSTOMIZED_ESP_IPV6,
> +	I40E_CUSTOMIZED_ESP_IPV4_UDP,
> +	I40E_CUSTOMIZED_ESP_IPV6_UDP,
> +	I40E_CUSTOMIZED_AH_IPV4,
> +	I40E_CUSTOMIZED_AH_IPV6,
>  	I40E_CUSTOMIZED_MAX,
>  };
> 
> @@ -1001,6 +1038,7 @@ struct i40e_pf {
> 
>  	/* Dynamic Device Personalization */
>  	bool gtp_support; /* 1 - support GTP-C and GTP-U */
> +	bool esp_support; /* 1 - support ESP SPI */
>  	/* customer customized pctype */
>  	struct i40e_customized_pctype
> customized_pctype[I40E_CUSTOMIZED_MAX];
>  	/* Switch Domain Id */
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index
> dee007d..3fa6297 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -54,6 +54,8 @@
>  #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
>  #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
> 
> +#define I40E_FDIR_ESP_DST_PORT              4500
> +
>  /* Wait time for fdir filter programming */  #define
> I40E_FDIR_MAX_WAIT_US 10000
> 
> @@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct
> i40e_pf *pf, uint8_t pctype)  }
> 
>  static inline int
> +fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char
> *raw_pkt,
> +		uint8_t next_proto, uint8_t len, uint16_t *ether_type) {
> +	struct rte_ipv6_hdr *ip6;
> +
> +	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
> +
> +	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
> +	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW
> |
> +		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
> +	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
> +	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
> +		fdir_input->flow.ipv6_flow.proto : next_proto;
> +	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
> +		fdir_input->flow.ipv6_flow.hop_limits :
> +		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
> +	/**
> +	 * The source and destination fields in the transmitted packet
> +	 * need to be presented in a reversed order with respect
> +	 * to the expected received packets.
> +	 */
> +	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
> +		IPV6_ADDR_LEN);
> +	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
> +		IPV6_ADDR_LEN);
> +	len += sizeof(struct rte_ipv6_hdr);
> +
> +	return len;
> +}
> +
> +static inline int
>  i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
>  				const struct i40e_fdir_input *fdir_input,
>  				unsigned char *raw_pkt,
> @@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf
> *pf,
>  		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
>  		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
> 
> -		if (!is_customized_pctype)
> +		if (!is_customized_pctype) {
>  			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
>  				fdir_input->flow.ip4_flow.proto :
>  				next_proto[fdir_input->pctype];
> -		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
> +			len += sizeof(struct rte_ipv4_hdr);
> +		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
>  			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
>  			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
> -			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
> +			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
>  			ip->next_proto_id = IPPROTO_UDP;
> -		len += sizeof(struct rte_ipv4_hdr);
> +			len += sizeof(struct rte_ipv4_hdr);
> +		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
> +			ip->next_proto_id = IPPROTO_ESP;
> +			len += sizeof(struct rte_ipv4_hdr);
> +		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
> +			ip->next_proto_id = IPPROTO_UDP;
> +			len += sizeof(struct rte_ipv4_hdr);
> +		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
> +			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
> +					len, ether_type);
> +		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
> +			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
> +					len, ether_type);
>  	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
>  		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
>  		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP || @@
> -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
>  			   IPV6_ADDR_LEN);
>  		len += sizeof(struct rte_ipv6_hdr);
>  	} else {
> -		PMD_DRV_LOG(ERR, "unknown pctype %u.",
> -			    fdir_input->pctype);
> +		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
>  		return -1;
>  	}
> 
> @@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>  	struct rte_flow_item_gtp *gtp;
>  	struct rte_ipv4_hdr *gtp_ipv4;
>  	struct rte_ipv6_hdr *gtp_ipv6;
> +	struct rte_flow_item_esp *esp;
> +	struct rte_ipv4_hdr *esp_ipv4;
> +	struct rte_ipv6_hdr *esp_ipv6;
> +
>  	uint8_t size, dst = 0;
>  	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
>  	int len;
> @@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>  			} else
>  				payload = (unsigned char *)gtp +
>  					sizeof(struct rte_flow_item_gtp);
> +		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
> +			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
> +			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
> +			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
> +			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
> +				esp_ipv4 = (struct rte_ipv4_hdr *)
> +					(raw_pkt + len);
> +				esp = (struct rte_flow_item_esp *)esp_ipv4;
> +				esp->hdr.spi =
> +					fdir_input->flow.esp_ipv4_flow.spi;
> +				payload = (unsigned char *)esp +
> +					sizeof(struct rte_esp_hdr);
> +				len += sizeof(struct rte_esp_hdr);
> +			} else if (cus_pctype->index ==
> +					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
> +				esp_ipv4 = (struct rte_ipv4_hdr *)
> +					(raw_pkt + len);
> +				udp = (struct rte_udp_hdr *)esp_ipv4;
> +				udp->dst_port = rte_cpu_to_be_16
> +					(I40E_FDIR_ESP_DST_PORT);
> +
> +				udp->dgram_len = rte_cpu_to_be_16
> +						(I40E_FDIR_UDP_DEFAULT_LEN);
> +				esp = (struct rte_flow_item_esp *)
> +					((unsigned char *)esp_ipv4 +
> +						sizeof(struct rte_udp_hdr));
> +				esp->hdr.spi =
> +					fdir_input->flow.esp_ipv4_udp_flow.spi;
> +				payload = (unsigned char *)esp +
> +					sizeof(struct rte_esp_hdr);
> +				len += sizeof(struct rte_udp_hdr) +
> +						sizeof(struct rte_esp_hdr);
> +			} else if (cus_pctype->index ==
> +					I40E_CUSTOMIZED_ESP_IPV6) {
> +				esp_ipv6 = (struct rte_ipv6_hdr *)
> +					(raw_pkt + len);
> +				esp = (struct rte_flow_item_esp *)esp_ipv6;
> +				esp->hdr.spi =
> +					fdir_input->flow.esp_ipv6_flow.spi;
> +				payload = (unsigned char *)esp +
> +					sizeof(struct rte_esp_hdr);
> +				len += sizeof(struct rte_esp_hdr);
> +			} else if (cus_pctype->index ==
> +					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
> +				esp_ipv6 = (struct rte_ipv6_hdr *)
> +					(raw_pkt + len);
> +				udp = (struct rte_udp_hdr *)esp_ipv6;
> +				udp->dst_port =	rte_cpu_to_be_16
> +					(I40E_FDIR_ESP_DST_PORT);
> +
> +				udp->dgram_len = rte_cpu_to_be_16
> +					(I40E_FDIR_UDP_DEFAULT_LEN);
> +				esp = (struct rte_flow_item_esp *)
> +					((unsigned char *)esp_ipv6 +
> +						sizeof(struct rte_udp_hdr));
> +				esp->hdr.spi =
> +					fdir_input->flow.esp_ipv6_udp_flow.spi;
> +				payload = (unsigned char *)esp +
> +					sizeof(struct rte_esp_hdr);
> +				len += sizeof(struct rte_udp_hdr) +
> +						sizeof(struct rte_esp_hdr);
> +			}
>  		}
>  	} else {
> -		PMD_DRV_LOG(ERR, "unknown pctype %u.",
> -			    fdir_input->pctype);
> +		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
>  		return -1;
>  	}
> 
> @@ -1305,7 +1415,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +	rte_hexdump(stdout, NULL, raw_pkt, len);
>  	return 0;
>  }
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index
> 6102103..c585d8b 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct
> i40e_pf *pf,  static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);  static
> int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);  static int
> i40e_flow_flush_tunnel_filter(struct i40e_pf *pf); -static int
> -i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
> +static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
>  static int
>  i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
>  			      const struct rte_flow_attr *attr, @@ -1615,6 +1614,36
> @@ static enum rte_flow_item_type pattern_qinq_1[] = {
>  	RTE_FLOW_ITEM_TYPE_END,
>  };
> 
> +static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
> +	RTE_FLOW_ITEM_TYPE_ETH,
> +	RTE_FLOW_ITEM_TYPE_IPV4,
> +	RTE_FLOW_ITEM_TYPE_ESP,
> +	RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
> +	RTE_FLOW_ITEM_TYPE_ETH,
> +	RTE_FLOW_ITEM_TYPE_IPV6,
> +	RTE_FLOW_ITEM_TYPE_ESP,
> +	RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
> +	RTE_FLOW_ITEM_TYPE_ETH,
> +	RTE_FLOW_ITEM_TYPE_IPV4,
> +	RTE_FLOW_ITEM_TYPE_UDP,
> +	RTE_FLOW_ITEM_TYPE_ESP,
> +	RTE_FLOW_ITEM_TYPE_END,
> +};
> +
> +static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
> +	RTE_FLOW_ITEM_TYPE_ETH,
> +	RTE_FLOW_ITEM_TYPE_IPV6,
> +	RTE_FLOW_ITEM_TYPE_UDP,
> +	RTE_FLOW_ITEM_TYPE_ESP,
> +	RTE_FLOW_ITEM_TYPE_END,
> +};
> +
>  static struct i40e_valid_pattern i40e_supported_patterns[] = {
>  	/* Ethertype */
>  	{ pattern_ethertype, i40e_flow_parse_ethertype_filter }, @@ -1628,6
> +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
>  	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
> +	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
> +	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter }, @@ -1636,6
> +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
>  	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
> +	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
> +	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
>  	/* FDIR - support default flow type with flexible payload */
>  	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
>  	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter }, @@
> -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
>  			cus_pctype = i40e_find_customized_pctype(pf,
>  						 I40E_CUSTOMIZED_GTPU_IPV6);
>  		break;
> +	case RTE_FLOW_ITEM_TYPE_ESP:
> +		if (!filter->input.flow_ext.is_udp) {
> +			if (filter->input.flow_ext.oip_type ==
> +				I40E_FDIR_IPTYPE_IPV4)
> +				cus_pctype = i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV4);
> +			else if (filter->input.flow_ext.oip_type ==
> +				I40E_FDIR_IPTYPE_IPV6)
> +				cus_pctype = i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV6);
> +		} else {
> +			if (filter->input.flow_ext.oip_type ==
> +				I40E_FDIR_IPTYPE_IPV4)
> +				cus_pctype = i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV4_UDP);
> +			else if (filter->input.flow_ext.oip_type ==
> +					I40E_FDIR_IPTYPE_IPV6)
> +				cus_pctype = i40e_find_customized_pctype(pf,
> +						I40E_CUSTOMIZED_ESP_IPV6_UDP);
> +			filter->input.flow_ext.is_udp = false;
> +		}
> +		break;
>  	default:
>  		PMD_DRV_LOG(ERR, "Unsupported item type");
>  		break;
> @@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf
> *pf,
>  	return I40E_FILTER_PCTYPE_INVALID;
>  }
> 
> +static void
> +i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
> +	const struct rte_flow_item_esp *esp_spec) {
> +	if (filter->input.flow_ext.oip_type ==
> +		I40E_FDIR_IPTYPE_IPV4) {
> +		if (filter->input.flow_ext.is_udp)
> +			filter->input.flow.esp_ipv4_udp_flow.spi =
> +				esp_spec->hdr.spi;
> +		else
> +			filter->input.flow.esp_ipv4_flow.spi =
> +				esp_spec->hdr.spi;
> +	}
> +	if (filter->input.flow_ext.oip_type ==
> +		I40E_FDIR_IPTYPE_IPV6) {
> +		if (filter->input.flow_ext.is_udp)
> +			filter->input.flow.esp_ipv6_udp_flow.spi =
> +				esp_spec->hdr.spi;
> +		else
> +			filter->input.flow.esp_ipv6_flow.spi =
> +				esp_spec->hdr.spi;
> +	}
> +}
> +
>  /* 1. Last in item should be NULL as range is not supported.
>   * 2. Supported patterns: refer to array i40e_supported_patterns.
>   * 3. Default supported flow type and input set: refer to array @@ -2459,6
> +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
>  	const struct rte_flow_item_udp *udp_spec, *udp_mask;
>  	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
>  	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
> +	const struct rte_flow_item_esp *esp_spec, *esp_mask;
>  	const struct rte_flow_item_raw *raw_spec, *raw_mask;
>  	const struct rte_flow_item_vf *vf_spec;
> 
> @@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  					ipv4_spec->hdr.src_addr;
>  				filter->input.flow.ip4_flow.dst_ip =
>  					ipv4_spec->hdr.dst_addr;
> +
> +				filter->input.flow_ext.inner_ip = false;
> +				filter->input.flow_ext.oip_type =
> +					I40E_FDIR_IPTYPE_IPV4;
>  			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
>  				filter->input.flow_ext.inner_ip = true;
>  				filter->input.flow_ext.iip_type =
>  					I40E_FDIR_IPTYPE_IPV4;
> +			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
> +				filter->input.flow_ext.inner_ip = false;
> +				filter->input.flow_ext.oip_type =
> +					I40E_FDIR_IPTYPE_IPV4;
>  			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
>  				rte_flow_error_set(error, EINVAL,
>  						   RTE_FLOW_ERROR_TYPE_ITEM,
> @@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  				filter->input.flow.ipv6_flow.hop_limits =
>  					ipv6_spec->hdr.hop_limits;
> 
> +				filter->input.flow_ext.inner_ip = false;
> +				filter->input.flow_ext.oip_type =
> +					I40E_FDIR_IPTYPE_IPV6;
> +
>  				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
>  					   ipv6_spec->hdr.src_addr, 16);
>  				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
> @@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  				filter->input.flow_ext.inner_ip = true;
>  				filter->input.flow_ext.iip_type =
>  					I40E_FDIR_IPTYPE_IPV6;
> +			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
> +				filter->input.flow_ext.inner_ip = false;
> +				filter->input.flow_ext.oip_type =
> +					I40E_FDIR_IPTYPE_IPV6;
>  			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
>  				rte_flow_error_set(error, EINVAL,
>  						   RTE_FLOW_ERROR_TYPE_ITEM,
> @@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  						udp_spec->hdr.dst_port;
>  				}
>  			}
> -
> +			filter->input.flow_ext.is_udp = true;
>  			layer_idx = I40E_FLXPLD_L4_IDX;
> 
>  			break;
> @@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev
> *dev,
>  				cus_proto = item_type;
>  			}
>  			break;
> +		case RTE_FLOW_ITEM_TYPE_ESP:
> +			if (!pf->esp_support) {
> +				rte_flow_error_set(error, EINVAL,
> +						   RTE_FLOW_ERROR_TYPE_ITEM,
> +						   item,
> +						   "Unsupported ESP protocol");
> +				return -rte_errno;
> +			}
> +
> +			esp_spec = item->spec;
> +			esp_mask = item->mask;
> +
> +			if (!esp_spec || !esp_mask) {
> +				rte_flow_error_set(error, EINVAL,
> +						   RTE_FLOW_ERROR_TYPE_ITEM,
> +						   item,
> +						   "Invalid ESP item");
> +				return -rte_errno;
> +			}
> +
> +			if (esp_spec && esp_mask) {
> +				if (esp_mask->hdr.spi != UINT32_MAX) {
> +					rte_flow_error_set(error, EINVAL,
> +						   RTE_FLOW_ERROR_TYPE_ITEM,
> +						   item,
> +						   "Invalid ESP mask");
> +					return -rte_errno;
> +				}
> +				i40e_flow_set_filter_spi(filter, esp_spec);
> +				filter->input.flow_ext.customized_pctype = true;
> +				cus_proto = item_type;
> +			}
> +			break;
>  		case RTE_FLOW_ITEM_TYPE_SCTP:
>  			sctp_spec = item->spec;
>  			sctp_mask = item->mask;
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 12:44     ` Zhang, Qi Z
@ 2020-01-09 14:02       ` Iremonger, Bernard
  2020-01-09 14:11         ` Zhang, Qi Z
  2020-01-09 23:07         ` Ananyev, Konstantin
  0 siblings, 2 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-09 14:02 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,


> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Thursday, January 9, 2020 12:44 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: RE: [PATCH v3 6/9] net/i40e: display Flow Director packet
> 
> Hi Bernard:
> 
> > -----Original Message-----
> > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > Sent: Thursday, January 9, 2020 8:17 PM
> > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > <helin.zhang@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Subject: [PATCH v3 6/9] net/i40e: display Flow Director packet
> >
> > call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/i40e_fdir.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/i40e/i40e_fdir.c
> > b/drivers/net/i40e/i40e_fdir.c index
> > 3fa6297..78329d2 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -21,6 +21,7 @@
> >  #include <rte_tcp.h>
> >  #include <rte_sctp.h>
> >  #include <rte_hash_crc.h>
> > +#include <rte_hexdump.h>
> >
> >  #include "i40e_logs.h"
> >  #include "base/i40e_type.h"
> > @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> > rte_eth_fdir_input *fdir_input,
> >  			    fdir_input->flow_type);
> >  		return -1;
> >  	}
> > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> 
> Why we need this? Does this just for debug?

Useful to see the packet constructed by this function, otherwise no visibility on what is happening.
Needed for debug.

> 
> Regards
> Qi
> 
> >  	return len;
> >  }
> >
> > @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> >  	return 0;
> >  }
> >
> > --
> > 2.7.4
> 

Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-09 14:08     ` Zhang, Qi Z
  2020-01-09 14:21       ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-09 14:08 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Bernard:
> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, January 9, 2020 8:16 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v3 4/9] net/i40e: handle ESP tunnel
> 
> handle ESP tunnel in rte_pmd_i40e.c

	Not sure if this should be part of the patch that enable the DDP that support ESP packet type, or at least it should be the one after that patch?

Regards
Qi
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
> index fdcb1a4..b987346 100644
> --- a/drivers/net/i40e/rte_pmd_i40e.c
> +++ b/drivers/net/i40e/rte_pmd_i40e.c
> @@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
>  	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
>  	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
>  	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
> -	    tnl != RTE_PTYPE_TUNNEL_L2TP)
> +	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
> +	    tnl != RTE_PTYPE_TUNNEL_ESP)
>  		return -1;
> 
>  	if (il2 &&
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 14:02       ` Iremonger, Bernard
@ 2020-01-09 14:11         ` Zhang, Qi Z
  2020-01-09 14:30           ` Iremonger, Bernard
  2020-01-09 23:07         ` Ananyev, Konstantin
  1 sibling, 1 reply; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-09 14:11 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, January 9, 2020 10:03 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org; Xing, Beilei
> <beilei.xing@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: RE: [PATCH v3 6/9] net/i40e: display Flow Director packet
> 
> Hi Qi,
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Sent: Thursday, January 9, 2020 12:44 PM
> > To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> > Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> > <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > <helin.zhang@intel.com>
> > Subject: RE: [PATCH v3 6/9] net/i40e: display Flow Director packet
> >
> > Hi Bernard:
> >
> > > -----Original Message-----
> > > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > > Sent: Thursday, January 9, 2020 8:17 PM
> > > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > > <helin.zhang@intel.com>; Iremonger, Bernard
> > > <bernard.iremonger@intel.com>
> > > Subject: [PATCH v3 6/9] net/i40e: display Flow Director packet
> > >
> > > call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> > >
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > >  drivers/net/i40e/i40e_fdir.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/i40e/i40e_fdir.c
> > > b/drivers/net/i40e/i40e_fdir.c index
> > > 3fa6297..78329d2 100644
> > > --- a/drivers/net/i40e/i40e_fdir.c
> > > +++ b/drivers/net/i40e/i40e_fdir.c
> > > @@ -21,6 +21,7 @@
> > >  #include <rte_tcp.h>
> > >  #include <rte_sctp.h>
> > >  #include <rte_hash_crc.h>
> > > +#include <rte_hexdump.h>
> > >
> > >  #include "i40e_logs.h"
> > >  #include "base/i40e_type.h"
> > > @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> > > rte_eth_fdir_input *fdir_input,
> > >      fdir_input->flow_type);
> > >  return -1;
> > >  }
> > > +rte_hexdump(stdout, NULL, raw_pkt, len);
> >
> > Why we need this? Does this just for debug?
> 
> Useful to see the packet constructed by this function, otherwise no visibility on
> what is happening.
> Needed for debug.

But this may flush the screen if we create 1000 rules by script and it impact the rule programming performance, should this code only be called when debug mode is enabled?
> 
> >
> > Regards
> > Qi
> >
> > >  return len;
> > >  }
> > >
> > > @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> > >   &fdir_input->flow_ext.flexbytes[dst],
> > >   size * sizeof(uint16_t));
> > >  }
> > > -
> > > +rte_hexdump(stdout, NULL, raw_pkt, len);
> > >  return 0;
> > >  }
> > >
> > > --
> > > 2.7.4
> >
> 
> Regards,
> 
> Bernard.
> 


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

* Re: [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel
  2020-01-09 14:08     ` Zhang, Qi Z
@ 2020-01-09 14:21       ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-09 14:21 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Thursday, January 9, 2020 2:09 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: RE: [PATCH v3 4/9] net/i40e: handle ESP tunnel
> 
> Hi Bernard:
> > -----Original Message-----
> > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > Sent: Thursday, January 9, 2020 8:16 PM
> > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > <helin.zhang@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Subject: [PATCH v3 4/9] net/i40e: handle ESP tunnel
> >
> > handle ESP tunnel in rte_pmd_i40e.c
> 
> 	Not sure if this should be part of the patch that enable the DDP that
> support ESP packet type, or at least it should be the one after that patch?

I think it is ok to be in a separate patch (easier to review).
The patch set may need to be reordered.

> 
> Regards
> Qi
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/i40e/rte_pmd_i40e.c
> > b/drivers/net/i40e/rte_pmd_i40e.c index fdcb1a4..b987346 100644
> > --- a/drivers/net/i40e/rte_pmd_i40e.c
> > +++ b/drivers/net/i40e/rte_pmd_i40e.c
> > @@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t
> pkt_type)
> >  	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
> >  	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
> >  	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
> > -	    tnl != RTE_PTYPE_TUNNEL_L2TP)
> > +	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
> > +	    tnl != RTE_PTYPE_TUNNEL_ESP)
> >  		return -1;
> >
> >  	if (il2 &&
> > --
> > 2.7.4
> 

Thanks for review.

Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 14:11         ` Zhang, Qi Z
@ 2020-01-09 14:30           ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-09 14:30 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,

<snip>

> > > Subject: RE: [PATCH v3 6/9] net/i40e: display Flow Director packet
> > >
> > > Hi Bernard:
> > >
> > > > -----Original Message-----
> > > > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > > > Sent: Thursday, January 9, 2020 8:17 PM
> > > > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi
> > > > Z <qi.z.zhang@intel.com>; Doherty, Declan
> > > > <declan.doherty@intel.com>
> > > > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > > > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > > > <helin.zhang@intel.com>; Iremonger, Bernard
> > > > <bernard.iremonger@intel.com>
> > > > Subject: [PATCH v3 6/9] net/i40e: display Flow Director packet
> > > >
> > > > call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> > > >
> > > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > > ---
> > > >  drivers/net/i40e/i40e_fdir.c | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/i40e/i40e_fdir.c
> > > > b/drivers/net/i40e/i40e_fdir.c index
> > > > 3fa6297..78329d2 100644
> > > > --- a/drivers/net/i40e/i40e_fdir.c
> > > > +++ b/drivers/net/i40e/i40e_fdir.c
> > > > @@ -21,6 +21,7 @@
> > > >  #include <rte_tcp.h>
> > > >  #include <rte_sctp.h>
> > > >  #include <rte_hash_crc.h>
> > > > +#include <rte_hexdump.h>
> > > >
> > > >  #include "i40e_logs.h"
> > > >  #include "base/i40e_type.h"
> > > > @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> > > > rte_eth_fdir_input *fdir_input,
> > > >      fdir_input->flow_type);
> > > >  return -1;
> > > >  }
> > > > +rte_hexdump(stdout, NULL, raw_pkt, len);
> > >
> > > Why we need this? Does this just for debug?
> >
> > Useful to see the packet constructed by this function, otherwise no
> > visibility on what is happening.
> > Needed for debug.
> 
> But this may flush the screen if we create 1000 rules by script and it impact
> the rule programming performance, should this code only be called when
> debug mode is enabled?

Yes, probably better to call in debug mode only.
Will change in v4 patchset.

> > >
> > > Regards
> > > Qi
> > >
> > > >  return len;
> > > >  }
> > > >
> > > > @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> > > >   &fdir_input->flow_ext.flexbytes[dst],
> > > >   size * sizeof(uint16_t));
> > > >  }
> > > > -
> > > > +rte_hexdump(stdout, NULL, raw_pkt, len);
> > > >  return 0;
> > > >  }
> > > >
> > > > --
> > > > 2.7.4
> > >
> >
 Regards,

 Bernard.

 


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 14:02       ` Iremonger, Bernard
  2020-01-09 14:11         ` Zhang, Qi Z
@ 2020-01-09 23:07         ` Ananyev, Konstantin
  2020-01-10  9:20           ` Iremonger, Bernard
  1 sibling, 1 reply; 134+ messages in thread
From: Ananyev, Konstantin @ 2020-01-09 23:07 UTC (permalink / raw)
  To: Iremonger, Bernard, Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Byrne, Stephen1, Zhang, Helin



> > >
> > > call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> > >
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > ---
> > >  drivers/net/i40e/i40e_fdir.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/i40e/i40e_fdir.c
> > > b/drivers/net/i40e/i40e_fdir.c index
> > > 3fa6297..78329d2 100644
> > > --- a/drivers/net/i40e/i40e_fdir.c
> > > +++ b/drivers/net/i40e/i40e_fdir.c
> > > @@ -21,6 +21,7 @@
> > >  #include <rte_tcp.h>
> > >  #include <rte_sctp.h>
> > >  #include <rte_hash_crc.h>
> > > +#include <rte_hexdump.h>
> > >
> > >  #include "i40e_logs.h"
> > >  #include "base/i40e_type.h"
> > > @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> > > rte_eth_fdir_input *fdir_input,
> > >  			    fdir_input->flow_type);
> > >  		return -1;
> > >  	}
> > > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> >
> > Why we need this? Does this just for debug?
> 
> Useful to see the packet constructed by this function, otherwise no visibility on what is happening.
> Needed for debug.

Then it probably should be called only when some debug option is enabled
(either at complie or runtime)? 

> 
> >
> > Regards
> > Qi
> >
> > >  	return len;
> > >  }
> > >
> > > @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> > >  				 &fdir_input->flow_ext.flexbytes[dst],
> > >  				 size * sizeof(uint16_t));
> > >  	}
> > > -
> > > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> > >  	return 0;
> > >  }
> > >
> > > --
> > > 2.7.4
> >
> 
> Regards,
> 
> Bernard.


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

* Re: [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet
  2020-01-09 23:07         ` Ananyev, Konstantin
@ 2020-01-10  9:20           ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-10  9:20 UTC (permalink / raw)
  To: Ananyev, Konstantin, Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Byrne, Stephen1, Zhang, Helin

Hi Konstantin,

> -----Original Message-----
> From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Sent: Thursday, January 9, 2020 11:08 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; dev@dpdk.org; Xing, Beilei
> <beilei.xing@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Byrne, Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>
> Subject: RE: [PATCH v3 6/9] net/i40e: display Flow Director packet
> 
> 
> 
> > > >
> > > > call rte_hexdump in i40e_flow_fdir_construct_pkt() in i40e_fdir.c
> > > >
> > > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > > ---
> > > >  drivers/net/i40e/i40e_fdir.c | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/i40e/i40e_fdir.c
> > > > b/drivers/net/i40e/i40e_fdir.c index
> > > > 3fa6297..78329d2 100644
> > > > --- a/drivers/net/i40e/i40e_fdir.c
> > > > +++ b/drivers/net/i40e/i40e_fdir.c
> > > > @@ -21,6 +21,7 @@
> > > >  #include <rte_tcp.h>
> > > >  #include <rte_sctp.h>
> > > >  #include <rte_hash_crc.h>
> > > > +#include <rte_hexdump.h>
> > > >
> > > >  #include "i40e_logs.h"
> > > >  #include "base/i40e_type.h"
> > > > @@ -805,6 +806,7 @@ i40e_fdir_fill_eth_ip_head(const struct
> > > > rte_eth_fdir_input *fdir_input,
> > > >  			    fdir_input->flow_type);
> > > >  		return -1;
> > > >  	}
> > > > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> > >
> > > Why we need this? Does this just for debug?
> >
> > Useful to see the packet constructed by this function, otherwise no
> visibility on what is happening.
> > Needed for debug.
> 
> Then it probably should be called only when some debug option is enabled
> (either at complie or runtime)?

Responded already to Qi that I will call in debug mode in v4 patchset.
I think compile time should be enough.

> 
> >
> > >
> > > Regards
> > > Qi
> > >
> > > >  	return len;
> > > >  }
> > > >
> > > > @@ -954,7 +956,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> > > >  				 &fdir_input->flow_ext.flexbytes[dst],
> > > >  				 size * sizeof(uint16_t));
> > > >  	}
> > > > -
> > > > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> > > >  	return 0;
> > > >  }
> > > >
> > > > --
> > > > 2.7.4
> > >
> >
Regards,

Bernard.


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

* [dpdk-dev] [PATCH v4 00/14] net/i40e: ESP support
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
@ 2020-01-10 15:20     ` " Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
                         ` (14 more replies)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                       ` (13 subsequent siblings)
  14 siblings, 15 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director and RSS.

Changes in V4:
-------------
Add extra patch for testpmd
Add extra patch for config
Split v3 patch "net/i40e: process ESP flows" into 4 patches

Changes in V3: 
-------------
Added i40e_flow_set_filter_spi() function in i40e_flow.c
Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
Split flow structures into 4 instead of 2 in i40e_ethdev.h 
Dropped extra printf from commandline_flow.c

Changes in V2: 
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c


Bernard Iremonger (14):
  app/testpmd: parse flow command line for ESP
  app/testpmd: improve debug
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: support ipsec-ah profile
  net/i40e: support ESP in customised code
  net/i40e: support ESP flows
  net/i40e: support ESP in Flow Director
  config: add debug to I40E Flow Director
  net/i40e: display Flow Director packet
  librte_ethdev: add ESP and AH flow types to RSS
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |   4 +-
 app/test-pmd/util.c                    |   1 +
 config/common_base                     |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 +++
 drivers/net/i40e/i40e_ethdev.c         |  52 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  38 +++++++++
 drivers/net/i40e/i40e_fdir.c           | 138 ++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 135 +++++++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 lib/librte_ethdev/rte_ethdev.h         |  29 ++++++-
 11 files changed, 392 insertions(+), 22 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 01/14] app/testpmd: parse flow command line for ESP
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 02/14] app/testpmd: improve debug Bernard Iremonger
                       ` (12 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add ITEM_ESP
add ITEM_ESP_SPI

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 4 +---
 app/test-pmd/config.c       | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 9643148..9c6edb8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -6075,9 +6075,6 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
 static void
 cmd_flow_parsed(const struct buffer *in)
 {
-	printf("Flow command line parsed successfully for command=%d.\n",
-			in->command);
-
 	switch (in->command) {
 	case VALIDATE:
 		port_flow_validate(in->port, &in->args.vc.attr,
@@ -6261,6 +6258,7 @@ flow_item_default_mask(const struct rte_flow_item *item)
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
 	case RTE_FLOW_ITEM_TYPE_ESP:
 		mask = &rte_flow_item_esp_mask;
 		break;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2753ec5..d599682 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
+	printf("Caught error type %d (%s): %s%s: %s\n",
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 02/14] app/testpmd: improve debug
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                       ` (11 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 03/14] app/testpmd: dump Rx and Tx mbuf
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (2 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 02/14] app/testpmd: improve debug Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 04/14] net/i40e: improve RSS debug Bernard Iremonger
                       ` (10 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 04/14] net/i40e: improve RSS debug
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (3 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
                       ` (9 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 05/14] net/i40e: handle ESP tunnel
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (4 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 04/14] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
                       ` (8 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 06/14] net/i40e: support ipsec-ah profile
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (5 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 07/14] net/i40e: support ESP in customised code Bernard Iremonger
                       ` (7 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..792a047 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_ipv4_flow ipv4;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_ipv6_flow ipv6;
+	uint32_t spi;	/* SPI in big endian. */
+};
+/* A structure used to define the input for ESP IPV4 UDP flow */
+struct i40e_esp_ipv4_udp_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 UDP flow */
+struct i40e_esp_ipv6_udp_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +549,10 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
+	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
+	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +798,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +928,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1038,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 07/14] net/i40e: support ESP in customised code
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (6 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 08/14] net/i40e: support ESP flows Bernard Iremonger
                       ` (6 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 44 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 08/14] net/i40e: support ESP flows
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (7 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 07/14] net/i40e: support ESP in customised code Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
                       ` (5 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 135 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..c585d8b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 	return I40E_FILTER_PCTYPE_INVALID;
 }
 
+static void
+i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
+	const struct rte_flow_item_esp *esp_spec)
+{
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV4) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv4_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv4_flow.spi =
+				esp_spec->hdr.spi;
+	}
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV6) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv6_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv6_flow.spi =
+				esp_spec->hdr.spi;
+	}
+}
+
 /* 1. Last in item should be NULL as range is not supported.
  * 2. Supported patterns: refer to array i40e_supported_patterns.
  * 3. Default supported flow type and input set: refer to array
@@ -2459,6 +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				i40e_flow_set_filter_spi(filter, esp_spec);
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 09/14] net/i40e: support ESP in Flow Director
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (8 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 08/14] net/i40e: support ESP flows Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 10/14] config: add debug to I40E " Bernard Iremonger
                       ` (4 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 126 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 118 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..5f85703 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -54,6 +54,8 @@
 #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
 #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
 
+#define I40E_FDIR_ESP_DST_PORT              4500
+
 /* Wait time for fdir filter programming */
 #define I40E_FDIR_MAX_WAIT_US 10000
 
@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				udp->dst_port = rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				udp->dst_port =	rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 10/14] config: add debug to I40E Flow Director
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (9 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
@ 2020-01-10 15:20     ` " Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 11/14] net/i40e: display Flow Director packet Bernard Iremonger
                       ` (3 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 config/common_base | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/common_base b/config/common_base
index 7dec7ed..7a76c26 100644
--- a/config/common_base
+++ b/config/common_base
@@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
 CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 11/14] net/i40e: display Flow Director packet
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (10 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 10/14] config: add debug to I40E " Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
                       ` (2 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

include rte_config.h in i40e_fdir.c
In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt()
and in i40e_fdir_construct_pkt()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 5f85703..67bb28c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,10 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_config.h>
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+#include <rte_hexdump.h>
+#endif
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
@@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (11 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 11/14] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 13/14] doc: release note for ESP Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 14/14] doc: update i40e user guide Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow types for the following PCTYPE's in the DDP ipsec profile:
14: IPV6 ESP
15: IPV4 ESP
16: IPV6 AH
17: IPV4 AH
18: IPV6 UDP ESP
19: IPV4 UDP ESP

Add the following RSS macros for IPsec:
ETH_RSS_ESP
ETH_RSS_AH
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..39c89cb 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,13 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_IPV4_AH            24 /**< IPv4 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV4_ESP           25 /**< IPv4 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV4_UDP_ESP       26 /**< IPv4 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_IPV6_AH            27 /**< IPv6 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV6_ESP           28 /**< IPv6 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV6_UDP_ESP       29 /**< IPv6 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_MAX                30
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +517,13 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_IPV4_AH            (1ULL << 24)
+#define ETH_RSS_IPV4_ESP           (1ULL << 25)
+#define ETH_RSS_IPV4_UDP_ESP       (1ULL << 26)
+#define ETH_RSS_IPV6_AH            (1ULL << 27)
+#define ETH_RSS_IPV6_ESP           (1ULL << 28)
+#define ETH_RSS_IPV6_UDP_ESP       (1ULL << 29)
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +584,20 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_AH ( \
+	ETH_RSS_IPV4_AH | \
+	ETH_RSS_IPV6_AH)
+
+#define ETH_RSS_ESP ( \
+	ETH_RSS_IPV4_ESP | \
+	ETH_RSS_IPV6_ESP | \
+	ETH_RSS_IPV4_UDP_ESP | \
+	ETH_RSS_IPV6_UDP_ESP)
+
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 13/14] doc: release note for ESP
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (12 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 14/14] doc: update i40e user guide Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH v4 14/14] doc: update i40e user guide
  2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
                       ` (13 preceding siblings ...)
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 13/14] doc: release note for ESP Bernard Iremonger
@ 2020-01-10 15:20     ` Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-10 15:20 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows
  2020-01-09 14:00     ` Zhang, Qi Z
@ 2020-01-13 11:56       ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-13 11:56 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Thursday, January 9, 2020 2:01 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: RE: [PATCH v3 5/9] net/i40e: process ESP flows
> 
> Hi Bernard:
> 
> > -----Original Message-----
> > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > Sent: Thursday, January 9, 2020 8:17 PM
> > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > <helin.zhang@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Subject: [PATCH v3 5/9] net/i40e: process ESP flows
> >
> > Process ESP flows on Flow Director and RSS.
> >
> > add eth/ipv4/esp and eth/ipv6/esp patterns add eth/ipv4/udp/esp and
> > eth/ipv6/esp/udp patterns add flow structures for above patterns
> > update
> > i40e_flow_parse_fdir_filter() add i40e_flow_set_filter_spi() add
> > fill_ip6_head() add oip_type in filter add is_udp in filter use
> > tenant_id in filter for spi handle ESP and AH pctypes in ESP-AH
> > profile update customized code for ESP hardcode udp destination port
> > to 4500
> 
> Looks like the patch could be separate into 3 parts for easy review.
> 
> One is for the DDP package process,  (rte_pmd_i40e_process_ddp_package -
> > i40e_update_customized_info -> i40e_update_customized_pctype One is
> for fdir related - training packet construction .. etc.
> And one for adding all rte_flow parser
> 
> Regards
> Qi

I have refactored this patch into 4 patches in the v4 patchset.

> 
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c |  44 +++++++++++++-
> > drivers/net/i40e/i40e_ethdev.h |  38 ++++++++++++
> >  drivers/net/i40e/i40e_fdir.c   | 128
> > +++++++++++++++++++++++++++++++++++---
> >  drivers/net/i40e/i40e_flow.c   | 135
> > ++++++++++++++++++++++++++++++++++++++++-
> >  4 files changed, 332 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 5f1cf8a..a462eba 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
> >  	}
> >
> >  	pf->gtp_support = false;
> > +	pf->esp_support = false;
> >  }
> >
> >  void
> > @@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  			}
> >  		}
> >  		name[strlen(name) - 1] = '\0';
> > +		PMD_DRV_LOG(INFO, "name = %s\n", name);
> >  		if (!strcmp(name, "GTPC"))
> >  			new_pctype =
> >  				i40e_find_customized_pctype(pf,
> > @@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  			new_pctype =
> >  				i40e_find_customized_pctype(pf,
> >
> I40E_CUSTOMIZED_GTPU);
> > +		else if (!strcmp(name, "IPV4_ESP"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV4);
> > +		else if (!strcmp(name, "IPV6_ESP"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV6);
> > +		else if (!strcmp(name, "IPV4_UDP_ESP"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV4_UDP);
> > +		else if (!strcmp(name, "IPV6_UDP_ESP"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV6_UDP);
> > +		else if (!strcmp(name, "IPV4_AH"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_AH_IPV4);
> > +		else if (!strcmp(name, "IPV6_AH"))
> > +			new_pctype =
> > +				i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_AH_IPV6);
> >  		if (new_pctype) {
> >  			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
> >  				new_pctype->pctype = pctype_value; @@ -
> 12448,6 +12474,7 @@
> > i40e_update_customized_ptype(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  					continue;
> >  				memset(name, 0, sizeof(name));
> >  				strcpy(name, proto[n].name);
> > +				PMD_DRV_LOG(INFO, "name = %s\n",
> name);
> >  				if (!strncasecmp(name, "PPPOE", 5))
> >  					ptype_mapping[i].sw_ptype |=
> >
> 	RTE_PTYPE_L2_ETHER_PPPOE;
> > @@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  					ptype_mapping[i].sw_ptype |=
> >  						RTE_PTYPE_TUNNEL_GTPU;
> >  					in_tunnel = true;
> > +				} else if (!strncasecmp(name, "ESP", 3)) {
> > +					ptype_mapping[i].sw_ptype |=
> > +						RTE_PTYPE_TUNNEL_ESP;
> > +					in_tunnel = true;
> >  				} else if (!strncasecmp(name, "GRENAT", 6)) {
> >  					ptype_mapping[i].sw_ptype |=
> >
> 	RTE_PTYPE_TUNNEL_GRENAT;
> > @@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  	ret = rte_pmd_i40e_ptype_mapping_update(port_id,
> ptype_mapping,
> >  						ptype_num, 0);
> >  	if (ret)
> > -		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
> > +		PMD_DRV_LOG(ERR, "Failed to update ptype mapping
> table.");
> >
> >  	rte_free(ptype_mapping);
> >  	rte_free(ptype);
> > @@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct
> > rte_eth_dev *dev, uint8_t *pkg,
> >  		}
> >  	}
> >
> > +	/* Check if ESP is supported. */
> > +	for (i = 0; i < proto_num; i++) {
> > +		if (!strncmp(proto[i].name, "ESP", 3)) {
> > +			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
> > +				pf->esp_support = true;
> > +			else
> > +				pf->esp_support = false;
> > +			break;
> > +		}
> > +	}
> > +
> >  	/* Update customized pctype info */
> >  	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
> >  					    proto_num, proto, op);
> > diff --git a/drivers/net/i40e/i40e_ethdev.h
> > b/drivers/net/i40e/i40e_ethdev.h index 295ad59..792a047 100644
> > --- a/drivers/net/i40e/i40e_ethdev.h
> > +++ b/drivers/net/i40e/i40e_ethdev.h
> > @@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
> >  	struct rte_eth_ipv6_flow ip6;
> >  };
> >
> > +/* A structure used to define the input for ESP IPV4 flow */ struct
> > +i40e_esp_ipv4_flow {
> > +	struct rte_eth_ipv4_flow ipv4;
> > +	uint32_t spi;	/* SPI in big endian. */
> > +};
> > +
> > +/* A structure used to define the input for ESP IPV6 flow */ struct
> > +i40e_esp_ipv6_flow {
> > +	struct rte_eth_ipv6_flow ipv6;
> > +	uint32_t spi;	/* SPI in big endian. */
> > +};
> > +/* A structure used to define the input for ESP IPV4 UDP flow */
> > +struct i40e_esp_ipv4_udp_flow {
> > +	struct rte_eth_udpv4_flow udp;
> > +	uint32_t spi;	/* SPI in big endian. */
> > +};
> > +
> > +/* A structure used to define the input for ESP IPV6 UDP flow */
> > +struct i40e_esp_ipv6_udp_flow {
> > +	struct rte_eth_udpv6_flow udp;
> > +	uint32_t spi;	/* SPI in big endian. */
> > +};
> > +
> >  /* A structure used to define the input for raw type flow */  struct
> > i40e_raw_flow {
> >  	uint16_t pctype;
> > @@ -526,6 +549,10 @@ union i40e_fdir_flow {
> >  	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
> >  	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
> >  	struct i40e_raw_flow       raw_flow;
> > +	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
> > +	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
> > +	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
> > +	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
> >  };
> >
> >  enum i40e_fdir_ip_type {
> > @@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
> >  	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
> >  	bool inner_ip;   /* If there is inner ip */
> >  	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
> > +	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
> >  	bool customized_pctype; /* If customized pctype is used */
> >  	bool pkt_template; /* If raw packet template is used */
> > +	bool is_udp; /* ipv4|ipv6 udp flow */
> >  };
> >
> >  /* A structure used to define the input for a flow director filter
> > entry */ @@
> > -769,6 +798,8 @@ enum i40e_tunnel_type {
> >  	I40E_TUNNEL_TYPE_QINQ,
> >  	I40E_TUNNEL_TYPE_GTPC,
> >  	I40E_TUNNEL_TYPE_GTPU,
> > +	I40E_TUNNEL_TYPE_ESPoUDP,
> > +	I40E_TUNNEL_TYPE_ESPoIP,
> >  	I40E_TUNNEL_TYPE_MAX,
> >  };
> >
> > @@ -897,6 +928,12 @@ enum i40e_new_pctype {
> >  	I40E_CUSTOMIZED_GTPU_IPV4,
> >  	I40E_CUSTOMIZED_GTPU_IPV6,
> >  	I40E_CUSTOMIZED_GTPU,
> > +	I40E_CUSTOMIZED_ESP_IPV4,
> > +	I40E_CUSTOMIZED_ESP_IPV6,
> > +	I40E_CUSTOMIZED_ESP_IPV4_UDP,
> > +	I40E_CUSTOMIZED_ESP_IPV6_UDP,
> > +	I40E_CUSTOMIZED_AH_IPV4,
> > +	I40E_CUSTOMIZED_AH_IPV6,
> >  	I40E_CUSTOMIZED_MAX,
> >  };
> >
> > @@ -1001,6 +1038,7 @@ struct i40e_pf {
> >
> >  	/* Dynamic Device Personalization */
> >  	bool gtp_support; /* 1 - support GTP-C and GTP-U */
> > +	bool esp_support; /* 1 - support ESP SPI */
> >  	/* customer customized pctype */
> >  	struct i40e_customized_pctype
> > customized_pctype[I40E_CUSTOMIZED_MAX];
> >  	/* Switch Domain Id */
> > diff --git a/drivers/net/i40e/i40e_fdir.c
> > b/drivers/net/i40e/i40e_fdir.c index
> > dee007d..3fa6297 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -54,6 +54,8 @@
> >  #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
> >  #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
> >
> > +#define I40E_FDIR_ESP_DST_PORT              4500
> > +
> >  /* Wait time for fdir filter programming */  #define
> > I40E_FDIR_MAX_WAIT_US 10000
> >
> > @@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct
> > i40e_pf *pf, uint8_t pctype)  }
> >
> >  static inline int
> > +fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char
> > *raw_pkt,
> > +		uint8_t next_proto, uint8_t len, uint16_t *ether_type) {
> > +	struct rte_ipv6_hdr *ip6;
> > +
> > +	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
> > +
> > +	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
> > +	ip6->vtc_flow =
> rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW
> > |
> > +		(fdir_input->flow.ipv6_flow.tc <<
> I40E_FDIR_IPv6_TC_OFFSET));
> > +	ip6->payload_len =
> rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
> > +	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
> > +		fdir_input->flow.ipv6_flow.proto : next_proto;
> > +	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
> > +		fdir_input->flow.ipv6_flow.hop_limits :
> > +		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
> > +	/**
> > +	 * The source and destination fields in the transmitted packet
> > +	 * need to be presented in a reversed order with respect
> > +	 * to the expected received packets.
> > +	 */
> > +	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
> > +		IPV6_ADDR_LEN);
> > +	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
> > +		IPV6_ADDR_LEN);
> > +	len += sizeof(struct rte_ipv6_hdr);
> > +
> > +	return len;
> > +}
> > +
> > +static inline int
> >  i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
> >  				const struct i40e_fdir_input *fdir_input,
> >  				unsigned char *raw_pkt,
> > @@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf
> > *pf,
> >  		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
> >  		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
> >
> > -		if (!is_customized_pctype)
> > +		if (!is_customized_pctype) {
> >  			ip->next_proto_id = fdir_input->flow.ip4_flow.proto
> ?
> >  				fdir_input->flow.ip4_flow.proto :
> >  				next_proto[fdir_input->pctype];
> > -		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
> > +			len += sizeof(struct rte_ipv4_hdr);
> > +		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
> >  			 cus_pctype->index ==
> I40E_CUSTOMIZED_GTPU_IPV4 ||
> >  			 cus_pctype->index ==
> I40E_CUSTOMIZED_GTPU_IPV6 ||
> > -			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
> > +			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
> >  			ip->next_proto_id = IPPROTO_UDP;
> > -		len += sizeof(struct rte_ipv4_hdr);
> > +			len += sizeof(struct rte_ipv4_hdr);
> > +		} else if (cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV4) {
> > +			ip->next_proto_id = IPPROTO_ESP;
> > +			len += sizeof(struct rte_ipv4_hdr);
> > +		} else if (cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV4_UDP) {
> > +			ip->next_proto_id = IPPROTO_UDP;
> > +			len += sizeof(struct rte_ipv4_hdr);
> > +		} else if (cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV6)
> > +			len = fill_ip6_head(fdir_input, raw_pkt,
> IPPROTO_ESP,
> > +					len, ether_type);
> > +		else if (cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV6_UDP)
> > +			len = fill_ip6_head(fdir_input, raw_pkt,
> IPPROTO_UDP,
> > +					len, ether_type);
> >  	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
> >  		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
> >  		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP || @@
> > -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
> >  			   IPV6_ADDR_LEN);
> >  		len += sizeof(struct rte_ipv6_hdr);
> >  	} else {
> > -		PMD_DRV_LOG(ERR, "unknown pctype %u.",
> > -			    fdir_input->pctype);
> > +		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input-
> >pctype);
> >  		return -1;
> >  	}
> >
> > @@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf
> *pf,
> >  	struct rte_flow_item_gtp *gtp;
> >  	struct rte_ipv4_hdr *gtp_ipv4;
> >  	struct rte_ipv6_hdr *gtp_ipv6;
> > +	struct rte_flow_item_esp *esp;
> > +	struct rte_ipv4_hdr *esp_ipv4;
> > +	struct rte_ipv6_hdr *esp_ipv6;
> > +
> >  	uint8_t size, dst = 0;
> >  	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by
> default*/
> >  	int len;
> > @@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf
> *pf,
> >  			} else
> >  				payload = (unsigned char *)gtp +
> >  					sizeof(struct rte_flow_item_gtp);
> > +		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4
> ||
> > +			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6
> ||
> > +			cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV4_UDP ||
> > +			cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV6_UDP) {
> > +			if (cus_pctype->index ==
> I40E_CUSTOMIZED_ESP_IPV4) {
> > +				esp_ipv4 = (struct rte_ipv4_hdr *)
> > +					(raw_pkt + len);
> > +				esp = (struct rte_flow_item_esp *)esp_ipv4;
> > +				esp->hdr.spi =
> > +					fdir_input->flow.esp_ipv4_flow.spi;
> > +				payload = (unsigned char *)esp +
> > +					sizeof(struct rte_esp_hdr);
> > +				len += sizeof(struct rte_esp_hdr);
> > +			} else if (cus_pctype->index ==
> > +					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
> > +				esp_ipv4 = (struct rte_ipv4_hdr *)
> > +					(raw_pkt + len);
> > +				udp = (struct rte_udp_hdr *)esp_ipv4;
> > +				udp->dst_port = rte_cpu_to_be_16
> > +					(I40E_FDIR_ESP_DST_PORT);
> > +
> > +				udp->dgram_len = rte_cpu_to_be_16
> > +
> 	(I40E_FDIR_UDP_DEFAULT_LEN);
> > +				esp = (struct rte_flow_item_esp *)
> > +					((unsigned char *)esp_ipv4 +
> > +						sizeof(struct rte_udp_hdr));
> > +				esp->hdr.spi =
> > +					fdir_input-
> >flow.esp_ipv4_udp_flow.spi;
> > +				payload = (unsigned char *)esp +
> > +					sizeof(struct rte_esp_hdr);
> > +				len += sizeof(struct rte_udp_hdr) +
> > +						sizeof(struct rte_esp_hdr);
> > +			} else if (cus_pctype->index ==
> > +					I40E_CUSTOMIZED_ESP_IPV6) {
> > +				esp_ipv6 = (struct rte_ipv6_hdr *)
> > +					(raw_pkt + len);
> > +				esp = (struct rte_flow_item_esp *)esp_ipv6;
> > +				esp->hdr.spi =
> > +					fdir_input->flow.esp_ipv6_flow.spi;
> > +				payload = (unsigned char *)esp +
> > +					sizeof(struct rte_esp_hdr);
> > +				len += sizeof(struct rte_esp_hdr);
> > +			} else if (cus_pctype->index ==
> > +					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
> > +				esp_ipv6 = (struct rte_ipv6_hdr *)
> > +					(raw_pkt + len);
> > +				udp = (struct rte_udp_hdr *)esp_ipv6;
> > +				udp->dst_port =	rte_cpu_to_be_16
> > +					(I40E_FDIR_ESP_DST_PORT);
> > +
> > +				udp->dgram_len = rte_cpu_to_be_16
> > +					(I40E_FDIR_UDP_DEFAULT_LEN);
> > +				esp = (struct rte_flow_item_esp *)
> > +					((unsigned char *)esp_ipv6 +
> > +						sizeof(struct rte_udp_hdr));
> > +				esp->hdr.spi =
> > +					fdir_input-
> >flow.esp_ipv6_udp_flow.spi;
> > +				payload = (unsigned char *)esp +
> > +					sizeof(struct rte_esp_hdr);
> > +				len += sizeof(struct rte_udp_hdr) +
> > +						sizeof(struct rte_esp_hdr);
> > +			}
> >  		}
> >  	} else {
> > -		PMD_DRV_LOG(ERR, "unknown pctype %u.",
> > -			    fdir_input->pctype);
> > +		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input-
> >pctype);
> >  		return -1;
> >  	}
> >
> > @@ -1305,7 +1415,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +	rte_hexdump(stdout, NULL, raw_pkt, len);
> >  	return 0;
> >  }
> >
> > diff --git a/drivers/net/i40e/i40e_flow.c
> > b/drivers/net/i40e/i40e_flow.c index 6102103..c585d8b 100644
> > --- a/drivers/net/i40e/i40e_flow.c
> > +++ b/drivers/net/i40e/i40e_flow.c
> > @@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct
> > i40e_pf *pf,  static int i40e_flow_flush_fdir_filter(struct i40e_pf
> > *pf);  static int i40e_flow_flush_ethertype_filter(struct i40e_pf
> > *pf);  static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
> > -static int -i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
> > +static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
> >  static int
> >  i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
> >  			      const struct rte_flow_attr *attr, @@ -1615,6
> +1614,36 @@
> > static enum rte_flow_item_type pattern_qinq_1[] = {
> >  	RTE_FLOW_ITEM_TYPE_END,
> >  };
> >
> > +static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
> > +	RTE_FLOW_ITEM_TYPE_ETH,
> > +	RTE_FLOW_ITEM_TYPE_IPV4,
> > +	RTE_FLOW_ITEM_TYPE_ESP,
> > +	RTE_FLOW_ITEM_TYPE_END,
> > +};
> > +
> > +static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
> > +	RTE_FLOW_ITEM_TYPE_ETH,
> > +	RTE_FLOW_ITEM_TYPE_IPV6,
> > +	RTE_FLOW_ITEM_TYPE_ESP,
> > +	RTE_FLOW_ITEM_TYPE_END,
> > +};
> > +
> > +static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
> > +	RTE_FLOW_ITEM_TYPE_ETH,
> > +	RTE_FLOW_ITEM_TYPE_IPV4,
> > +	RTE_FLOW_ITEM_TYPE_UDP,
> > +	RTE_FLOW_ITEM_TYPE_ESP,
> > +	RTE_FLOW_ITEM_TYPE_END,
> > +};
> > +
> > +static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
> > +	RTE_FLOW_ITEM_TYPE_ETH,
> > +	RTE_FLOW_ITEM_TYPE_IPV6,
> > +	RTE_FLOW_ITEM_TYPE_UDP,
> > +	RTE_FLOW_ITEM_TYPE_ESP,
> > +	RTE_FLOW_ITEM_TYPE_END,
> > +};
> > +
> >  static struct i40e_valid_pattern i40e_supported_patterns[] = {
> >  	/* Ethertype */
> >  	{ pattern_ethertype, i40e_flow_parse_ethertype_filter }, @@ -
> 1628,6
> > +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[]
> > += {
> >  	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
> > +	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
> > +	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter }, @@ -1636,6
> > +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[]
> > += {
> >  	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
> > +	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
> > +	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
> >  	/* FDIR - support default flow type with flexible payload */
> >  	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
> >  	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter }, @@
> > -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
> >  			cus_pctype = i40e_find_customized_pctype(pf,
> >
> I40E_CUSTOMIZED_GTPU_IPV6);
> >  		break;
> > +	case RTE_FLOW_ITEM_TYPE_ESP:
> > +		if (!filter->input.flow_ext.is_udp) {
> > +			if (filter->input.flow_ext.oip_type ==
> > +				I40E_FDIR_IPTYPE_IPV4)
> > +				cus_pctype =
> i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV4);
> > +			else if (filter->input.flow_ext.oip_type ==
> > +				I40E_FDIR_IPTYPE_IPV6)
> > +				cus_pctype =
> i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV6);
> > +		} else {
> > +			if (filter->input.flow_ext.oip_type ==
> > +				I40E_FDIR_IPTYPE_IPV4)
> > +				cus_pctype =
> i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV4_UDP);
> > +			else if (filter->input.flow_ext.oip_type ==
> > +					I40E_FDIR_IPTYPE_IPV6)
> > +				cus_pctype =
> i40e_find_customized_pctype(pf,
> > +
> 	I40E_CUSTOMIZED_ESP_IPV6_UDP);
> > +			filter->input.flow_ext.is_udp = false;
> > +		}
> > +		break;
> >  	default:
> >  		PMD_DRV_LOG(ERR, "Unsupported item type");
> >  		break;
> > @@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf
> > *pf,
> >  	return I40E_FILTER_PCTYPE_INVALID;
> >  }
> >
> > +static void
> > +i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
> > +	const struct rte_flow_item_esp *esp_spec) {
> > +	if (filter->input.flow_ext.oip_type ==
> > +		I40E_FDIR_IPTYPE_IPV4) {
> > +		if (filter->input.flow_ext.is_udp)
> > +			filter->input.flow.esp_ipv4_udp_flow.spi =
> > +				esp_spec->hdr.spi;
> > +		else
> > +			filter->input.flow.esp_ipv4_flow.spi =
> > +				esp_spec->hdr.spi;
> > +	}
> > +	if (filter->input.flow_ext.oip_type ==
> > +		I40E_FDIR_IPTYPE_IPV6) {
> > +		if (filter->input.flow_ext.is_udp)
> > +			filter->input.flow.esp_ipv6_udp_flow.spi =
> > +				esp_spec->hdr.spi;
> > +		else
> > +			filter->input.flow.esp_ipv6_flow.spi =
> > +				esp_spec->hdr.spi;
> > +	}
> > +}
> > +
> >  /* 1. Last in item should be NULL as range is not supported.
> >   * 2. Supported patterns: refer to array i40e_supported_patterns.
> >   * 3. Default supported flow type and input set: refer to array @@
> > -2459,6
> > +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
> >  	const struct rte_flow_item_udp *udp_spec, *udp_mask;
> >  	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
> >  	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
> > +	const struct rte_flow_item_esp *esp_spec, *esp_mask;
> >  	const struct rte_flow_item_raw *raw_spec, *raw_mask;
> >  	const struct rte_flow_item_vf *vf_spec;
> >
> > @@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct
> > rte_eth_dev *dev,
> >  					ipv4_spec->hdr.src_addr;
> >  				filter->input.flow.ip4_flow.dst_ip =
> >  					ipv4_spec->hdr.dst_addr;
> > +
> > +				filter->input.flow_ext.inner_ip = false;
> > +				filter->input.flow_ext.oip_type =
> > +					I40E_FDIR_IPTYPE_IPV4;
> >  			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
> >  				filter->input.flow_ext.inner_ip = true;
> >  				filter->input.flow_ext.iip_type =
> >  					I40E_FDIR_IPTYPE_IPV4;
> > +			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
> > +				filter->input.flow_ext.inner_ip = false;
> > +				filter->input.flow_ext.oip_type =
> > +					I40E_FDIR_IPTYPE_IPV4;
> >  			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
> >  				rte_flow_error_set(error, EINVAL,
> >
> RTE_FLOW_ERROR_TYPE_ITEM,
> > @@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct
> rte_eth_dev
> > *dev,
> >  				filter->input.flow.ipv6_flow.hop_limits =
> >  					ipv6_spec->hdr.hop_limits;
> >
> > +				filter->input.flow_ext.inner_ip = false;
> > +				filter->input.flow_ext.oip_type =
> > +					I40E_FDIR_IPTYPE_IPV6;
> > +
> >  				rte_memcpy(filter-
> >input.flow.ipv6_flow.src_ip,
> >  					   ipv6_spec->hdr.src_addr, 16);
> >  				rte_memcpy(filter-
> >input.flow.ipv6_flow.dst_ip,
> > @@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct
> rte_eth_dev
> > *dev,
> >  				filter->input.flow_ext.inner_ip = true;
> >  				filter->input.flow_ext.iip_type =
> >  					I40E_FDIR_IPTYPE_IPV6;
> > +			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
> > +				filter->input.flow_ext.inner_ip = false;
> > +				filter->input.flow_ext.oip_type =
> > +					I40E_FDIR_IPTYPE_IPV6;
> >  			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
> >  				rte_flow_error_set(error, EINVAL,
> >
> RTE_FLOW_ERROR_TYPE_ITEM,
> > @@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct
> rte_eth_dev
> > *dev,
> >  						udp_spec->hdr.dst_port;
> >  				}
> >  			}
> > -
> > +			filter->input.flow_ext.is_udp = true;
> >  			layer_idx = I40E_FLXPLD_L4_IDX;
> >
> >  			break;
> > @@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct
> rte_eth_dev
> > *dev,
> >  				cus_proto = item_type;
> >  			}
> >  			break;
> > +		case RTE_FLOW_ITEM_TYPE_ESP:
> > +			if (!pf->esp_support) {
> > +				rte_flow_error_set(error, EINVAL,
> > +
> RTE_FLOW_ERROR_TYPE_ITEM,
> > +						   item,
> > +						   "Unsupported ESP
> protocol");
> > +				return -rte_errno;
> > +			}
> > +
> > +			esp_spec = item->spec;
> > +			esp_mask = item->mask;
> > +
> > +			if (!esp_spec || !esp_mask) {
> > +				rte_flow_error_set(error, EINVAL,
> > +
> RTE_FLOW_ERROR_TYPE_ITEM,
> > +						   item,
> > +						   "Invalid ESP item");
> > +				return -rte_errno;
> > +			}
> > +
> > +			if (esp_spec && esp_mask) {
> > +				if (esp_mask->hdr.spi != UINT32_MAX) {
> > +					rte_flow_error_set(error, EINVAL,
> > +
> RTE_FLOW_ERROR_TYPE_ITEM,
> > +						   item,
> > +						   "Invalid ESP mask");
> > +					return -rte_errno;
> > +				}
> > +				i40e_flow_set_filter_spi(filter, esp_spec);
> > +				filter->input.flow_ext.customized_pctype =
> true;
> > +				cus_proto = item_type;
> > +			}
> > +			break;
> >  		case RTE_FLOW_ITEM_TYPE_SCTP:
> >  			sctp_spec = item->spec;
> >  			sctp_mask = item->mask;
> > --
> > 2.7.4
> 

Regards,

Bernard.


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

* [dpdk-dev] [PATCH v5 00/14] net/i40e: ESP support
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
@ 2020-01-14 13:55       ` " Bernard Iremonger
  2020-01-15  1:47         ` Zhang, Qi Z
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                         ` (13 subsequent siblings)
  14 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director and RSS.

Changes in V5:
-------------
Rebase to latest master branch
Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch

Changes in V4:
-------------
Add extra patch for testpmd
Add extra patch for config
Split v3 patch "net/i40e: process ESP flows" into 4 patches

Changes in V3:
-------------
Added i40e_flow_set_filter_spi() function in i40e_flow.c
Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
Split flow structures into 4 instead of 2 in i40e_ethdev.h
Dropped extra printf from commandline_flow.c

Changes in V2:
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c


Bernard Iremonger (14):
  app/testpmd: parse flow command line for ESP
  app/testpmd: improve debug
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: support ipsec-ah profile
  net/i40e: support ESP in customised code
  net/i40e: support ESP flows
  net/i40e: support ESP in Flow Director
  config: add debug to I40E Flow Director
  net/i40e: display Flow Director packet
  librte_ethdev: add ESP and AH flow types to RSS
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |   4 +-
 app/test-pmd/util.c                    |   1 +
 config/common_base                     |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 +++
 drivers/net/i40e/i40e_ethdev.c         |  52 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  38 +++++++++
 drivers/net/i40e/i40e_fdir.c           | 138 ++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 135 +++++++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 lib/librte_ethdev/rte_ethdev.h         |  14 +++-
 11 files changed, 377 insertions(+), 22 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 19:03         ` Ferruh Yigit
                           ` (14 more replies)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 02/14] app/testpmd: improve debug Bernard Iremonger
                         ` (12 subsequent siblings)
  14 siblings, 15 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add ITEM_ESP
add ITEM_ESP_SPI

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 4 +---
 app/test-pmd/config.c       | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 9643148..9c6edb8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -6075,9 +6075,6 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
 static void
 cmd_flow_parsed(const struct buffer *in)
 {
-	printf("Flow command line parsed successfully for command=%d.\n",
-			in->command);
-
 	switch (in->command) {
 	case VALIDATE:
 		port_flow_validate(in->port, &in->args.vc.attr,
@@ -6261,6 +6258,7 @@ flow_item_default_mask(const struct rte_flow_item *item)
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
 	case RTE_FLOW_ITEM_TYPE_ESP:
 		mask = &rte_flow_item_esp_mask;
 		break;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2753ec5..d599682 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
+	printf("Caught error type %d (%s): %s%s: %s\n",
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 02/14] app/testpmd: improve debug
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                         ` (11 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 03/14] app/testpmd: dump Rx and Tx mbuf
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (2 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 02/14] app/testpmd: improve debug Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 04/14] net/i40e: improve RSS debug Bernard Iremonger
                         ` (10 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 04/14] net/i40e: improve RSS debug
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (3 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
                         ` (9 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 05/14] net/i40e: handle ESP tunnel
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (4 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 04/14] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
                         ` (8 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 06/14] net/i40e: support ipsec-ah profile
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (5 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code Bernard Iremonger
                         ` (7 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..792a047 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_ipv4_flow ipv4;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_ipv6_flow ipv6;
+	uint32_t spi;	/* SPI in big endian. */
+};
+/* A structure used to define the input for ESP IPV4 UDP flow */
+struct i40e_esp_ipv4_udp_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 UDP flow */
+struct i40e_esp_ipv6_udp_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +549,10 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
+	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
+	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +798,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +928,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1038,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (6 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-15  1:24         ` Zhang, Qi Z
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 08/14] net/i40e: support ESP flows Bernard Iremonger
                         ` (6 subsequent siblings)
  14 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 44 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 08/14] net/i40e: support ESP flows
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (7 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
                         ` (5 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 135 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..c585d8b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 	return I40E_FILTER_PCTYPE_INVALID;
 }
 
+static void
+i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
+	const struct rte_flow_item_esp *esp_spec)
+{
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV4) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv4_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv4_flow.spi =
+				esp_spec->hdr.spi;
+	}
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV6) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv6_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv6_flow.spi =
+				esp_spec->hdr.spi;
+	}
+}
+
 /* 1. Last in item should be NULL as range is not supported.
  * 2. Supported patterns: refer to array i40e_supported_patterns.
  * 3. Default supported flow type and input set: refer to array
@@ -2459,6 +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				i40e_flow_set_filter_spi(filter, esp_spec);
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 09/14] net/i40e: support ESP in Flow Director
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (8 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 08/14] net/i40e: support ESP flows Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 10/14] config: add debug to I40E " Bernard Iremonger
                         ` (4 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 126 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 118 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..5f85703 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -54,6 +54,8 @@
 #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
 #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
 
+#define I40E_FDIR_ESP_DST_PORT              4500
+
 /* Wait time for fdir filter programming */
 #define I40E_FDIR_MAX_WAIT_US 10000
 
@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				udp->dst_port = rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				udp->dst_port =	rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 10/14] config: add debug to I40E Flow Director
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (9 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
@ 2020-01-14 13:55       ` " Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet Bernard Iremonger
                         ` (3 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 config/common_base | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/common_base b/config/common_base
index 7dec7ed..7a76c26 100644
--- a/config/common_base
+++ b/config/common_base
@@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
 CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (10 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 10/14] config: add debug to I40E " Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 18:52         ` Ferruh Yigit
  2020-01-15  0:20         ` Zhang, Qi Z
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
                         ` (2 subsequent siblings)
  14 siblings, 2 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

include rte_config.h in i40e_fdir.c
In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt()
and in i40e_fdir_construct_pkt()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 5f85703..67bb28c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,10 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_config.h>
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+#include <rte_hexdump.h>
+#endif
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
@@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (11 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 18:45         ` Ferruh Yigit
  2020-01-15  0:13         ` Zhang, Qi Z
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 13/14] doc: release note for ESP Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 14/14] doc: update i40e user guide Bernard Iremonger
  14 siblings, 2 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add macros for the following protocols in the DDP esp-ah profile:
ESP
AH

Add the following RSS macro for IPsec:
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..208ec90 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
+#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
+#define RTE_ETH_FLOW_MAX                26
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_AH                 (1ULL << 24)
+#define ETH_RSS_ESP                (1ULL << 25)
+
+
+
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 13/14] doc: release note for ESP
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (12 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 14/14] doc: update i40e user guide Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH v5 14/14] doc: update i40e user guide
  2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
                         ` (13 preceding siblings ...)
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 13/14] doc: release note for ESP Bernard Iremonger
@ 2020-01-14 13:55       ` Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-14 13:55 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
@ 2020-01-14 18:45         ` Ferruh Yigit
  2020-01-15  9:13           ` Andrew Rybchenko
  2020-01-15  0:13         ` Zhang, Qi Z
  1 sibling, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-14 18:45 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Ori Kam,
	Thomas Monjalon, Andrew Rybchenko

On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> Add macros for the following protocols in the DDP esp-ah profile:
> ESP
> AH
> 
> Add the following RSS macro for IPsec:
> ETH_RSS_IPSEC
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

+Ori and other ethdev maintainers.

Ori, can you please check this patch?

> ---
>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 18a9def..208ec90 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
> -#define RTE_ETH_FLOW_MAX                24
> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
> +#define RTE_ETH_FLOW_MAX                26
>  
>  /*
>   * Below macros are defined for RSS offload types, they can be used to
> @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
>  #define ETH_RSS_GTPU               (1ULL << 23)
> +#define ETH_RSS_AH                 (1ULL << 24)
> +#define ETH_RSS_ESP                (1ULL << 25)
> +
> +
> +
> +
>  
>  /*
>   * We use the following macros to combine with above ETH_RSS_* for
> @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>  	ETH_RSS_NONFRAG_IPV6_SCTP)
>  
> +#define ETH_RSS_IPSEC ( \
> +	ETH_RSS_AH | \
> +	ETH_RSS_ESP)
> +
>  #define ETH_RSS_TUNNEL ( \
>  	ETH_RSS_VXLAN  | \
>  	ETH_RSS_GENEVE | \
> 


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-14 18:52         ` Ferruh Yigit
  2020-01-15  9:18           ` Iremonger, Bernard
  2020-01-15  0:20         ` Zhang, Qi Z
  1 sibling, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-14 18:52 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> include rte_config.h in i40e_fdir.c
> In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt()
> and in i40e_fdir_construct_pkt()
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> index 5f85703..67bb28c 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -21,6 +21,10 @@
>  #include <rte_tcp.h>
>  #include <rte_sctp.h>
>  #include <rte_hash_crc.h>
> +#include <rte_config.h>
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> +#include <rte_hexdump.h>
> +#endif
>  
>  #include "i40e_logs.h"
>  #include "base/i40e_type.h"
> @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> +	rte_hexdump(stdout, NULL, raw_pkt, len);
> +#endif
>  	return 0;
>  }
>  
> @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> +	rte_hexdump(stdout, NULL, raw_pkt, len);
> +#endif
>  	return 0;
>  }
>  
> 

Hi Bernard,

These are not data path functions, right? If so instead of adding new config
option, can we add dynamic debugging for it?

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

* Re: [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-14 19:03         ` Ferruh Yigit
  2020-01-15  9:08           ` Iremonger, Bernard
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                           ` (13 subsequent siblings)
  14 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-14 19:03 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> add ITEM_ESP
> add ITEM_ESP_SPI
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> Acked-by: Ori Kam <orika@mellanox.com>
> ---
>  app/test-pmd/cmdline_flow.c | 4 +---
>  app/test-pmd/config.c       | 2 +-
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 9643148..9c6edb8 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -6075,9 +6075,6 @@ cmd_flow_tok(cmdline_parse_token_hdr_t **hdr,
>  static void
>  cmd_flow_parsed(const struct buffer *in)
>  {
> -	printf("Flow command line parsed successfully for command=%d.\n",
> -			in->command);
> -

Hi Bernard,

Is this patchset depends another, or can there be something went wrong here, I
can't find these lines removed also it is not really clear what this patchset does.

>  	switch (in->command) {
>  	case VALIDATE:
>  		port_flow_validate(in->port, &in->args.vc.attr,
> @@ -6261,6 +6258,7 @@ flow_item_default_mask(const struct rte_flow_item *item)
>  		break;
>  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
>  		mask = &rte_flow_item_pppoe_proto_id_mask;
> +		break;
>  	case RTE_FLOW_ITEM_TYPE_ESP:
>  		mask = &rte_flow_item_esp_mask;
>  		break;
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 2753ec5..d599682 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
>  		errstr = "unknown type";
>  	else
>  		errstr = errstrlist[error->type];
> -	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
> +	printf("Caught error type %d (%s): %s%s: %s\n",
>  	       error->type, errstr,
>  	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
>  					error->cause), buf) : "",
> 


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
  2020-01-14 18:45         ` Ferruh Yigit
@ 2020-01-15  0:13         ` Zhang, Qi Z
  2020-01-15  9:41           ` Iremonger, Bernard
  1 sibling, 1 reply; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-15  0:13 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Tuesday, January 14, 2020 9:55 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
> 
> Add macros for the following protocols in the DDP esp-ah profile:
> ESP
> AH
> 
> Add the following RSS macro for IPsec:
> ETH_RSS_IPSEC
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 18a9def..208ec90 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol
> based flow */
>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE
> protocol based flow */
>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol
> based flow */
> -#define RTE_ETH_FLOW_MAX                24
> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based
> flow */
> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based
> flow */
> +#define RTE_ETH_FLOW_MAX                26
> 
>  /*
>   * Below macros are defined for RSS offload types, they can be used to @@
> -511,6 +513,12 @@ struct rte_eth_rss_conf {
>  #define ETH_RSS_GENEVE             (1ULL << 20)
>  #define ETH_RSS_NVGRE              (1ULL << 21)
>  #define ETH_RSS_GTPU               (1ULL << 23)
> +#define ETH_RSS_AH                 (1ULL << 24)
> +#define ETH_RSS_ESP                (1ULL << 25)
> +
> +
> +
> +

Empty lines need to be removed

Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>

> 
>  /*
>   * We use the following macros to combine with above ETH_RSS_* for @@
> -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>  	ETH_RSS_NONFRAG_IPV6_SCTP)
> 
> +#define ETH_RSS_IPSEC ( \
> +	ETH_RSS_AH | \
> +	ETH_RSS_ESP)
> +
>  #define ETH_RSS_TUNNEL ( \
>  	ETH_RSS_VXLAN  | \
>  	ETH_RSS_GENEVE | \
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet Bernard Iremonger
  2020-01-14 18:52         ` Ferruh Yigit
@ 2020-01-15  0:20         ` Zhang, Qi Z
  2020-01-15  1:32           ` Zhang, Qi Z
  2020-01-15  9:25           ` Iremonger, Bernard
  1 sibling, 2 replies; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-15  0:20 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Tuesday, January 14, 2020 9:55 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v5 11/14] net/i40e: display Flow Director packet
> 
> include rte_config.h in i40e_fdir.c
> In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and in
> i40e_fdir_construct_pkt()
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index
> 5f85703..67bb28c 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -21,6 +21,10 @@
>  #include <rte_tcp.h>
>  #include <rte_sctp.h>
>  #include <rte_hash_crc.h>
> +#include <rte_config.h>
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD

Seems RTE_LIBRTE_I40E_DEBUG_FD need to be defined in config/common_base
Like RTE_LIBRTE_I40E_DEBUG_RX

> +#include <rte_hexdump.h>
> +#endif
> 
>  #include "i40e_logs.h"
>  #include "base/i40e_type.h"
> @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
>  	return 0;
>  }
> 
> @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>  				 &fdir_input->flow_ext.flexbytes[dst],
>  				 size * sizeof(uint16_t));
>  	}
> -
> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
>  	return 0;
>  }
> 
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code Bernard Iremonger
@ 2020-01-15  1:24         ` Zhang, Qi Z
  0 siblings, 0 replies; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-15  1:24 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Tuesday, January 14, 2020 9:55 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v5 07/14] net/i40e: support ESP in customised code

s/customised/customized 
> 
> update customized code for ESP
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>



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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-15  0:20         ` Zhang, Qi Z
@ 2020-01-15  1:32           ` Zhang, Qi Z
  2020-01-15  9:25           ` Iremonger, Bernard
  1 sibling, 0 replies; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-15  1:32 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Wednesday, January 15, 2020 8:20 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org; Xing,
> Beilei <beilei.xing@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: RE: [PATCH v5 11/14] net/i40e: display Flow Director packet
> 
> 
> 
> > -----Original Message-----
> > From: Iremonger, Bernard <bernard.iremonger@intel.com>
> > Sent: Tuesday, January 14, 2020 9:55 PM
> > To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> > Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne,
> > Stephen1 <stephen1.byrne@intel.com>; Zhang, Helin
> > <helin.zhang@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Subject: [PATCH v5 11/14] net/i40e: display Flow Director packet
> >
> > include rte_config.h in i40e_fdir.c
> > In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and
> > in
> > i40e_fdir_construct_pkt()
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_fdir.c
> > b/drivers/net/i40e/i40e_fdir.c index 5f85703..67bb28c 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -21,6 +21,10 @@
> >  #include <rte_tcp.h>
> >  #include <rte_sctp.h>
> >  #include <rte_hash_crc.h>
> > +#include <rte_config.h>
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> 
> Seems RTE_LIBRTE_I40E_DEBUG_FD need to be defined in
> config/common_base Like RTE_LIBRTE_I40E_DEBUG_RX

Sorry, didn't see its already in patch 10/14
So
Acked-by: Qi Zhang <qi.z.zhang@intel.com>


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

* Re: [dpdk-dev] [PATCH v5 00/14] net/i40e: ESP support
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
@ 2020-01-15  1:47         ` Zhang, Qi Z
  0 siblings, 0 replies; 134+ messages in thread
From: Zhang, Qi Z @ 2020-01-15  1:47 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin



> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Tuesday, January 14, 2020 9:55 PM
> To: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v5 00/14] net/i40e: ESP support
> 
> Add support for ESP flows to testpmd.
> Improve debug information in testpmd and the i40e PMD.
> Process ESP flows on the i40e Flow Director and RSS.
> 
> Changes in V5:
> -------------
> Rebase to latest master branch
> Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch
> 
> Changes in V4:
> -------------
> Add extra patch for testpmd
> Add extra patch for config
> Split v3 patch "net/i40e: process ESP flows" into 4 patches
> 
> Changes in V3:
> -------------
> Added i40e_flow_set_filter_spi() function in i40e_flow.c Set UDP destination
> port to 4500 for ESP  in i40e_ethdev.h Split flow structures into 4 instead of 2
> in i40e_ethdev.h Dropped extra printf from commandline_flow.c
> 
> Changes in V2:
> --------------
> Moved change in app/test-pmd/config.c to a seperate patch.
> Added extra parameter to fill_ip6_head() in i40e_fdir.c set is_udp to false in
> i40e_flow_fdir_get_pctype_value() in i40e_flow.c
> 
> 
> Bernard Iremonger (14):
>   app/testpmd: parse flow command line for ESP
>   app/testpmd: improve debug
>   app/testpmd: dump Rx and Tx mbuf
>   net/i40e: improve RSS debug
>   net/i40e: handle ESP tunnel
>   net/i40e: support ipsec-ah profile
>   net/i40e: support ESP in customised code
>   net/i40e: support ESP flows
>   net/i40e: support ESP in Flow Director
>   config: add debug to I40E Flow Director
>   net/i40e: display Flow Director packet
>   librte_ethdev: add ESP and AH flow types to RSS
>   doc: release note for ESP
>   doc: update i40e user guide
> 
>  app/test-pmd/cmdline_flow.c            |   4 +-
>  app/test-pmd/util.c                    |   1 +
>  config/common_base                     |   1 +
>  doc/guides/nics/i40e.rst               |   4 +-
>  doc/guides/rel_notes/release_20_02.rst |   9 +++
>  drivers/net/i40e/i40e_ethdev.c         |  52 ++++++++++++-
>  drivers/net/i40e/i40e_ethdev.h         |  38 +++++++++
>  drivers/net/i40e/i40e_fdir.c           | 138
> ++++++++++++++++++++++++++++++---
>  drivers/net/i40e/i40e_flow.c           | 135
> +++++++++++++++++++++++++++++++-
>  drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
>  lib/librte_ethdev/rte_ethdev.h         |  14 +++-
>  11 files changed, 377 insertions(+), 22 deletions(-)
> 
> --
> 2.7.4

For patch 4/14 - patch 14/14

Except minor capture on patch 7/14 and patch 12/14

Acked-by: Qi Zhang <qi.z.zhang@intel.com>


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

* Re: [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP
  2020-01-14 19:03         ` Ferruh Yigit
@ 2020-01-15  9:08           ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15  9:08 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi  Ferruh,



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, January 14, 2020 7:04 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow
> command line for ESP
> 
> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> > add ITEM_ESP
> > add ITEM_ESP_SPI
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > Acked-by: Ori Kam <orika@mellanox.com>
> > ---
> >  app/test-pmd/cmdline_flow.c | 4 +---
> >  app/test-pmd/config.c       | 2 +-
> >  2 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 9643148..9c6edb8 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -6075,9 +6075,6 @@ cmd_flow_tok(cmdline_parse_token_hdr_t
> **hdr,
> > static void  cmd_flow_parsed(const struct buffer *in)  {
> > -	printf("Flow command line parsed successfully for
> command=%d.\n",
> > -			in->command);
> > -
> 
> Hi Bernard,
> 
> Is this patchset depends another, or can there be something went wrong
> here, I can't find these lines removed also it is not really clear what this
> patchset does.

Something has gone wrong here. 
I will investigate.
 
> 
> >  	switch (in->command) {
> >  	case VALIDATE:
> >  		port_flow_validate(in->port, &in->args.vc.attr, @@ -6261,6
> +6258,7
> > @@ flow_item_default_mask(const struct rte_flow_item *item)
> >  		break;
> >  	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
> >  		mask = &rte_flow_item_pppoe_proto_id_mask;
> > +		break;
> >  	case RTE_FLOW_ITEM_TYPE_ESP:
> >  		mask = &rte_flow_item_esp_mask;
> >  		break;
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> > 2753ec5..d599682 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error
> *error)
> >  		errstr = "unknown type";
> >  	else
> >  		errstr = errstrlist[error->type];
> > -	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n",
> __func__,
> > +	printf("Caught error type %d (%s): %s%s: %s\n",
> >  	       error->type, errstr,
> >  	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
> >  					error->cause), buf) : "",
> >

Regards,

Bernard


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-14 18:45         ` Ferruh Yigit
@ 2020-01-15  9:13           ` Andrew Rybchenko
  2020-01-15 10:44             ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Andrew Rybchenko @ 2020-01-15  9:13 UTC (permalink / raw)
  To: Ferruh Yigit, Bernard Iremonger, dev, beilei.xing, qi.z.zhang,
	declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Ori Kam,
	Thomas Monjalon, Andrew Rybchenko

On 1/14/20 9:45 PM, Ferruh Yigit wrote:
> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>> Add macros for the following protocols in the DDP esp-ah profile:
>> ESP
>> AH
>>
>> Add the following RSS macro for IPsec:
>> ETH_RSS_IPSEC
>>
>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> +Ori and other ethdev maintainers.
> 
> Ori, can you please check this patch?
> 
>> ---
>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>> index 18a9def..208ec90 100644
>> --- a/lib/librte_ethdev/rte_ethdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev.h
>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
>> -#define RTE_ETH_FLOW_MAX                24
>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
>> +#define RTE_ETH_FLOW_MAX                26

Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
Is v20.11 target release of the patch?

>>  
>>  /*
>>   * Below macros are defined for RSS offload types, they can be used to
>> @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>>  #define ETH_RSS_GENEVE             (1ULL << 20)
>>  #define ETH_RSS_NVGRE              (1ULL << 21)
>>  #define ETH_RSS_GTPU               (1ULL << 23)
>> +#define ETH_RSS_AH                 (1ULL << 24)
>> +#define ETH_RSS_ESP                (1ULL << 25)
>> +
>> +
>> +
>> +
>>  
>>  /*
>>   * We use the following macros to combine with above ETH_RSS_* for
>> @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>>  	ETH_RSS_NONFRAG_IPV6_SCTP)
>>  
>> +#define ETH_RSS_IPSEC ( \
>> +	ETH_RSS_AH | \
>> +	ETH_RSS_ESP)
>> +
>>  #define ETH_RSS_TUNNEL ( \
>>  	ETH_RSS_VXLAN  | \
>>  	ETH_RSS_GENEVE | \
>>


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-14 18:52         ` Ferruh Yigit
@ 2020-01-15  9:18           ` Iremonger, Bernard
  2020-01-15 10:58             ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15  9:18 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, January 14, 2020 6:53 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director
> packet
> 
> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> > include rte_config.h in i40e_fdir.c
> > In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and
> > in i40e_fdir_construct_pkt()
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_fdir.c
> > b/drivers/net/i40e/i40e_fdir.c index 5f85703..67bb28c 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -21,6 +21,10 @@
> >  #include <rte_tcp.h>
> >  #include <rte_sctp.h>
> >  #include <rte_hash_crc.h>
> > +#include <rte_config.h>
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> > +#include <rte_hexdump.h>
> > +#endif
> >
> >  #include "i40e_logs.h"
> >  #include "base/i40e_type.h"
> > @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> > +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >  	return 0;
> >  }
> >
> > @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> > +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >  	return 0;
> >  }
> >
> >
> 
> Hi Bernard,
> 
> These are not data path functions, right?
This code is only used when adding flow rules,  so not in data path.

 If so instead of adding new config option, can we add dynamic debugging for it?
Adding new config option seems ok to me,  why change to dynamic debugging?

Regards,

Bernard 


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-15  0:20         ` Zhang, Qi Z
  2020-01-15  1:32           ` Zhang, Qi Z
@ 2020-01-15  9:25           ` Iremonger, Bernard
  1 sibling, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15  9:25 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,

<snip>

> > Subject: [PATCH v5 11/14] net/i40e: display Flow Director packet
> >
> > include rte_config.h in i40e_fdir.c
> > In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and
> > in
> > i40e_fdir_construct_pkt()
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_fdir.c
> > b/drivers/net/i40e/i40e_fdir.c index 5f85703..67bb28c 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -21,6 +21,10 @@
> >  #include <rte_tcp.h>
> >  #include <rte_sctp.h>
> >  #include <rte_hash_crc.h>
> > +#include <rte_config.h>
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> 
> Seems RTE_LIBRTE_I40E_DEBUG_FD need to be defined in
> config/common_base Like RTE_LIBRTE_I40E_DEBUG_RX

It is defined in config/common_base in previous patch 
[v5,10/14] config: add debug to I40E Flow Director

Maybe patches 10 and 11 should be squashed

> 
> > +#include <rte_hexdump.h>
> > +#endif
> >
> >  #include "i40e_logs.h"
> >  #include "base/i40e_type.h"
> > @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> > +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >  	return 0;
> >  }
> >
> > @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
> >  				 &fdir_input->flow_ext.flexbytes[dst],
> >  				 size * sizeof(uint16_t));
> >  	}
> > -
> > +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> > +	rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >  	return 0;
> >  }
> >
> > --
> > 2.7.4
> 
Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15  0:13         ` Zhang, Qi Z
@ 2020-01-15  9:41           ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15  9:41 UTC (permalink / raw)
  To: Zhang, Qi Z, dev, Xing, Beilei, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Qi,

<snip>

> > Subject: [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to
> > RSS
> >
> > Add macros for the following protocols in the DDP esp-ah profile:
> > ESP
> > AH
> >
> > Add the following RSS macro for IPsec:
> > ETH_RSS_IPSEC
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > b/lib/librte_ethdev/rte_ethdev.h index 18a9def..208ec90 100644
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
> >  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol
> > based flow */
> >  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE
> > protocol based flow */
> >  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol
> > based flow */
> > -#define RTE_ETH_FLOW_MAX                24
> > +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based
> > flow */
> > +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based
> > flow */
> > +#define RTE_ETH_FLOW_MAX                26
> >
> >  /*
> >   * Below macros are defined for RSS offload types, they can be used
> > to @@
> > -511,6 +513,12 @@ struct rte_eth_rss_conf {
> >  #define ETH_RSS_GENEVE             (1ULL << 20)
> >  #define ETH_RSS_NVGRE              (1ULL << 21)
> >  #define ETH_RSS_GTPU               (1ULL << 23)
> > +#define ETH_RSS_AH                 (1ULL << 24)
> > +#define ETH_RSS_ESP                (1ULL << 25)
> > +
> > +
> > +
> > +
> 
> Empty lines need to be removed
> 
> Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>

I will remove in v6 patch.
Can I carry forward your Reviewed-by:  ?
 
> >
> >  /*
> >   * We use the following macros to combine with above ETH_RSS_* for @@
> > -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
> >  	ETH_RSS_NONFRAG_IPV4_SCTP | \
> >  	ETH_RSS_NONFRAG_IPV6_SCTP)
> >
> > +#define ETH_RSS_IPSEC ( \
> > +	ETH_RSS_AH | \
> > +	ETH_RSS_ESP)
> > +
> >  #define ETH_RSS_TUNNEL ( \
> >  	ETH_RSS_VXLAN  | \
> >  	ETH_RSS_GENEVE | \
> > --
> > 2.7.4
> 
Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15  9:13           ` Andrew Rybchenko
@ 2020-01-15 10:44             ` Ferruh Yigit
  2020-01-15 10:55               ` Andrew Rybchenko
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 10:44 UTC (permalink / raw)
  To: Andrew Rybchenko, Bernard Iremonger, dev, beilei.xing,
	qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Ori Kam,
	Thomas Monjalon

On 1/15/2020 9:13 AM, Andrew Rybchenko wrote:
> On 1/14/20 9:45 PM, Ferruh Yigit wrote:
>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>>> Add macros for the following protocols in the DDP esp-ah profile:
>>> ESP
>>> AH
>>>
>>> Add the following RSS macro for IPsec:
>>> ETH_RSS_IPSEC
>>>
>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>
>> +Ori and other ethdev maintainers.
>>
>> Ori, can you please check this patch?
>>
>>> ---
>>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>> index 18a9def..208ec90 100644
>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
>>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
>>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
>>> -#define RTE_ETH_FLOW_MAX                24
>>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
>>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
>>> +#define RTE_ETH_FLOW_MAX                26
> 
> Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
> Is v20.11 target release of the patch?

I can't see how this can cause an ABI break, unless the 'RTE_ETH_FLOW_MAX' value
used as size of an array in the middle of a struct.
There is 'struct rte_eth_fdir_flex_conf' but the array is at the end there, so
it should be OK, unless that struct is not in the middle of another struct.

And there are values calculated from 'RTE_ETH_FLOW_MAX', like
'RTE_FLOW_MASK_ARRAY_SIZE', same concern applies there, it very hard to follow.

Bernard,

Can you please run the ABI version script to be sure this is not breaking the ABI?


> 
>>>  
>>>  /*
>>>   * Below macros are defined for RSS offload types, they can be used to
>>> @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>>>  #define ETH_RSS_GENEVE             (1ULL << 20)
>>>  #define ETH_RSS_NVGRE              (1ULL << 21)
>>>  #define ETH_RSS_GTPU               (1ULL << 23)
>>> +#define ETH_RSS_AH                 (1ULL << 24)
>>> +#define ETH_RSS_ESP                (1ULL << 25)
>>> +
>>> +
>>> +
>>> +
>>>  
>>>  /*
>>>   * We use the following macros to combine with above ETH_RSS_* for
>>> @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>>>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>>>  	ETH_RSS_NONFRAG_IPV6_SCTP)
>>>  
>>> +#define ETH_RSS_IPSEC ( \
>>> +	ETH_RSS_AH | \
>>> +	ETH_RSS_ESP)
>>> +
>>>  #define ETH_RSS_TUNNEL ( \
>>>  	ETH_RSS_VXLAN  | \
>>>  	ETH_RSS_GENEVE | \
>>>
> 


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15 10:44             ` Ferruh Yigit
@ 2020-01-15 10:55               ` Andrew Rybchenko
  2020-01-15 12:28                 ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Andrew Rybchenko @ 2020-01-15 10:55 UTC (permalink / raw)
  To: Ferruh Yigit, Bernard Iremonger, dev, beilei.xing, qi.z.zhang,
	declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Ori Kam,
	Thomas Monjalon

On 1/15/20 1:44 PM, Ferruh Yigit wrote:
> On 1/15/2020 9:13 AM, Andrew Rybchenko wrote:
>> On 1/14/20 9:45 PM, Ferruh Yigit wrote:
>>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>>>> Add macros for the following protocols in the DDP esp-ah profile:
>>>> ESP
>>>> AH
>>>>
>>>> Add the following RSS macro for IPsec:
>>>> ETH_RSS_IPSEC
>>>>
>>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>> +Ori and other ethdev maintainers.
>>>
>>> Ori, can you please check this patch?
>>>
>>>> ---
>>>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>>>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>>> index 18a9def..208ec90 100644
>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>>>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
>>>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
>>>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
>>>> -#define RTE_ETH_FLOW_MAX                24
>>>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
>>>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
>>>> +#define RTE_ETH_FLOW_MAX                26
>> Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
>> Is v20.11 target release of the patch?
> I can't see how this can cause an ABI break, unless the 'RTE_ETH_FLOW_MAX' value
> used as size of an array in the middle of a struct.
> There is 'struct rte_eth_fdir_flex_conf' but the array is at the end there, so
> it should be OK, unless that struct is not in the middle of another struct.

rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)

> And there are values calculated from 'RTE_ETH_FLOW_MAX', like
> 'RTE_FLOW_MASK_ARRAY_SIZE', same concern applies there, it very hard to follow.
>
> Bernard,
>
> Can you please run the ABI version script to be sure this is not breaking the ABI?
>
>
>>>>  
>>>>  /*
>>>>   * Below macros are defined for RSS offload types, they can be used to
>>>> @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>>>>  #define ETH_RSS_GENEVE             (1ULL << 20)
>>>>  #define ETH_RSS_NVGRE              (1ULL << 21)
>>>>  #define ETH_RSS_GTPU               (1ULL << 23)
>>>> +#define ETH_RSS_AH                 (1ULL << 24)
>>>> +#define ETH_RSS_ESP                (1ULL << 25)
>>>> +
>>>> +
>>>> +
>>>> +
>>>>  
>>>>  /*
>>>>   * We use the following macros to combine with above ETH_RSS_* for
>>>> @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>>>>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>>>>  	ETH_RSS_NONFRAG_IPV6_SCTP)
>>>>  
>>>> +#define ETH_RSS_IPSEC ( \
>>>> +	ETH_RSS_AH | \
>>>> +	ETH_RSS_ESP)
>>>> +
>>>>  #define ETH_RSS_TUNNEL ( \
>>>>  	ETH_RSS_VXLAN  | \
>>>>  	ETH_RSS_GENEVE | \
>>>>


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-15  9:18           ` Iremonger, Bernard
@ 2020-01-15 10:58             ` Ferruh Yigit
  2020-01-15 15:08               ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 10:58 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

On 1/15/2020 9:18 AM, Iremonger, Bernard wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>> Sent: Tuesday, January 14, 2020 6:53 PM
>> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
>> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Doherty, Declan <declan.doherty@intel.com>
>> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
>> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director
>> packet
>>
>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>>> include rte_config.h in i40e_fdir.c
>>> In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and
>>> in i40e_fdir_construct_pkt()
>>>
>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>> ---
>>>  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
>>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/i40e/i40e_fdir.c
>>> b/drivers/net/i40e/i40e_fdir.c index 5f85703..67bb28c 100644
>>> --- a/drivers/net/i40e/i40e_fdir.c
>>> +++ b/drivers/net/i40e/i40e_fdir.c
>>> @@ -21,6 +21,10 @@
>>>  #include <rte_tcp.h>
>>>  #include <rte_sctp.h>
>>>  #include <rte_hash_crc.h>
>>> +#include <rte_config.h>
>>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
>>> +#include <rte_hexdump.h>
>>> +#endif
>>>
>>>  #include "i40e_logs.h"
>>>  #include "base/i40e_type.h"
>>> @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
>>>   &fdir_input->flow_ext.flexbytes[dst],
>>>   size * sizeof(uint16_t));
>>>  }
>>> -
>>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
>>> +rte_hexdump(stdout, NULL, raw_pkt, len); #endif
>>>  return 0;
>>>  }
>>>
>>> @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
>>>   &fdir_input->flow_ext.flexbytes[dst],
>>>   size * sizeof(uint16_t));
>>>  }
>>> -
>>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
>>> +rte_hexdump(stdout, NULL, raw_pkt, len); #endif
>>>  return 0;
>>>  }
>>>
>>>
>>
>> Hi Bernard,
>>
>> These are not data path functions, right?
> This code is only used when adding flow rules,  so not in data path.
> 
>  If so instead of adding new config option, can we add dynamic debugging for it?
> Adding new config option seems ok to me,  why change to dynamic debugging?
> 

Compile time options are OK for developer but bad for deployment, when you are
deploying your product you have to disable this config option, and on the target
platform there if a problem occurs there won't be any way to enable the debug to
see what is happening.
So it is useful only on the machine that you are both compiling and running
application, even that case it is a trouble to terminate application, re-compile
it and run again, most probably same loop again to turn off the debug back.

Also it is bad for testing, if you want to do the all code path, someone needs
to test both enabling and disabling this config option. If not, it is possible
by time enabling this config option even won't compile and nobody will detect it.

Since we already have dynamic log support, why not add a new logtype, lets say
"pmd.net.i40e.fd" and have ability to enable/disable it without terminating app?



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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15 10:55               ` Andrew Rybchenko
@ 2020-01-15 12:28                 ` Ferruh Yigit
  2020-01-15 14:11                   ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 12:28 UTC (permalink / raw)
  To: Andrew Rybchenko, Bernard Iremonger, dev, beilei.xing,
	qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Ori Kam,
	Thomas Monjalon, Bruce Richardson, Kinsella, Ray, David Marchand,
	Luca Boccassi, Jerin Jacob, Olivier MATZ

On 1/15/2020 10:55 AM, Andrew Rybchenko wrote:
> On 1/15/20 1:44 PM, Ferruh Yigit wrote:
>> On 1/15/2020 9:13 AM, Andrew Rybchenko wrote:
>>> On 1/14/20 9:45 PM, Ferruh Yigit wrote:
>>>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>>>>> Add macros for the following protocols in the DDP esp-ah profile:
>>>>> ESP
>>>>> AH
>>>>>
>>>>> Add the following RSS macro for IPsec:
>>>>> ETH_RSS_IPSEC
>>>>>
>>>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>>> +Ori and other ethdev maintainers.
>>>>
>>>> Ori, can you please check this patch?
>>>>
>>>>> ---
>>>>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>>>>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
>>>>> index 18a9def..208ec90 100644
>>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>>>>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
>>>>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
>>>>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
>>>>> -#define RTE_ETH_FLOW_MAX                24
>>>>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow */
>>>>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based flow */
>>>>> +#define RTE_ETH_FLOW_MAX                26
>>> Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
>>> Is v20.11 target release of the patch?
>> I can't see how this can cause an ABI break, unless the 'RTE_ETH_FLOW_MAX' value
>> used as size of an array in the middle of a struct.
>> There is 'struct rte_eth_fdir_flex_conf' but the array is at the end there, so
>> it should be OK, unless that struct is not in the middle of another struct.
> 
> rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the middle)

Yes, this looks like an ABI break and this is very annoying not able to even add
a new RTE_FLOW type.

We need to find a proper way to handle this, at first glance I can see stop
using _MAX macros for the array size can work and perhaps we can use another big
enough hardcoded value for all similar array size. Any other option?

But we can do this on 20.11, we need a solution until that time.

> 
>> And there are values calculated from 'RTE_ETH_FLOW_MAX', like
>> 'RTE_FLOW_MASK_ARRAY_SIZE', same concern applies there, it very hard to follow.
>>
>> Bernard,
>>
>> Can you please run the ABI version script to be sure this is not breaking the ABI?
>>
>>
>>>>>  
>>>>>  /*
>>>>>   * Below macros are defined for RSS offload types, they can be used to
>>>>> @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>>>>>  #define ETH_RSS_GENEVE             (1ULL << 20)
>>>>>  #define ETH_RSS_NVGRE              (1ULL << 21)
>>>>>  #define ETH_RSS_GTPU               (1ULL << 23)
>>>>> +#define ETH_RSS_AH                 (1ULL << 24)
>>>>> +#define ETH_RSS_ESP                (1ULL << 25)
>>>>> +
>>>>> +
>>>>> +
>>>>> +
>>>>>  
>>>>>  /*
>>>>>   * We use the following macros to combine with above ETH_RSS_* for
>>>>> @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>>>>>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
>>>>>  	ETH_RSS_NONFRAG_IPV6_SCTP)
>>>>>  
>>>>> +#define ETH_RSS_IPSEC ( \
>>>>> +	ETH_RSS_AH | \
>>>>> +	ETH_RSS_ESP)
>>>>> +
>>>>>  #define ETH_RSS_TUNNEL ( \
>>>>>  	ETH_RSS_VXLAN  | \
>>>>>  	ETH_RSS_GENEVE | \
>>>>>
> 


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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15 12:28                 ` Ferruh Yigit
@ 2020-01-15 14:11                   ` Iremonger, Bernard
  2020-01-15 14:36                     ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15 14:11 UTC (permalink / raw)
  To: Yigit, Ferruh, Andrew Rybchenko, dev, Xing, Beilei, Zhang, Qi Z,
	Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin, Ori Kam,
	Thomas Monjalon, Richardson, Bruce, Kinsella, Ray,
	David Marchand, Luca Boccassi, Jerin Jacob, Olivier MATZ

Hi Ferruh,

<snip>

> Subject: Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH
> flow types to RSS
> 
> On 1/15/2020 10:55 AM, Andrew Rybchenko wrote:
> > On 1/15/20 1:44 PM, Ferruh Yigit wrote:
> >> On 1/15/2020 9:13 AM, Andrew Rybchenko wrote:
> >>> On 1/14/20 9:45 PM, Ferruh Yigit wrote:
> >>>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> >>>>> Add macros for the following protocols in the DDP esp-ah profile:
> >>>>> ESP
> >>>>> AH
> >>>>>
> >>>>> Add the following RSS macro for IPsec:
> >>>>> ETH_RSS_IPSEC
> >>>>>
> >>>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> >>>> +Ori and other ethdev maintainers.
> >>>>
> >>>> Ori, can you please check this patch?
> >>>>
> >>>>> ---
> >>>>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
> >>>>>  1 file changed, 13 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h
> >>>>> b/lib/librte_ethdev/rte_ethdev.h index 18a9def..208ec90 100644
> >>>>> --- a/lib/librte_ethdev/rte_ethdev.h
> >>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
> >>>>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
> >>>>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol
> based flow */
> >>>>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE
> protocol based flow */
> >>>>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based
> flow */
> >>>>> -#define RTE_ETH_FLOW_MAX                24
> >>>>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow
> */
> >>>>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based
> flow */
> >>>>> +#define RTE_ETH_FLOW_MAX                26
> >>> Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
> >>> Is v20.11 target release of the patch?
> >> I can't see how this can cause an ABI break, unless the
> >> 'RTE_ETH_FLOW_MAX' value used as size of an array in the middle of a
> struct.
> >> There is 'struct rte_eth_fdir_flex_conf' but the array is at the end
> >> there, so it should be OK, unless that struct is not in the middle of another
> struct.
> >
> > rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the
> > middle)
> 
> Yes, this looks like an ABI break and this is very annoying not able to even add
> a new RTE_FLOW type.
> 
> We need to find a proper way to handle this, at first glance I can see stop
> using _MAX macros for the array size can work and perhaps we can use
> another big enough hardcoded value for all similar array size. Any other
> option?
> 
> But we can do this on 20.11, we need a solution until that time.

This patch is required to handle RSS for the esp-ah.pkg DDP profile, it does not affect the i40e FD and testpmd changes in this patch set.
The esp-ah.pkg DDP profile is not released yet.

Given that the merge deadline is today, I propose to drop this patch from the v6 patch set.

> 
> >
> >> And there are values calculated from 'RTE_ETH_FLOW_MAX', like
> >> 'RTE_FLOW_MASK_ARRAY_SIZE', same concern applies there, it very hard
> to follow.
> >>
> >> Bernard,
> >>
> >> Can you please run the ABI version script to be sure this is not breaking
> the ABI?
> >>
> >>
> >>>>>
> >>>>>  /*
> >>>>>   * Below macros are defined for RSS offload types, they can be
> >>>>> used to @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
> >>>>>  #define ETH_RSS_GENEVE             (1ULL << 20)
> >>>>>  #define ETH_RSS_NVGRE              (1ULL << 21)
> >>>>>  #define ETH_RSS_GTPU               (1ULL << 23)
> >>>>> +#define ETH_RSS_AH                 (1ULL << 24)
> >>>>> +#define ETH_RSS_ESP                (1ULL << 25)
> >>>>> +
> >>>>> +
> >>>>> +
> >>>>> +
> >>>>>
> >>>>>  /*
> >>>>>   * We use the following macros to combine with above ETH_RSS_*
> >>>>> for @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
> >>>>>  	ETH_RSS_NONFRAG_IPV4_SCTP | \
> >>>>>  	ETH_RSS_NONFRAG_IPV6_SCTP)
> >>>>>
> >>>>> +#define ETH_RSS_IPSEC ( \
> >>>>> +	ETH_RSS_AH | \
> >>>>> +	ETH_RSS_ESP)
> >>>>> +
> >>>>>  #define ETH_RSS_TUNNEL ( \
> >>>>>  	ETH_RSS_VXLAN  | \
> >>>>>  	ETH_RSS_GENEVE | \
> >>>>>
> >
Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS
  2020-01-15 14:11                   ` Iremonger, Bernard
@ 2020-01-15 14:36                     ` Ferruh Yigit
  0 siblings, 0 replies; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 14:36 UTC (permalink / raw)
  To: Iremonger, Bernard, Andrew Rybchenko, dev, Xing, Beilei, Zhang,
	Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin, Ori Kam,
	Thomas Monjalon, Richardson, Bruce, Kinsella, Ray,
	David Marchand, Luca Boccassi, Jerin Jacob, Olivier MATZ

On 1/15/2020 2:11 PM, Iremonger, Bernard wrote:
> Hi Ferruh,
> 
> <snip>
> 
>> Subject: Re: [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH
>> flow types to RSS
>>
>> On 1/15/2020 10:55 AM, Andrew Rybchenko wrote:
>>> On 1/15/20 1:44 PM, Ferruh Yigit wrote:
>>>> On 1/15/2020 9:13 AM, Andrew Rybchenko wrote:
>>>>> On 1/14/20 9:45 PM, Ferruh Yigit wrote:
>>>>>> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
>>>>>>> Add macros for the following protocols in the DDP esp-ah profile:
>>>>>>> ESP
>>>>>>> AH
>>>>>>>
>>>>>>> Add the following RSS macro for IPsec:
>>>>>>> ETH_RSS_IPSEC
>>>>>>>
>>>>>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>>>>> +Ori and other ethdev maintainers.
>>>>>>
>>>>>> Ori, can you please check this patch?
>>>>>>
>>>>>>> ---
>>>>>>>  lib/librte_ethdev/rte_ethdev.h | 14 +++++++++++++-
>>>>>>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/lib/librte_ethdev/rte_ethdev.h
>>>>>>> b/lib/librte_ethdev/rte_ethdev.h index 18a9def..208ec90 100644
>>>>>>> --- a/lib/librte_ethdev/rte_ethdev.h
>>>>>>> +++ b/lib/librte_ethdev/rte_ethdev.h
>>>>>>> @@ -484,7 +484,9 @@ struct rte_eth_rss_conf {
>>>>>>>  #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol
>> based flow */
>>>>>>>  #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE
>> protocol based flow */
>>>>>>>  #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based
>> flow */
>>>>>>> -#define RTE_ETH_FLOW_MAX                24
>>>>>>> +#define RTE_ETH_FLOW_AH                 24 /**< AH protocol based flow
>> */
>>>>>>> +#define RTE_ETH_FLOW_ESP                25 /**< ESP protocol based
>> flow */
>>>>>>> +#define RTE_ETH_FLOW_MAX                26
>>>>> Isn't changing RTE_ETH_FLOW_MAX value breaking ABI?
>>>>> Is v20.11 target release of the patch?
>>>> I can't see how this can cause an ABI break, unless the
>>>> 'RTE_ETH_FLOW_MAX' value used as size of an array in the middle of a
>> struct.
>>>> There is 'struct rte_eth_fdir_flex_conf' but the array is at the end
>>>> there, so it should be OK, unless that struct is not in the middle of another
>> struct.
>>>
>>> rte_eth_fdir_flex_conf -> rte_fdir_conf -> rte_eth_conf (in the
>>> middle)
>>
>> Yes, this looks like an ABI break and this is very annoying not able to even add
>> a new RTE_FLOW type.
>>
>> We need to find a proper way to handle this, at first glance I can see stop
>> using _MAX macros for the array size can work and perhaps we can use
>> another big enough hardcoded value for all similar array size. Any other
>> option?
>>
>> But we can do this on 20.11, we need a solution until that time.
> 
> This patch is required to handle RSS for the esp-ah.pkg DDP profile, it does not affect the i40e FD and testpmd changes in this patch set.
> The esp-ah.pkg DDP profile is not released yet.
> 
> Given that the merge deadline is today, I propose to drop this patch from the v6 patch set.

+1, if it can be separated, better to do it to not block rest of the work.

> 
>>
>>>
>>>> And there are values calculated from 'RTE_ETH_FLOW_MAX', like
>>>> 'RTE_FLOW_MASK_ARRAY_SIZE', same concern applies there, it very hard
>> to follow.
>>>>
>>>> Bernard,
>>>>
>>>> Can you please run the ABI version script to be sure this is not breaking
>> the ABI?
>>>>
>>>>
>>>>>>>
>>>>>>>  /*
>>>>>>>   * Below macros are defined for RSS offload types, they can be
>>>>>>> used to @@ -511,6 +513,12 @@ struct rte_eth_rss_conf {
>>>>>>>  #define ETH_RSS_GENEVE             (1ULL << 20)
>>>>>>>  #define ETH_RSS_NVGRE              (1ULL << 21)
>>>>>>>  #define ETH_RSS_GTPU               (1ULL << 23)
>>>>>>> +#define ETH_RSS_AH                 (1ULL << 24)
>>>>>>> +#define ETH_RSS_ESP                (1ULL << 25)
>>>>>>> +
>>>>>>> +
>>>>>>> +
>>>>>>> +
>>>>>>>
>>>>>>>  /*
>>>>>>>   * We use the following macros to combine with above ETH_RSS_*
>>>>>>> for @@ -571,6 +579,10 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
>>>>>>>  ETH_RSS_NONFRAG_IPV4_SCTP | \
>>>>>>>  ETH_RSS_NONFRAG_IPV6_SCTP)
>>>>>>>
>>>>>>> +#define ETH_RSS_IPSEC ( \
>>>>>>> +ETH_RSS_AH | \
>>>>>>> +ETH_RSS_ESP)
>>>>>>> +
>>>>>>>  #define ETH_RSS_TUNNEL ( \
>>>>>>>  ETH_RSS_VXLAN  | \
>>>>>>>  ETH_RSS_GENEVE | \
>>>>>>>
>>>
> Regards,
> 
> Bernard.
> 


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

* Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet
  2020-01-15 10:58             ` Ferruh Yigit
@ 2020-01-15 15:08               ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15 15:08 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh

<snip>

> >> Subject: Re: [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow
> >> Director packet
> >>
> >> On 1/14/2020 1:55 PM, Bernard Iremonger wrote:
> >>> include rte_config.h in i40e_fdir.c
> >>> In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt() and
> >>> in i40e_fdir_construct_pkt()
> >>>
> >>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> >>> ---
> >>>  drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
> >>>  1 file changed, 10 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/net/i40e/i40e_fdir.c
> >>> b/drivers/net/i40e/i40e_fdir.c index 5f85703..67bb28c 100644
> >>> --- a/drivers/net/i40e/i40e_fdir.c
> >>> +++ b/drivers/net/i40e/i40e_fdir.c
> >>> @@ -21,6 +21,10 @@
> >>>  #include <rte_tcp.h>
> >>>  #include <rte_sctp.h>
> >>>  #include <rte_hash_crc.h>
> >>> +#include <rte_config.h>
> >>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> >>> +#include <rte_hexdump.h>
> >>> +#endif
> >>>
> >>>  #include "i40e_logs.h"
> >>>  #include "base/i40e_type.h"
> >>> @@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
> >>>   &fdir_input->flow_ext.flexbytes[dst],
> >>>   size * sizeof(uint16_t));
> >>>  }
> >>> -
> >>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> >>> +rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >>>  return 0;
> >>>  }
> >>>
> >>> @@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf
> *pf,
> >>>   &fdir_input->flow_ext.flexbytes[dst],
> >>>   size * sizeof(uint16_t));
> >>>  }
> >>> -
> >>> +#ifdef RTE_LIBRTE_I40E_DEBUG_FD
> >>> +rte_hexdump(stdout, NULL, raw_pkt, len); #endif
> >>>  return 0;
> >>>  }
> >>>
> >>>
> >>
> >> Hi Bernard,
> >>
> >> These are not data path functions, right?
> > This code is only used when adding flow rules,  so not in data path.
> >
> >  If so instead of adding new config option, can we add dynamic debugging
> for it?
> > Adding new config option seems ok to me,  why change to dynamic
> debugging?
> >
> 
> Compile time options are OK for developer but bad for deployment, when
> you are deploying your product you have to disable this config option, and on
> the target platform there if a problem occurs there won't be any way to
> enable the debug to see what is happening.
> So it is useful only on the machine that you are both compiling and running
> application, even that case it is a trouble to terminate application, re-compile
> it and run again, most probably same loop again to turn off the debug back.
> 
> Also it is bad for testing, if you want to do the all code path, someone needs
> to test both enabling and disabling this config option. If not, it is possible by
> time enabling this config option even won't compile and nobody will detect
> it.
> 
> Since we already have dynamic log support, why not add a new logtype, lets
> say "pmd.net.i40e.fd" and have ability to enable/disable it without
> terminating app?
> 
This patch has already been acked by Qi Zhang, the I40e PMD maintainer.
The logtype for example "pmd.net.i40e.fd" also require CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=y in config/common_base.

Given that today is the merge deadline, I would like to leave this patch as is in the v6 patchset.

Regards,

Bernard.

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

* [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
  2020-01-14 19:03         ` Ferruh Yigit
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 00/10] " Bernard Iremonger
                             ` (10 more replies)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 01/13] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (12 subsequent siblings)
  14 siblings, 11 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Changes in V6:
-------------
Rebase to latest master branch
Fixed patch 0001-app-testpmd-parse-flow-command-line-for-ESP.patch
Dropped the following v5 patch due to ABI breakage:
0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch

Changes in V5:
-------------
Rebase to latest master branch
Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch

Changes in V4:
-------------
Add extra patch for testpmd
Add extra patch for config
Split v3 patch "net/i40e: process ESP flows" into 4 patches

Changes in V3:
-------------
Added i40e_flow_set_filter_spi() function in i40e_flow.c
Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
Split flow structures into 4 instead of 2 in i40e_ethdev.h
Dropped extra printf from commandline_flow.c

Changes in V2:
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c


Bernard Iremonger (13):
  app/testpmd: parse flow command line for ESP
  app/testpmd: improve debug
  app/testpmd: dump Rx and Tx mbuf
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: support ipsec-ah profile
  net/i40e: support ESP in customized code
  net/i40e: support ESP flows
  net/i40e: support ESP in Flow Director
  config: add debug to I40E Flow Director
  net/i40e: display Flow Director packet
  doc: release note for ESP
  doc: update i40e user guide

 app/test-pmd/cmdline_flow.c            |  34 +++++++-
 app/test-pmd/config.c                  |   2 +-
 app/test-pmd/util.c                    |   1 +
 config/common_base                     |   1 +
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   9 +++
 drivers/net/i40e/i40e_ethdev.c         |  52 ++++++++++++-
 drivers/net/i40e/i40e_ethdev.h         |  38 +++++++++
 drivers/net/i40e/i40e_fdir.c           | 138 ++++++++++++++++++++++++++++++---
 drivers/net/i40e/i40e_flow.c           | 135 +++++++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c        |   3 +-
 11 files changed, 395 insertions(+), 22 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 01/13] app/testpmd: parse flow command line for ESP
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
  2020-01-14 19:03         ` Ferruh Yigit
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 02/13] app/testpmd: improve debug Bernard Iremonger
                           ` (11 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add ITEM_ESP
add ITEM_ESP_SPI

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 99dade7..9c6edb8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -213,6 +213,8 @@ enum index {
 	ITEM_TAG,
 	ITEM_TAG_DATA,
 	ITEM_TAG_INDEX,
+	ITEM_ESP,
+	ITEM_ESP_SPI,
 
 	/* Validate/create actions. */
 	ACTIONS,
@@ -746,6 +748,7 @@ static const enum index next_item[] = {
 	ITEM_PPPOE_PROTO_ID,
 	ITEM_HIGIG2,
 	ITEM_TAG,
+	ITEM_ESP,
 	END_SET,
 	ZERO,
 };
@@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
 	ZERO,
 };
 
+static const enum index item_esp[] = {
+	ITEM_ESP_SPI,
+	ITEM_NEXT,
+	ZERO,
+};
+
 static const enum index next_set_raw[] = {
 	SET_RAW_INDEX,
 	ITEM_ETH,
@@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
 			     NEXT_ENTRY(ITEM_PARAM_IS)),
 		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)),
 	},
+	[ITEM_ESP] = {
+		.name = "esp",
+		.help = "match ESP header",
+		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
+		.next = NEXT(item_esp),
+		.call = parse_vc,
+	},
+	[ITEM_ESP_SPI] = {
+		.name = "spi",
+		.help = "security policy index",
+		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
+				hdr.spi)),
+	},
 	/* Validate/create actions. */
 	[ACTIONS] = {
 		.name = "actions",
@@ -6230,14 +6253,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
 	case RTE_FLOW_ITEM_TYPE_GTP:
 		mask = &rte_flow_item_gtp_mask;
 		break;
-	case RTE_FLOW_ITEM_TYPE_ESP:
-		mask = &rte_flow_item_esp_mask;
-		break;
 	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
 		mask = &rte_flow_item_gtp_psc_mask;
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		mask = &rte_flow_item_esp_mask;
+		break;
 	default:
 		break;
 	}
@@ -6327,6 +6351,10 @@ cmd_set_raw_parsed(const struct buffer *in)
 		case RTE_FLOW_ITEM_TYPE_GENEVE:
 			size = sizeof(struct rte_flow_item_geneve);
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			size = sizeof(struct rte_flow_item_esp);
+			proto = 0x32;
+			break;
 		default:
 			printf("Error - Not supported item\n");
 			*total_size = 0;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 02/13] app/testpmd: improve debug
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (2 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 01/13] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
                           ` (10 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (3 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 02/13] app/testpmd: improve debug Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 16:28           ` Ferruh Yigit
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 04/13] net/i40e: improve RSS debug Bernard Iremonger
                           ` (9 subsequent siblings)
  14 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index b514be5..bf03873 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		printf("  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
 			printf("INVALID mbuf: %s\n", reason);
+		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
 	}
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 04/13] net/i40e: improve RSS debug
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (4 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 05/13] net/i40e: handle ESP tunnel Bernard Iremonger
                           ` (8 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 05/13] net/i40e: handle ESP tunnel
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (5 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 04/13] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 06/13] net/i40e: support ipsec-ah profile Bernard Iremonger
                           ` (7 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 06/13] net/i40e: support ipsec-ah profile
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (6 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 05/13] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 07/13] net/i40e: support ESP in customized code Bernard Iremonger
                           ` (6 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..792a047 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_ipv4_flow ipv4;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_ipv6_flow ipv6;
+	uint32_t spi;	/* SPI in big endian. */
+};
+/* A structure used to define the input for ESP IPV4 UDP flow */
+struct i40e_esp_ipv4_udp_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 UDP flow */
+struct i40e_esp_ipv6_udp_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +549,10 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
+	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
+	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +798,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +928,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1038,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 07/13] net/i40e: support ESP in customized code
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (7 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 06/13] net/i40e: support ipsec-ah profile Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 08/13] net/i40e: support ESP flows Bernard Iremonger
                           ` (5 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 44 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 08/13] net/i40e: support ESP flows
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (8 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 07/13] net/i40e: support ESP in customized code Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 09/13] net/i40e: support ESP in Flow Director Bernard Iremonger
                           ` (4 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 135 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..c585d8b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 	return I40E_FILTER_PCTYPE_INVALID;
 }
 
+static void
+i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
+	const struct rte_flow_item_esp *esp_spec)
+{
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV4) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv4_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv4_flow.spi =
+				esp_spec->hdr.spi;
+	}
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV6) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv6_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv6_flow.spi =
+				esp_spec->hdr.spi;
+	}
+}
+
 /* 1. Last in item should be NULL as range is not supported.
  * 2. Supported patterns: refer to array i40e_supported_patterns.
  * 3. Default supported flow type and input set: refer to array
@@ -2459,6 +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				i40e_flow_set_filter_spi(filter, esp_spec);
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 09/13] net/i40e: support ESP in Flow Director
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (9 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 08/13] net/i40e: support ESP flows Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E " Bernard Iremonger
                           ` (3 subsequent siblings)
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 126 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 118 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..5f85703 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -54,6 +54,8 @@
 #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
 #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
 
+#define I40E_FDIR_ESP_DST_PORT              4500
+
 /* Wait time for fdir filter programming */
 #define I40E_FDIR_MAX_WAIT_US 10000
 
@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				udp->dst_port = rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				udp->dst_port =	rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow Director
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (10 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 09/13] net/i40e: support ESP in Flow Director Bernard Iremonger
@ 2020-01-15 15:53         ` " Bernard Iremonger
  2020-01-15 16:17           ` Ferruh Yigit
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 11/13] net/i40e: display Flow Director packet Bernard Iremonger
                           ` (2 subsequent siblings)
  14 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 config/common_base | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/common_base b/config/common_base
index 7dec7ed..7a76c26 100644
--- a/config/common_base
+++ b/config/common_base
@@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
 CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 11/13] net/i40e: display Flow Director packet
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (11 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E " Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP Bernard Iremonger
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 13/13] doc: update i40e user guide Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

include rte_config.h in i40e_fdir.c
In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt()
and in i40e_fdir_construct_pkt()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 5f85703..67bb28c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,10 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_config.h>
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+#include <rte_hexdump.h>
+#endif
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
@@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (12 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 11/13] net/i40e: display Flow Director packet Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  2020-01-15 16:20           ` Ferruh Yigit
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 13/13] doc: update i40e user guide Bernard Iremonger
  14 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Release note for ESP support on the i40e PMD.
Release note for ESP support on testpmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..367c980 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,15 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
-- 
2.7.4


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

* [dpdk-dev] [PATCH v6 13/13] doc: update i40e user guide
  2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
                           ` (13 preceding siblings ...)
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP Bernard Iremonger
@ 2020-01-15 15:53         ` Bernard Iremonger
  14 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-15 15:53 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Update the i40e user guide with ESP information.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/nics/i40e.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow Director
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E " Bernard Iremonger
@ 2020-01-15 16:17           ` Ferruh Yigit
  2020-01-15 17:26             ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 16:17 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  config/common_base | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/config/common_base b/config/common_base
> index 7dec7ed..7a76c26 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
>  CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
>  CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
>  CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
> +CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
>  CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
>  CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
>  CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
> 

Hi Bernard,

If the dynamic log won't make in time, what do you think dropping the
RTE_LIBRTE_I40E_DEBUG_FD patches for now, it seems it is only for debug, and do
the dynamic log support incremental later?

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

* Re: [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP Bernard Iremonger
@ 2020-01-15 16:20           ` Ferruh Yigit
  2020-01-15 16:58             ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 16:20 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> Release note for ESP support on the i40e PMD.
> Release note for ESP support on testpmd.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
> index 0eaa45a..367c980 100644
> --- a/doc/guides/rel_notes/release_20_02.rst
> +++ b/doc/guides/rel_notes/release_20_02.rst
> @@ -56,6 +56,15 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =========================================================
>  
> +* **Updated i40e driver to support ESP.**
> +
> +  Updated the i40e PMD to support ESP-AH supporting profiles which can be
> +  programmed by the dynamic device personalization (DDP) process.
> +
> +* **Updated testpmd to support ESP flows.**
> +
> +  Added support for ESP rte_flow patterns to the testpmd application.
> +
>  
>  Removed Items
>  -------------
> 

Hi Bernard,

Can you please distribute the documentation update to the patch that actually
adds the feature? If the future is in multiple patches, you can put the
documentation into the last patch completes the feature. Same for 13/13.

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

* Re: [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
@ 2020-01-15 16:28           ` Ferruh Yigit
  2020-01-15 16:52             ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-15 16:28 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  app/test-pmd/util.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
> index b514be5..bf03873 100644
> --- a/app/test-pmd/util.c
> +++ b/app/test-pmd/util.c
> @@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
>  		printf("  ol_flags: %s\n", buf);
>  		if (rte_mbuf_check(mb, 1, &reason) < 0)
>  			printf("INVALID mbuf: %s\n", reason);
> +		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
>  	}
>  }
>  
> 

I am not sure about this change, 'dump_pkt_burst' is good for debugging and
getting the packet metadata, but having mbuf dump for each packet can make it
very verbose and harder to use.
If there is a need for it, can we add it with another command?
like verbose value 0,1,2,3 defines the dump_pkt_burst level, why not add a new
level to dump mbuf?

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

* Re: [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf
  2020-01-15 16:28           ` Ferruh Yigit
@ 2020-01-15 16:52             ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15 16:52 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, January 15, 2020 4:29 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx
> mbuf
> 
> On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> > add call to rte_pktmbuf_dump() in dump_pkt_burst in util.c
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  app/test-pmd/util.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index
> > b514be5..bf03873 100644
> > --- a/app/test-pmd/util.c
> > +++ b/app/test-pmd/util.c
> > @@ -158,6 +158,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue,
> struct rte_mbuf *pkts[],
> >  		printf("  ol_flags: %s\n", buf);
> >  		if (rte_mbuf_check(mb, 1, &reason) < 0)
> >  			printf("INVALID mbuf: %s\n", reason);
> > +		rte_pktmbuf_dump(stdout, pkts[i], pkts[i]->data_len);
> >  	}
> >  }
> >
> >
> 
> I am not sure about this change, 'dump_pkt_burst' is good for debugging and
> getting the packet metadata, but having mbuf dump for each packet can
> make it very verbose and harder to use.
> If there is a need for it, can we add it with another command?
> like verbose value 0,1,2,3 defines the dump_pkt_burst level, why not add a
> new level to dump mbuf?

This is only printed for verbose levels 1 (rx) and 3 (rx+tx).
Normally used for debugging a small number or burst of packets.
If you think it is too verbose I can live without this patch.

Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP
  2020-01-15 16:20           ` Ferruh Yigit
@ 2020-01-15 16:58             ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15 16:58 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, January 15, 2020 4:21 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP
> 
> On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> > Release note for ESP support on the i40e PMD.
> > Release note for ESP support on testpmd.
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  doc/guides/rel_notes/release_20_02.rst | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/release_20_02.rst
> > b/doc/guides/rel_notes/release_20_02.rst
> > index 0eaa45a..367c980 100644
> > --- a/doc/guides/rel_notes/release_20_02.rst
> > +++ b/doc/guides/rel_notes/release_20_02.rst
> > @@ -56,6 +56,15 @@ New Features
> >       Also, make sure to start the actual text at the margin.
> >
> =========================================================
> >
> > +* **Updated i40e driver to support ESP.**
> > +
> > +  Updated the i40e PMD to support ESP-AH supporting profiles which
> > + can be  programmed by the dynamic device personalization (DDP)
> process.
> > +
> > +* **Updated testpmd to support ESP flows.**
> > +
> > +  Added support for ESP rte_flow patterns to the testpmd application.
> > +
> >
> >  Removed Items
> >  -------------
> >
> 
> Hi Bernard,
> 
> Can you please distribute the documentation update to the patch that
> actually adds the feature? If the future is in multiple patches, you can put the
> documentation into the last patch completes the feature. Same for 13/13.

There are actually two features here one for testpmd and the other for the i40e so the release note should be split.
Can the doc patches be updated after the merge?

Regards,

Bernard.




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

* Re: [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow Director
  2020-01-15 16:17           ` Ferruh Yigit
@ 2020-01-15 17:26             ` Iremonger, Bernard
  2020-01-16 15:38               ` Ferruh Yigit
  0 siblings, 1 reply; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-15 17:26 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Wednesday, January 15, 2020 4:18 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow
> Director
> 
> On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
> > add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  config/common_base | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/config/common_base b/config/common_base index
> > 7dec7ed..7a76c26 100644
> > --- a/config/common_base
> > +++ b/config/common_base
> > @@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
> > CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
> CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
> > CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
> > +CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
> >  CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
> >  CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
> >  CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
> >
> 
> Hi Bernard,
> 
> If the dynamic log won't make in time, what do you think dropping the
> RTE_LIBRTE_I40E_DEBUG_FD patches for now, it seems it is only for debug,
> and do the dynamic log support incremental later?

I have had a look at the existing rte_log() support in the i40e code in i40e_logs.h and i40e_ethdev.c (line 403 +) and lines 12930 +
The RTE_LIBRTE_I40E_DEBUG_XXX macros are used so this change to config/common_base is needed for dynamic logging too.

The PMD_RX_LOG() seems to only do a printf () which is not what I want.

I would like to keep these two patches which have been acked in the v5 patchset.

I will continue with the dynamic logging after the merge if that is allowed.

Regards,

Bernard




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

* [dpdk-dev] [PATCH v7 00/10] net/i40e: ESP support
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
@ 2020-01-16 12:44           ` " Bernard Iremonger
  2020-01-16 17:42             ` Ferruh Yigit
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
                             ` (9 subsequent siblings)
  10 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add support for ESP flows to testpmd.
Improve debug information in testpmd and the i40e PMD.
Process ESP flows on the i40e Flow Director.

Changes in V7: 
-------------
Dropped the following debug patch from v6 patchset
0003-app-testpmd-dump-Rx-and-Tx-mbuf.patch
Included release notes and doc patches in feature patches.

Changes in V6: 
-------------
Rebase to latest master branch
Fixed patch 0001-app-testpmd-parse-flow-command-line-for-ESP.patch
Dropped the following v5 patch due to ABI breakage:
0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch

Changes in V5: 
-------------
Rebase to latest master branch
Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch

Changes in V4: 
-------------
Add extra patch for testpmd
Add extra patch for config
Split v3 patch "net/i40e: process ESP flows" into 4 patches

Changes in V3: 
-------------
Added i40e_flow_set_filter_spi() function in i40e_flow.c
Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
Split flow structures into 4 instead of 2 in i40e_ethdev.h
Dropped extra printf from commandline_flow.c

Changes in V2: 
--------------
Moved change in app/test-pmd/config.c to a seperate patch.
Added extra parameter to fill_ip6_head() in i40e_fdir.c
set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c
Bernard Iremonger (10):
  app/testpmd: parse flow command line for ESP
  app/testpmd: improve debug
  net/i40e: improve RSS debug
  net/i40e: handle ESP tunnel
  net/i40e: support ipsec-ah profile
  net/i40e: support ESP in customized code
  net/i40e: support ESP flows
  net/i40e: support ESP in Flow Director
  config: add debug to I40E Flow Director
  net/i40e: display Flow Director packet

 app/test-pmd/cmdline_flow.c                 |  34 ++++++-
 app/test-pmd/config.c                       |   2 +-
 config/common_base                          |   1 +
 doc/guides/nics/i40e.rst                    |   4 +-
 doc/guides/rel_notes/release_20_02.rst      |  10 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  14 +++
 drivers/net/i40e/i40e_ethdev.c              |  52 ++++++++++-
 drivers/net/i40e/i40e_ethdev.h              |  38 ++++++++
 drivers/net/i40e/i40e_fdir.c                | 138 ++++++++++++++++++++++++++--
 drivers/net/i40e/i40e_flow.c                | 135 ++++++++++++++++++++++++++-
 drivers/net/i40e/rte_pmd_i40e.c             |   3 +-
 11 files changed, 409 insertions(+), 22 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 01/10] app/testpmd: parse flow command line for ESP
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 00/10] " Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug Bernard Iremonger
                             ` (8 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add ITEM_ESP
add ITEM_ESP_SPI
update release notes for testpmd changes
add sample ESP rules in testpmd guide

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 app/test-pmd/cmdline_flow.c                 | 34 ++++++++++++++++++++++++++---
 doc/guides/rel_notes/release_20_02.rst      |  4 ++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 14 ++++++++++++
 3 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 99dade7..9c6edb8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -213,6 +213,8 @@ enum index {
 	ITEM_TAG,
 	ITEM_TAG_DATA,
 	ITEM_TAG_INDEX,
+	ITEM_ESP,
+	ITEM_ESP_SPI,
 
 	/* Validate/create actions. */
 	ACTIONS,
@@ -746,6 +748,7 @@ static const enum index next_item[] = {
 	ITEM_PPPOE_PROTO_ID,
 	ITEM_HIGIG2,
 	ITEM_TAG,
+	ITEM_ESP,
 	END_SET,
 	ZERO,
 };
@@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = {
 	ZERO,
 };
 
+static const enum index item_esp[] = {
+	ITEM_ESP_SPI,
+	ITEM_NEXT,
+	ZERO,
+};
+
 static const enum index next_set_raw[] = {
 	SET_RAW_INDEX,
 	ITEM_ETH,
@@ -2593,6 +2602,20 @@ static const struct token token_list[] = {
 			     NEXT_ENTRY(ITEM_PARAM_IS)),
 		.args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)),
 	},
+	[ITEM_ESP] = {
+		.name = "esp",
+		.help = "match ESP header",
+		.priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)),
+		.next = NEXT(item_esp),
+		.call = parse_vc,
+	},
+	[ITEM_ESP_SPI] = {
+		.name = "spi",
+		.help = "security policy index",
+		.next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp,
+				hdr.spi)),
+	},
 	/* Validate/create actions. */
 	[ACTIONS] = {
 		.name = "actions",
@@ -6230,14 +6253,15 @@ flow_item_default_mask(const struct rte_flow_item *item)
 	case RTE_FLOW_ITEM_TYPE_GTP:
 		mask = &rte_flow_item_gtp_mask;
 		break;
-	case RTE_FLOW_ITEM_TYPE_ESP:
-		mask = &rte_flow_item_esp_mask;
-		break;
 	case RTE_FLOW_ITEM_TYPE_GTP_PSC:
 		mask = &rte_flow_item_gtp_psc_mask;
 		break;
 	case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
 		mask = &rte_flow_item_pppoe_proto_id_mask;
+		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		mask = &rte_flow_item_esp_mask;
+		break;
 	default:
 		break;
 	}
@@ -6327,6 +6351,10 @@ cmd_set_raw_parsed(const struct buffer *in)
 		case RTE_FLOW_ITEM_TYPE_GENEVE:
 			size = sizeof(struct rte_flow_item_geneve);
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			size = sizeof(struct rte_flow_item_esp);
+			proto = 0x32;
+			break;
 		default:
 			printf("Error - Not supported item\n");
 			*total_size = 0;
diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 0eaa45a..057b7ee 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -56,6 +56,10 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated testpmd to support ESP flows.**
+
+  Added support for ESP rte_flow patterns to the testpmd application.
+
 
 Removed Items
 -------------
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 73ef0b4..fe84fa4 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -4751,6 +4751,20 @@ Decapsulating VxLAN::
  testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 /
         end actions raw_decap / queue index 0 / end
 
+Sample ESP rules
+~~~~~~~~~~~~~~~~
+
+ESP rules can be created by the following commands::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / esp spi is 1 / end actions
+        queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / udp / esp spi is 1 / end
+        actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / esp spi is 1 / end actions
+        queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / udp / esp spi is 1 / end
+        actions queue index 3 / end
+
 BPF Functions
 --------------
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 00/10] " Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 13:46             ` Ananyev, Konstantin
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 03/10] net/i40e: improve RSS debug Bernard Iremonger
                             ` (7 subsequent siblings)
  10 siblings, 1 reply; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d599682..2753ec5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
 		errstr = "unknown type";
 	else
 		errstr = errstrlist[error->type];
-	printf("Caught error type %d (%s): %s%s: %s\n",
+	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
 	       error->type, errstr,
 	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
 					error->cause), buf) : "",
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 03/10] net/i40e: improve RSS debug
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (2 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 04/10] net/i40e: handle ESP tunnel Bernard Iremonger
                             ` (6 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5999c96..5f1cf8a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -8679,7 +8679,9 @@ i40e_pf_config_rss(struct i40e_pf *pf)
 			num);
 
 	if (num == 0) {
-		PMD_INIT_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_INIT_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
@@ -12840,7 +12842,9 @@ i40e_config_rss_filter(struct i40e_pf *pf,
 			num);
 
 	if (num == 0) {
-		PMD_DRV_LOG(ERR, "No PF queues are configured to enable RSS");
+		PMD_DRV_LOG(ERR,
+			"No PF queues are configured to enable RSS for port %u",
+			pf->dev_data->port_id);
 		return -ENOTSUP;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 04/10] net/i40e: handle ESP tunnel
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (3 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 03/10] net/i40e: improve RSS debug Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 05/10] net/i40e: support ipsec-ah profile Bernard Iremonger
                             ` (5 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index fdcb1a4..b987346 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2172,7 +2172,8 @@ static int check_invalid_pkt_type(uint32_t pkt_type)
 	    tnl != RTE_PTYPE_TUNNEL_GRENAT &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPC &&
 	    tnl != RTE_PTYPE_TUNNEL_GTPU &&
-	    tnl != RTE_PTYPE_TUNNEL_L2TP)
+	    tnl != RTE_PTYPE_TUNNEL_L2TP &&
+	    tnl != RTE_PTYPE_TUNNEL_ESP)
 		return -1;
 
 	if (il2 &&
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 05/10] net/i40e: support ipsec-ah profile
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (4 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 04/10] net/i40e: handle ESP tunnel Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 06/10] net/i40e: support ESP in customized code Bernard Iremonger
                             ` (4 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 295ad59..792a047 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -501,6 +501,29 @@ struct i40e_gtp_ipv6_flow {
 	struct rte_eth_ipv6_flow ip6;
 };
 
+/* A structure used to define the input for ESP IPV4 flow */
+struct i40e_esp_ipv4_flow {
+	struct rte_eth_ipv4_flow ipv4;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 flow */
+struct i40e_esp_ipv6_flow {
+	struct rte_eth_ipv6_flow ipv6;
+	uint32_t spi;	/* SPI in big endian. */
+};
+/* A structure used to define the input for ESP IPV4 UDP flow */
+struct i40e_esp_ipv4_udp_flow {
+	struct rte_eth_udpv4_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
+/* A structure used to define the input for ESP IPV6 UDP flow */
+struct i40e_esp_ipv6_udp_flow {
+	struct rte_eth_udpv6_flow udp;
+	uint32_t spi;	/* SPI in big endian. */
+};
+
 /* A structure used to define the input for raw type flow */
 struct i40e_raw_flow {
 	uint16_t pctype;
@@ -526,6 +549,10 @@ union i40e_fdir_flow {
 	struct i40e_gtp_ipv4_flow  gtp_ipv4_flow;
 	struct i40e_gtp_ipv6_flow  gtp_ipv6_flow;
 	struct i40e_raw_flow       raw_flow;
+	struct i40e_esp_ipv4_flow  esp_ipv4_flow;
+	struct i40e_esp_ipv6_flow  esp_ipv6_flow;
+	struct i40e_esp_ipv4_udp_flow  esp_ipv4_udp_flow;
+	struct i40e_esp_ipv6_udp_flow  esp_ipv6_udp_flow;
 };
 
 enum i40e_fdir_ip_type {
@@ -542,8 +569,10 @@ struct i40e_fdir_flow_ext {
 	uint16_t dst_id; /* VF ID, available when is_vf is 1*/
 	bool inner_ip;   /* If there is inner ip */
 	enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */
+	enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */
 	bool customized_pctype; /* If customized pctype is used */
 	bool pkt_template; /* If raw packet template is used */
+	bool is_udp; /* ipv4|ipv6 udp flow */
 };
 
 /* A structure used to define the input for a flow director filter entry */
@@ -769,6 +798,8 @@ enum i40e_tunnel_type {
 	I40E_TUNNEL_TYPE_QINQ,
 	I40E_TUNNEL_TYPE_GTPC,
 	I40E_TUNNEL_TYPE_GTPU,
+	I40E_TUNNEL_TYPE_ESPoUDP,
+	I40E_TUNNEL_TYPE_ESPoIP,
 	I40E_TUNNEL_TYPE_MAX,
 };
 
@@ -897,6 +928,12 @@ enum i40e_new_pctype {
 	I40E_CUSTOMIZED_GTPU_IPV4,
 	I40E_CUSTOMIZED_GTPU_IPV6,
 	I40E_CUSTOMIZED_GTPU,
+	I40E_CUSTOMIZED_ESP_IPV4,
+	I40E_CUSTOMIZED_ESP_IPV6,
+	I40E_CUSTOMIZED_ESP_IPV4_UDP,
+	I40E_CUSTOMIZED_ESP_IPV6_UDP,
+	I40E_CUSTOMIZED_AH_IPV4,
+	I40E_CUSTOMIZED_AH_IPV6,
 	I40E_CUSTOMIZED_MAX,
 };
 
@@ -1001,6 +1038,7 @@ struct i40e_pf {
 
 	/* Dynamic Device Personalization */
 	bool gtp_support; /* 1 - support GTP-C and GTP-U */
+	bool esp_support; /* 1 - support ESP SPI */
 	/* customer customized pctype */
 	struct i40e_customized_pctype customized_pctype[I40E_CUSTOMIZED_MAX];
 	/* Switch Domain Id */
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 06/10] net/i40e: support ESP in customized code
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (5 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 05/10] net/i40e: support ipsec-ah profile Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 07/10] net/i40e: support ESP flows Bernard Iremonger
                             ` (3 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 44 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5f1cf8a..a462eba 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1106,6 +1106,7 @@ i40e_init_customized_info(struct i40e_pf *pf)
 	}
 
 	pf->gtp_support = false;
+	pf->esp_support = false;
 }
 
 void
@@ -12337,6 +12338,7 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			}
 		}
 		name[strlen(name) - 1] = '\0';
+		PMD_DRV_LOG(INFO, "name = %s\n", name);
 		if (!strcmp(name, "GTPC"))
 			new_pctype =
 				i40e_find_customized_pctype(pf,
@@ -12353,6 +12355,30 @@ i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg,
 			new_pctype =
 				i40e_find_customized_pctype(pf,
 						      I40E_CUSTOMIZED_GTPU);
+		else if (!strcmp(name, "IPV4_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+		else if (!strcmp(name, "IPV6_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		else if (!strcmp(name, "IPV4_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+		else if (!strcmp(name, "IPV6_UDP_ESP"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+		else if (!strcmp(name, "IPV4_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV4);
+		else if (!strcmp(name, "IPV6_AH"))
+			new_pctype =
+				i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_AH_IPV6);
 		if (new_pctype) {
 			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD) {
 				new_pctype->pctype = pctype_value;
@@ -12448,6 +12474,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					continue;
 				memset(name, 0, sizeof(name));
 				strcpy(name, proto[n].name);
+				PMD_DRV_LOG(INFO, "name = %s\n", name);
 				if (!strncasecmp(name, "PPPOE", 5))
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_L2_ETHER_PPPOE;
@@ -12541,6 +12568,10 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GTPU;
 					in_tunnel = true;
+				} else if (!strncasecmp(name, "ESP", 3)) {
+					ptype_mapping[i].sw_ptype |=
+						RTE_PTYPE_TUNNEL_ESP;
+					in_tunnel = true;
 				} else if (!strncasecmp(name, "GRENAT", 6)) {
 					ptype_mapping[i].sw_ptype |=
 						RTE_PTYPE_TUNNEL_GRENAT;
@@ -12560,7 +12591,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 	ret = rte_pmd_i40e_ptype_mapping_update(port_id, ptype_mapping,
 						ptype_num, 0);
 	if (ret)
-		PMD_DRV_LOG(ERR, "Failed to update mapping table.");
+		PMD_DRV_LOG(ERR, "Failed to update ptype mapping table.");
 
 	rte_free(ptype_mapping);
 	rte_free(ptype);
@@ -12625,6 +12656,17 @@ i40e_update_customized_info(struct rte_eth_dev *dev, uint8_t *pkg,
 		}
 	}
 
+	/* Check if ESP is supported. */
+	for (i = 0; i < proto_num; i++) {
+		if (!strncmp(proto[i].name, "ESP", 3)) {
+			if (op == RTE_PMD_I40E_PKG_OP_WR_ADD)
+				pf->esp_support = true;
+			else
+				pf->esp_support = false;
+			break;
+		}
+	}
+
 	/* Update customized pctype info */
 	ret = i40e_update_customized_pctype(dev, pkg, pkg_size,
 					    proto_num, proto, op);
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 07/10] net/i40e: support ESP flows
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (6 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 06/10] net/i40e: support ESP in customized code Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 08/10] net/i40e: support ESP in Flow Director Bernard Iremonger
                             ` (2 subsequent siblings)
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 135 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 6102103..c585d8b 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -110,8 +110,7 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_ethertype_filter(struct i40e_pf *pf);
 static int i40e_flow_flush_tunnel_filter(struct i40e_pf *pf);
-static int
-i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
+static int i40e_flow_flush_rss_filter(struct rte_eth_dev *dev);
 static int
 i40e_flow_parse_qinq_filter(struct rte_eth_dev *dev,
 			      const struct rte_flow_attr *attr,
@@ -1615,6 +1614,36 @@ static enum rte_flow_item_type pattern_qinq_1[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+static enum rte_flow_item_type pattern_fdir_ipv4_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv4_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+static enum rte_flow_item_type pattern_fdir_ipv6_udp_esp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ESP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	/* Ethertype */
 	{ pattern_ethertype, i40e_flow_parse_ethertype_filter },
@@ -1628,6 +1657,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv4_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv4_udp_esp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_udp, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_tcp, i40e_flow_parse_fdir_filter },
@@ -1636,6 +1667,8 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {
 	{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv4, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ipv6_gtpu_ipv6, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_esp, i40e_flow_parse_fdir_filter },
+	{ pattern_fdir_ipv6_udp_esp, i40e_flow_parse_fdir_filter },
 	/* FDIR - support default flow type with flexible payload */
 	{ pattern_fdir_ethertype_raw_1, i40e_flow_parse_fdir_filter },
 	{ pattern_fdir_ethertype_raw_2, i40e_flow_parse_fdir_filter },
@@ -2420,6 +2453,28 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 			cus_pctype = i40e_find_customized_pctype(pf,
 						 I40E_CUSTOMIZED_GTPU_IPV6);
 		break;
+	case RTE_FLOW_ITEM_TYPE_ESP:
+		if (!filter->input.flow_ext.is_udp) {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4);
+			else if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6);
+		} else {
+			if (filter->input.flow_ext.oip_type ==
+				I40E_FDIR_IPTYPE_IPV4)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV4_UDP);
+			else if (filter->input.flow_ext.oip_type ==
+					I40E_FDIR_IPTYPE_IPV6)
+				cus_pctype = i40e_find_customized_pctype(pf,
+						I40E_CUSTOMIZED_ESP_IPV6_UDP);
+			filter->input.flow_ext.is_udp = false;
+		}
+		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported item type");
 		break;
@@ -2431,6 +2486,30 @@ i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf,
 	return I40E_FILTER_PCTYPE_INVALID;
 }
 
+static void
+i40e_flow_set_filter_spi(struct i40e_fdir_filter_conf *filter,
+	const struct rte_flow_item_esp *esp_spec)
+{
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV4) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv4_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv4_flow.spi =
+				esp_spec->hdr.spi;
+	}
+	if (filter->input.flow_ext.oip_type ==
+		I40E_FDIR_IPTYPE_IPV6) {
+		if (filter->input.flow_ext.is_udp)
+			filter->input.flow.esp_ipv6_udp_flow.spi =
+				esp_spec->hdr.spi;
+		else
+			filter->input.flow.esp_ipv6_flow.spi =
+				esp_spec->hdr.spi;
+	}
+}
+
 /* 1. Last in item should be NULL as range is not supported.
  * 2. Supported patterns: refer to array i40e_supported_patterns.
  * 3. Default supported flow type and input set: refer to array
@@ -2459,6 +2538,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 	const struct rte_flow_item_udp *udp_spec, *udp_mask;
 	const struct rte_flow_item_sctp *sctp_spec, *sctp_mask;
 	const struct rte_flow_item_gtp *gtp_spec, *gtp_mask;
+	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	const struct rte_flow_item_raw *raw_spec, *raw_mask;
 	const struct rte_flow_item_vf *vf_spec;
 
@@ -2654,10 +2734,18 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 					ipv4_spec->hdr.src_addr;
 				filter->input.flow.ip4_flow.dst_ip =
 					ipv4_spec->hdr.dst_addr;
+
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if (!ipv4_spec && !ipv4_mask && !outer_ip) {
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV4;
+			} else if (!ipv4_spec && !ipv4_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV4;
 			} else if ((ipv4_spec || ipv4_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2716,6 +2804,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow.ipv6_flow.hop_limits =
 					ipv6_spec->hdr.hop_limits;
 
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
+
 				rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
 					   ipv6_spec->hdr.src_addr, 16);
 				rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
@@ -2729,6 +2821,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				filter->input.flow_ext.inner_ip = true;
 				filter->input.flow_ext.iip_type =
 					I40E_FDIR_IPTYPE_IPV6;
+			} else if (!ipv6_spec && !ipv6_mask && outer_ip) {
+				filter->input.flow_ext.inner_ip = false;
+				filter->input.flow_ext.oip_type =
+					I40E_FDIR_IPTYPE_IPV6;
 			} else if ((ipv6_spec || ipv6_mask) && !outer_ip) {
 				rte_flow_error_set(error, EINVAL,
 						   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2828,7 +2924,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 						udp_spec->hdr.dst_port;
 				}
 			}
-
+			filter->input.flow_ext.is_udp = true;
 			layer_idx = I40E_FLXPLD_L4_IDX;
 
 			break;
@@ -2863,6 +2959,39 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				cus_proto = item_type;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_ESP:
+			if (!pf->esp_support) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Unsupported ESP protocol");
+				return -rte_errno;
+			}
+
+			esp_spec = item->spec;
+			esp_mask = item->mask;
+
+			if (!esp_spec || !esp_mask) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP item");
+				return -rte_errno;
+			}
+
+			if (esp_spec && esp_mask) {
+				if (esp_mask->hdr.spi != UINT32_MAX) {
+					rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ITEM,
+						   item,
+						   "Invalid ESP mask");
+					return -rte_errno;
+				}
+				i40e_flow_set_filter_spi(filter, esp_spec);
+				filter->input.flow_ext.customized_pctype = true;
+				cus_proto = item_type;
+			}
+			break;
 		case RTE_FLOW_ITEM_TYPE_SCTP:
 			sctp_spec = item->spec;
 			sctp_mask = item->mask;
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 08/10] net/i40e: support ESP in Flow Director
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (7 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 07/10] net/i40e: support ESP flows Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 09/10] config: add debug to I40E " Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 10/10] net/i40e: display Flow Director packet Bernard Iremonger
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile
update the i40e user guide with ESP information.
update release notes for i40e changes

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/i40e.rst               |   4 +-
 doc/guides/rel_notes/release_20_02.rst |   6 ++
 drivers/net/i40e/i40e_fdir.c           | 126 ++++++++++++++++++++++++++++++---
 3 files changed, 127 insertions(+), 9 deletions(-)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 38acf59..5cf34d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support
 protocols/filters which are not supported by default. The DDP
 functionality requires a NIC firmware version of 6.0 or greater.
 
-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,
+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,
 steering can be used with rte_flow API.
 
 GTPv1 package is released, and it can be downloaded from
@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.
 PPPoE package is released, and it can be downloaded from
 https://downloadcenter.intel.com/download/28040.
 
+ESP-AH package is not released yet.
+
 Load a profile which supports GTP and store backup profile:
 
 .. code-block:: console
diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst
index 057b7ee..cd4f6eb 100644
--- a/doc/guides/rel_notes/release_20_02.rst
+++ b/doc/guides/rel_notes/release_20_02.rst
@@ -60,6 +60,12 @@ New Features
 
   Added support for ESP rte_flow patterns to the testpmd application.
 
+* **Updated i40e driver to support ESP.**
+
+  Updated the i40e PMD to support ESP-AH supporting profiles which can be
+  programmed by the dynamic device personalization (DDP) process.
+
+
 
 Removed Items
 -------------
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index dee007d..5f85703 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -54,6 +54,8 @@
 #define I40E_FDIR_GTP_MSG_TYPE_0X01         0x01
 #define I40E_FDIR_GTP_MSG_TYPE_0XFF         0xFF
 
+#define I40E_FDIR_ESP_DST_PORT              4500
+
 /* Wait time for fdir filter programming */
 #define I40E_FDIR_MAX_WAIT_US 10000
 
@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)
 }
 
 static inline int
+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
+		uint8_t next_proto, uint8_t len, uint16_t *ether_type)
+{
+	struct rte_ipv6_hdr *ip6;
+
+	ip6 = (struct rte_ipv6_hdr *)raw_pkt;
+
+	*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+	ip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
+		(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));
+	ip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
+	ip6->proto = fdir_input->flow.ipv6_flow.proto ?
+		fdir_input->flow.ipv6_flow.proto : next_proto;
+	ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?
+		fdir_input->flow.ipv6_flow.hop_limits :
+		I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
+	/**
+	 * The source and destination fields in the transmitted packet
+	 * need to be presented in a reversed order with respect
+	 * to the expected received packets.
+	 */
+	rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+		IPV6_ADDR_LEN);
+	rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+		IPV6_ADDR_LEN);
+	len += sizeof(struct rte_ipv6_hdr);
+
+	return len;
+}
+
+static inline int
 i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 				const struct i40e_fdir_input *fdir_input,
 				unsigned char *raw_pkt,
@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
 
-		if (!is_customized_pctype)
+		if (!is_customized_pctype) {
 			ip->next_proto_id = fdir_input->flow.ip4_flow.proto ?
 				fdir_input->flow.ip4_flow.proto :
 				next_proto[fdir_input->pctype];
-		else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
-			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
+			 cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct rte_ipv4_hdr);
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+			ip->next_proto_id = IPPROTO_ESP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+			ip->next_proto_id = IPPROTO_UDP;
+			len += sizeof(struct rte_ipv4_hdr);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,
+					len, ether_type);
+		else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)
+			len = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,
+					len, ether_type);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			   IPV6_ADDR_LEN);
 		len += sizeof(struct rte_ipv6_hdr);
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
+	struct rte_flow_item_esp *esp;
+	struct rte_ipv4_hdr *esp_ipv4;
+	struct rte_ipv6_hdr *esp_ipv6;
+
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
+		} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||
+			cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+			if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv4;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV4_UDP) {
+				esp_ipv4 = (struct rte_ipv4_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv4;
+				udp->dst_port = rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+						(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv4 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv4_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				esp = (struct rte_flow_item_esp *)esp_ipv6;
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_esp_hdr);
+			} else if (cus_pctype->index ==
+					I40E_CUSTOMIZED_ESP_IPV6_UDP) {
+				esp_ipv6 = (struct rte_ipv6_hdr *)
+					(raw_pkt + len);
+				udp = (struct rte_udp_hdr *)esp_ipv6;
+				udp->dst_port =	rte_cpu_to_be_16
+					(I40E_FDIR_ESP_DST_PORT);
+
+				udp->dgram_len = rte_cpu_to_be_16
+					(I40E_FDIR_UDP_DEFAULT_LEN);
+				esp = (struct rte_flow_item_esp *)
+					((unsigned char *)esp_ipv6 +
+						sizeof(struct rte_udp_hdr));
+				esp->hdr.spi =
+					fdir_input->flow.esp_ipv6_udp_flow.spi;
+				payload = (unsigned char *)esp +
+					sizeof(struct rte_esp_hdr);
+				len += sizeof(struct rte_udp_hdr) +
+						sizeof(struct rte_esp_hdr);
+			}
 		}
 	} else {
-		PMD_DRV_LOG(ERR, "unknown pctype %u.",
-			    fdir_input->pctype);
+		PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
 		return -1;
 	}
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 09/10] config: add debug to I40E Flow Director
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (8 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 08/10] net/i40e: support ESP in Flow Director Bernard Iremonger
@ 2020-01-16 12:44           ` " Bernard Iremonger
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 10/10] net/i40e: display Flow Director packet Bernard Iremonger
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 config/common_base | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/common_base b/config/common_base
index 7dec7ed..7a76c26 100644
--- a/config/common_base
+++ b/config/common_base
@@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
 CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
+CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
 CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
 CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
-- 
2.7.4


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

* [dpdk-dev] [PATCH v7 10/10] net/i40e: display Flow Director packet
  2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
                             ` (9 preceding siblings ...)
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 09/10] config: add debug to I40E " Bernard Iremonger
@ 2020-01-16 12:44           ` Bernard Iremonger
  10 siblings, 0 replies; 134+ messages in thread
From: Bernard Iremonger @ 2020-01-16 12:44 UTC (permalink / raw)
  To: dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang, Bernard Iremonger

include rte_config.h in i40e_fdir.c
In debug mode call rte_hexdump in i40e_flow_fdir_construct_pkt()
and in i40e_fdir_construct_pkt()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_fdir.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 5f85703..67bb28c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -21,6 +21,10 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_hash_crc.h>
+#include <rte_config.h>
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+#include <rte_hexdump.h>
+#endif
 
 #include "i40e_logs.h"
 #include "base/i40e_type.h"
@@ -954,7 +958,9 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
@@ -1415,7 +1421,9 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				 &fdir_input->flow_ext.flexbytes[dst],
 				 size * sizeof(uint16_t));
 	}
-
+#ifdef RTE_LIBRTE_I40E_DEBUG_FD
+	rte_hexdump(stdout, NULL, raw_pkt, len);
+#endif
 	return 0;
 }
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug Bernard Iremonger
@ 2020-01-16 13:46             ` Ananyev, Konstantin
  0 siblings, 0 replies; 134+ messages in thread
From: Ananyev, Konstantin @ 2020-01-16 13:46 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Byrne, Stephen1, Zhang, Helin



> print function name in port_flow_complain()
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  app/test-pmd/config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index d599682..2753ec5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1303,7 +1303,7 @@ port_flow_complain(struct rte_flow_error *error)
>  		errstr = "unknown type";
>  	else
>  		errstr = errstrlist[error->type];
> -	printf("Caught error type %d (%s): %s%s: %s\n",
> +	printf("%s(): Caught PMD error type %d (%s): %s%s: %s\n", __func__,
>  	       error->type, errstr,
>  	       error->cause ? (snprintf(buf, sizeof(buf), "cause: %p, ",
>  					error->cause), buf) : "",
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.7.4


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

* Re: [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow Director
  2020-01-15 17:26             ` Iremonger, Bernard
@ 2020-01-16 15:38               ` Ferruh Yigit
  0 siblings, 0 replies; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-16 15:38 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

On 1/15/2020 5:26 PM, Iremonger, Bernard wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Yigit, Ferruh <ferruh.yigit@intel.com>
>> Sent: Wednesday, January 15, 2020 4:18 PM
>> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
>> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Doherty, Declan <declan.doherty@intel.com>
>> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
>> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E Flow
>> Director
>>
>> On 1/15/2020 3:53 PM, Bernard Iremonger wrote:
>>> add CONFIG_RTE_LIBRTE_I40E_DEBUG_FD to config/common_base file
>>>
>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>> ---
>>>  config/common_base | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/config/common_base b/config/common_base index
>>> 7dec7ed..7a76c26 100644
>>> --- a/config/common_base
>>> +++ b/config/common_base
>>> @@ -305,6 +305,7 @@ CONFIG_RTE_LIBRTE_I40E_PMD=y
>>> CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
>> CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
>>> CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
>>> +CONFIG_RTE_LIBRTE_I40E_DEBUG_FD=y
>>>  CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
>>>  CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
>>>  CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
>>>
>>
>> Hi Bernard,
>>
>> If the dynamic log won't make in time, what do you think dropping the
>> RTE_LIBRTE_I40E_DEBUG_FD patches for now, it seems it is only for debug,
>> and do the dynamic log support incremental later?
> 
> I have had a look at the existing rte_log() support in the i40e code in i40e_logs.h and i40e_ethdev.c (line 403 +) and lines 12930 +
> The RTE_LIBRTE_I40E_DEBUG_XXX macros are used so this change to config/common_base is needed for dynamic logging too.

These are for datapath, unfortunately we don't have any other option for datapath.

I saw v7 is sent, let me continue to process it dropping this bit.

Thanks,
ferruh

> 
> The PMD_RX_LOG() seems to only do a printf () which is not what I want.
> 
> I would like to keep these two patches which have been acked in the v5 patchset.
> 
> I will continue with the dynamic logging after the merge if that is allowed.
> 
> Regards,
> 
> Bernard
> 
> 
> 


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

* Re: [dpdk-dev] [PATCH v7 00/10] net/i40e: ESP support
  2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 00/10] " Bernard Iremonger
@ 2020-01-16 17:42             ` Ferruh Yigit
  2020-01-21 16:10               ` Iremonger, Bernard
  0 siblings, 1 reply; 134+ messages in thread
From: Ferruh Yigit @ 2020-01-16 17:42 UTC (permalink / raw)
  To: Bernard Iremonger, dev, beilei.xing, qi.z.zhang, declan.doherty
  Cc: konstantin.ananyev, stephen1.byrne, helin.zhang

On 1/16/2020 12:44 PM, Bernard Iremonger wrote:
> Add support for ESP flows to testpmd.
> Improve debug information in testpmd and the i40e PMD.
> Process ESP flows on the i40e Flow Director.
> 
> Changes in V7: 
> -------------
> Dropped the following debug patch from v6 patchset
> 0003-app-testpmd-dump-Rx-and-Tx-mbuf.patch
> Included release notes and doc patches in feature patches.
> 
> Changes in V6: 
> -------------
> Rebase to latest master branch
> Fixed patch 0001-app-testpmd-parse-flow-command-line-for-ESP.patch
> Dropped the following v5 patch due to ABI breakage:
> 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch
> 
> Changes in V5: 
> -------------
> Rebase to latest master branch
> Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch
> 
> Changes in V4: 
> -------------
> Add extra patch for testpmd
> Add extra patch for config
> Split v3 patch "net/i40e: process ESP flows" into 4 patches
> 
> Changes in V3: 
> -------------
> Added i40e_flow_set_filter_spi() function in i40e_flow.c
> Set UDP destination port to 4500 for ESP  in i40e_ethdev.h
> Split flow structures into 4 instead of 2 in i40e_ethdev.h
> Dropped extra printf from commandline_flow.c
> 
> Changes in V2: 
> --------------
> Moved change in app/test-pmd/config.c to a seperate patch.
> Added extra parameter to fill_ip6_head() in i40e_fdir.c
> set is_udp to false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c
> Bernard Iremonger (10):
>   app/testpmd: parse flow command line for ESP
>   app/testpmd: improve debug
>   net/i40e: improve RSS debug
>   net/i40e: handle ESP tunnel
>   net/i40e: support ipsec-ah profile
>   net/i40e: support ESP in customized code
>   net/i40e: support ESP flows
>   net/i40e: support ESP in Flow Director
>   config: add debug to I40E Flow Director
>   net/i40e: display Flow Director packet

Series applied to dpdk-next-net/master, thanks.

(Except 9/10 & 10/10, they are dropped while merging.)

Series wasn't rebased on next-net, I had to resolve conflict almost in all
patches, can you please validate the result in next-net?

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

* Re: [dpdk-dev] [PATCH v7 00/10] net/i40e: ESP support
  2020-01-16 17:42             ` Ferruh Yigit
@ 2020-01-21 16:10               ` Iremonger, Bernard
  0 siblings, 0 replies; 134+ messages in thread
From: Iremonger, Bernard @ 2020-01-21 16:10 UTC (permalink / raw)
  To: Yigit, Ferruh, dev, Xing, Beilei, Zhang, Qi Z, Doherty, Declan
  Cc: Ananyev, Konstantin, Byrne, Stephen1, Zhang, Helin

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Thursday, January 16, 2020 5:43 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Doherty, Declan <declan.doherty@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Byrne, Stephen1
> <stephen1.byrne@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v7 00/10] net/i40e: ESP support
> 
> On 1/16/2020 12:44 PM, Bernard Iremonger wrote:
> > Add support for ESP flows to testpmd.
> > Improve debug information in testpmd and the i40e PMD.
> > Process ESP flows on the i40e Flow Director.
> >
> > Changes in V7:
> > -------------
> > Dropped the following debug patch from v6 patchset
> > 0003-app-testpmd-dump-Rx-and-Tx-mbuf.patch
> > Included release notes and doc patches in feature patches.
> >
> > Changes in V6:
> > -------------
> > Rebase to latest master branch
> > Fixed patch 0001-app-testpmd-parse-flow-command-line-for-ESP.patch
> > Dropped the following v5 patch due to ABI breakage:
> > 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch
> >
> > Changes in V5:
> > -------------
> > Rebase to latest master branch
> > Update 0012-librte_ethdev-add-ESP-and-AH-flow-types-to-RSS.patch
> >
> > Changes in V4:
> > -------------
> > Add extra patch for testpmd
> > Add extra patch for config
> > Split v3 patch "net/i40e: process ESP flows" into 4 patches
> >
> > Changes in V3:
> > -------------
> > Added i40e_flow_set_filter_spi() function in i40e_flow.c Set UDP
> > destination port to 4500 for ESP  in i40e_ethdev.h Split flow
> > structures into 4 instead of 2 in i40e_ethdev.h Dropped extra printf
> > from commandline_flow.c
> >
> > Changes in V2:
> > --------------
> > Moved change in app/test-pmd/config.c to a seperate patch.
> > Added extra parameter to fill_ip6_head() in i40e_fdir.c set is_udp to
> > false in i40e_flow_fdir_get_pctype_value() in i40e_flow.c Bernard
> > Iremonger (10):
> >   app/testpmd: parse flow command line for ESP
> >   app/testpmd: improve debug
> >   net/i40e: improve RSS debug
> >   net/i40e: handle ESP tunnel
> >   net/i40e: support ipsec-ah profile
> >   net/i40e: support ESP in customized code
> >   net/i40e: support ESP flows
> >   net/i40e: support ESP in Flow Director
> >   config: add debug to I40E Flow Director
> >   net/i40e: display Flow Director packet
> 
> Series applied to dpdk-next-net/master, thanks.
> 
> (Except 9/10 & 10/10, they are dropped while merging.)
> 
> Series wasn't rebased on next-net, I had to resolve conflict almost in all
> patches, can you please validate the result in next-net?

I have tested  the merged result in DPDK 20.02-rc1.
I found an issue with i40e_fdir.c, I have sent a patch to fix the issue.

Regards,

Bernard.


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

end of thread, back to index

Thread overview: 134+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 12:57 [dpdk-dev] [PATCH 0/9] net/i40e: ESP support Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
2019-12-10 21:12   ` Ori Kam
2019-12-11  9:24     ` Iremonger, Bernard
2019-12-10 12:57 ` [dpdk-dev] [PATCH 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 3/9] net/i40e: improve RSS debug Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 5/9] net/i40e: process ESP flows Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 6/9] net/i40e: display Flow Director packet Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
2019-12-10 18:27   ` Stephen Hemminger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 8/9] doc: release note for ESP Bernard Iremonger
2019-12-10 12:57 ` [dpdk-dev] [PATCH 9/9] doc: update i40e user guide Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 00/10] net/i40e: ESP support Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 0/9] " Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 00/14] " Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
2020-01-15  1:47         ` Zhang, Qi Z
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-14 19:03         ` Ferruh Yigit
2020-01-15  9:08           ` Iremonger, Bernard
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 00/13] net/i40e: ESP support Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 00/10] " Bernard Iremonger
2020-01-16 17:42             ` Ferruh Yigit
2020-01-21 16:10               ` Iremonger, Bernard
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 02/10] app/testpmd: improve debug Bernard Iremonger
2020-01-16 13:46             ` Ananyev, Konstantin
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 03/10] net/i40e: improve RSS debug Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 04/10] net/i40e: handle ESP tunnel Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 05/10] net/i40e: support ipsec-ah profile Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 06/10] net/i40e: support ESP in customized code Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 07/10] net/i40e: support ESP flows Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 08/10] net/i40e: support ESP in Flow Director Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 09/10] config: add debug to I40E " Bernard Iremonger
2020-01-16 12:44           ` [dpdk-dev] [PATCH v7 10/10] net/i40e: display Flow Director packet Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 01/13] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 02/13] app/testpmd: improve debug Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 03/13] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2020-01-15 16:28           ` Ferruh Yigit
2020-01-15 16:52             ` Iremonger, Bernard
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 04/13] net/i40e: improve RSS debug Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 05/13] net/i40e: handle ESP tunnel Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 06/13] net/i40e: support ipsec-ah profile Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 07/13] net/i40e: support ESP in customized code Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 08/13] net/i40e: support ESP flows Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 09/13] net/i40e: support ESP in Flow Director Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 10/13] config: add debug to I40E " Bernard Iremonger
2020-01-15 16:17           ` Ferruh Yigit
2020-01-15 17:26             ` Iremonger, Bernard
2020-01-16 15:38               ` Ferruh Yigit
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 11/13] net/i40e: display Flow Director packet Bernard Iremonger
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 12/13] doc: release note for ESP Bernard Iremonger
2020-01-15 16:20           ` Ferruh Yigit
2020-01-15 16:58             ` Iremonger, Bernard
2020-01-15 15:53         ` [dpdk-dev] [PATCH v6 13/13] doc: update i40e user guide Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 02/14] app/testpmd: improve debug Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 04/14] net/i40e: improve RSS debug Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 07/14] net/i40e: support ESP in customised code Bernard Iremonger
2020-01-15  1:24         ` Zhang, Qi Z
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 08/14] net/i40e: support ESP flows Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 10/14] config: add debug to I40E " Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 11/14] net/i40e: display Flow Director packet Bernard Iremonger
2020-01-14 18:52         ` Ferruh Yigit
2020-01-15  9:18           ` Iremonger, Bernard
2020-01-15 10:58             ` Ferruh Yigit
2020-01-15 15:08               ` Iremonger, Bernard
2020-01-15  0:20         ` Zhang, Qi Z
2020-01-15  1:32           ` Zhang, Qi Z
2020-01-15  9:25           ` Iremonger, Bernard
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
2020-01-14 18:45         ` Ferruh Yigit
2020-01-15  9:13           ` Andrew Rybchenko
2020-01-15 10:44             ` Ferruh Yigit
2020-01-15 10:55               ` Andrew Rybchenko
2020-01-15 12:28                 ` Ferruh Yigit
2020-01-15 14:11                   ` Iremonger, Bernard
2020-01-15 14:36                     ` Ferruh Yigit
2020-01-15  0:13         ` Zhang, Qi Z
2020-01-15  9:41           ` Iremonger, Bernard
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 13/14] doc: release note for ESP Bernard Iremonger
2020-01-14 13:55       ` [dpdk-dev] [PATCH v5 14/14] doc: update i40e user guide Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 01/14] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 02/14] app/testpmd: improve debug Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 03/14] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 04/14] net/i40e: improve RSS debug Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 05/14] net/i40e: handle ESP tunnel Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 06/14] net/i40e: support ipsec-ah profile Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 07/14] net/i40e: support ESP in customised code Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 08/14] net/i40e: support ESP flows Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 09/14] net/i40e: support ESP in Flow Director Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 10/14] config: add debug to I40E " Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 11/14] net/i40e: display Flow Director packet Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 12/14] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 13/14] doc: release note for ESP Bernard Iremonger
2020-01-10 15:20     ` [dpdk-dev] [PATCH v4 14/14] doc: update i40e user guide Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 1/9] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 3/9] net/i40e: improve RSS debug Bernard Iremonger
2020-01-09 13:44     ` Zhang, Qi Z
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 4/9] net/i40e: handle ESP tunnel Bernard Iremonger
2020-01-09 14:08     ` Zhang, Qi Z
2020-01-09 14:21       ` Iremonger, Bernard
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 5/9] net/i40e: process ESP flows Bernard Iremonger
2020-01-09 14:00     ` Zhang, Qi Z
2020-01-13 11:56       ` Iremonger, Bernard
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 6/9] net/i40e: display Flow Director packet Bernard Iremonger
2020-01-09 12:44     ` Zhang, Qi Z
2020-01-09 14:02       ` Iremonger, Bernard
2020-01-09 14:11         ` Zhang, Qi Z
2020-01-09 14:30           ` Iremonger, Bernard
2020-01-09 23:07         ` Ananyev, Konstantin
2020-01-10  9:20           ` Iremonger, Bernard
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 7/9] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 8/9] doc: release note for ESP Bernard Iremonger
2020-01-09 12:16   ` [dpdk-dev] [PATCH v3 9/9] doc: update i40e user guide Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 01/10] app/testpmd: parse flow command line for ESP Bernard Iremonger
2020-01-08 14:43   ` Ori Kam
2020-01-08 16:16     ` Iremonger, Bernard
2020-01-09  6:29       ` Ori Kam
2020-01-09  9:16         ` Iremonger, Bernard
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 02/10] app/testpmd: improve debug code Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 03/10] app/testpmd: dump Rx and Tx mbuf Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 04/10] net/i40e: improve RSS debug Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 05/10] net/i40e: handle ESP tunnel Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 06/10] net/i40e: process ESP flows Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 07/10] net/i40e: display Flow Director packet Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 08/10] librte_ethdev: add ESP and AH flow types to RSS Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 09/10] doc: release note for ESP Bernard Iremonger
2019-12-17 10:15 ` [dpdk-dev] [PATCH v2 10/10] doc: update i40e user guide Bernard Iremonger

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox