DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet
       [not found] <20210527074845.1263679>
@ 2021-06-02  2:24 ` Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 1/4] net/iavf: support flow pattern for GRE Wenjun Wu
                     ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wenjun Wu @ 2021-06-02  2:24 UTC (permalink / raw)
  To: dev, qi.z.zhang, jingjing.wu, beilei.xing; +Cc: Wenjun Wu

[PATCH v2 1/4] net/iavf: support flow pattern for GRE
[PATCH v2 2/4] common/iavf: add header types for GRE
[PATCH v2 3/4] net/iavf: support AVF RSS for GRE tunnel packet
[PATCH v2 4/4] net/iavf: support AVF FDIR for GRE tunnel packet

v2:
* Delete the share code patch, because it is not necessary for this
  patch set.
* Delete the definition of ETH_RSS_GRE and related dependencies,
  because GRE header is not needed for hash input set.

Wenjun Wu (4):
  net/iavf: support flow pattern for GRE
  common/iavf: add header types for GRE
  net/iavf: support AVF RSS for GRE tunnel packet
  net/iavf: support AVF FDIR for GRE tunnel packet

 drivers/common/iavf/virtchnl.h       |   1 +
 drivers/net/iavf/iavf_fdir.c         |  55 ++++++++++++++
 drivers/net/iavf/iavf_generic_flow.c | 105 +++++++++++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  14 ++++
 drivers/net/iavf/iavf_hash.c         |  27 +++++--
 5 files changed, 197 insertions(+), 5 deletions(-)

-- 
2.25.1


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

* [dpdk-dev] [PATCH v2 1/4] net/iavf: support flow pattern for GRE
  2021-06-02  2:24 ` [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet Wenjun Wu
@ 2021-06-02  2:24   ` Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 2/4] common/iavf: add header types " Wenjun Wu
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Wenjun Wu @ 2021-06-02  2:24 UTC (permalink / raw)
  To: dev, qi.z.zhang, jingjing.wu, beilei.xing; +Cc: Wenjun Wu

Add GRE pattern support for AVF FDIR and RSS.

Patterns are listed below:
  1. eth/ipv4/gre/ipv4
  2. eth/ipv4/gre/ipv6
  3. eth/ipv6/gre/ipv4
  4. eth/ipv6/gre/ipv6
  5. eth/ipv4/gre/ipv4/tcp
  6. eth/ipv4/gre/ipv6/tcp
  7. eth/ipv4/gre/ipv4/udp
  8. eth/ipv4/gre/ipv6/udp
  9. eth/ipv6/gre/ipv4/tcp
  10. eth/ipv6/gre/ipv6/tcp
  11. eth/ipv6/gre/ipv4/udp
  12. eth/ipv6/gre/ipv6/udp

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/iavf/iavf_generic_flow.c | 105 +++++++++++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  14 ++++
 2 files changed, 119 insertions(+)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 242bb4abc5..d9ba5735b2 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -822,6 +822,111 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* GRE */
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_tcp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_udp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_tcp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_udp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_tcp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_TCP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_GRE,
+	RTE_FLOW_ITEM_TYPE_IPV6,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
 typedef struct iavf_flow_engine * (*parse_engine_t)(struct iavf_adapter *ad,
 		struct rte_flow *flow,
 		struct iavf_parser_list *parser_list,
diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h
index e19da15518..48fd03a973 100644
--- a/drivers/net/iavf/iavf_generic_flow.h
+++ b/drivers/net/iavf/iavf_generic_flow.h
@@ -308,6 +308,20 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_pfcp[];
 extern enum rte_flow_item_type iavf_pattern_eth_ecpri[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[];
 
+/* GRE */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[];
+
 extern const struct rte_flow_ops iavf_flow_ops;
 
 /* pattern structure */
-- 
2.25.1


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

* [dpdk-dev] [PATCH v2 2/4] common/iavf: add header types for GRE
  2021-06-02  2:24 ` [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 1/4] net/iavf: support flow pattern for GRE Wenjun Wu
@ 2021-06-02  2:24   ` Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 3/4] net/iavf: support AVF RSS for GRE tunnel packet Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR " Wenjun Wu
  3 siblings, 0 replies; 6+ messages in thread
From: Wenjun Wu @ 2021-06-02  2:24 UTC (permalink / raw)
  To: dev, qi.z.zhang, jingjing.wu, beilei.xing; +Cc: Wenjun Wu

Add a virtchnl protocol header type to support AVF FDIR and RSS for GRE.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/common/iavf/virtchnl.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 3a60faff93..197edce8a1 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -1504,6 +1504,7 @@ enum virtchnl_proto_hdr_type {
 	 */
 	VIRTCHNL_PROTO_HDR_IPV4_FRAG,
 	VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG,
+	VIRTCHNL_PROTO_HDR_GRE,
 };
 
 /* Protocol header field within a protocol header. */
-- 
2.25.1


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

* [dpdk-dev] [PATCH v2 3/4] net/iavf: support AVF RSS for GRE tunnel packet
  2021-06-02  2:24 ` [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 1/4] net/iavf: support flow pattern for GRE Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 2/4] common/iavf: add header types " Wenjun Wu
@ 2021-06-02  2:24   ` Wenjun Wu
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR " Wenjun Wu
  3 siblings, 0 replies; 6+ messages in thread
From: Wenjun Wu @ 2021-06-02  2:24 UTC (permalink / raw)
  To: dev, qi.z.zhang, jingjing.wu, beilei.xing; +Cc: Wenjun Wu

Support AVF RSS for inner header of GRE tunnel packet. It supports
RSS based on fields inner IP src + dst address and TCP/UDP src + dst
port.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 5d3d62839b..f4f0bcbfef 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -30,6 +30,7 @@
 #define	IAVF_PHINT_GTPU_EH_UP			BIT_ULL(3)
 #define IAVF_PHINT_OUTER_IPV4			BIT_ULL(4)
 #define IAVF_PHINT_OUTER_IPV6			BIT_ULL(5)
+#define IAVF_PHINT_GRE				BIT_ULL(6)
 
 #define IAVF_PHINT_GTPU_MSK	(IAVF_PHINT_GTPU	| \
 				 IAVF_PHINT_GTPU_EH	| \
@@ -428,6 +429,12 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv4_gtpc,			ETH_RSS_IPV4,			&ipv4_udp_gtpc_tmplt},
 	{iavf_pattern_eth_ecpri,			ETH_RSS_ECPRI,			&eth_ecpri_tmplt},
 	{iavf_pattern_eth_ipv4_ecpri,			ETH_RSS_ECPRI,			&ipv4_ecpri_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv4,		IAVF_RSS_TYPE_INNER_IPV4,	&inner_ipv4_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv4,		IAVF_RSS_TYPE_INNER_IPV4, &inner_ipv4_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv4_tcp,	IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv4_tcp,	IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv4_udp,	IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt},
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_frag_ext,		IAVF_RSS_TYPE_OUTER_IPV6_FRAG,	&outer_ipv6_frag_tmplt},
@@ -458,6 +465,12 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv6_l2tpv3,			IAVF_RSS_TYPE_IPV6_L2TPV3,	&ipv6_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv6_pfcp,			IAVF_RSS_TYPE_IPV6_PFCP,	&ipv6_pfcp_tmplt},
 	{iavf_pattern_eth_ipv6_gtpc,			ETH_RSS_IPV6,			&ipv6_udp_gtpc_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv6,		IAVF_RSS_TYPE_INNER_IPV6,	&inner_ipv6_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv6,		IAVF_RSS_TYPE_INNER_IPV6, &inner_ipv6_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv6_tcp,	IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv6_tcp,	IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt},
+	{iavf_pattern_eth_ipv4_gre_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
+	{iavf_pattern_eth_ipv6_gre_ipv6_udp,	IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt},
 };
 
 static struct iavf_flow_engine iavf_hash_engine = {
@@ -592,11 +605,11 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 
 		switch (item->type) {
 		case RTE_FLOW_ITEM_TYPE_IPV4:
-			if (!(*phint & IAVF_PHINT_GTPU_MSK))
+			if (!(*phint & IAVF_PHINT_GTPU_MSK) && !(*phint & IAVF_PHINT_GRE))
 				*phint |= IAVF_PHINT_OUTER_IPV4;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
-			if (!(*phint & IAVF_PHINT_GTPU_MSK))
+			if (!(*phint & IAVF_PHINT_GTPU_MSK) && !(*phint & IAVF_PHINT_GRE))
 				*phint |= IAVF_PHINT_OUTER_IPV6;
 			break;
 		case RTE_FLOW_ITEM_TYPE_GTPU:
@@ -627,6 +640,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 				return -rte_errno;
 			}
 			break;
+		case RTE_FLOW_ITEM_TYPE_GRE:
+			*phint |= IAVF_PHINT_GRE;
 		default:
 			break;
 		}
@@ -867,7 +882,7 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs,
 	struct virtchnl_proto_hdr *hdr2;
 	int i, shift_count = 1;
 
-	if (!(phint & IAVF_PHINT_GTPU_MSK))
+	if (!(phint & IAVF_PHINT_GTPU_MSK) && !(phint & IAVF_PHINT_GRE))
 		return;
 
 	if (phint & IAVF_PHINT_LAYERS_MSK)
@@ -883,10 +898,10 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs,
 		}
 
 		if (shift_count == 1) {
-			/* adding gtpu header at layer 0 */
+			/* adding tunnel header at layer 0 */
 			hdr1 = &proto_hdrs->proto_hdr[0];
 		} else {
-			/* adding gtpu header and outer ip header */
+			/* adding tunnel header and outer ip header */
 			hdr1 = &proto_hdrs->proto_hdr[1];
 			hdr2 = &proto_hdrs->proto_hdr[0];
 			hdr2->field_selector = 0;
@@ -913,6 +928,8 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs,
 		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_EH);
 	else if (phint & IAVF_PHINT_GTPU)
 		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GTPU_IP);
+	else if (phint & IAVF_PHINT_GRE)
+		VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, GRE);
 }
 
 static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs,
-- 
2.25.1


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

* [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR for GRE tunnel packet
  2021-06-02  2:24 ` [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet Wenjun Wu
                     ` (2 preceding siblings ...)
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 3/4] net/iavf: support AVF RSS for GRE tunnel packet Wenjun Wu
@ 2021-06-02  2:24   ` Wenjun Wu
  2021-06-10 16:18     ` Singh, Aman Deep
  3 siblings, 1 reply; 6+ messages in thread
From: Wenjun Wu @ 2021-06-02  2:24 UTC (permalink / raw)
  To: dev, qi.z.zhang, jingjing.wu, beilei.xing; +Cc: Wenjun Wu

Support AVF FDIR for inner header of GRE tunnel packet.

+------------------------------+---------------------------------------+
|           Pattern            |            Input Set                  |
+------------------------------+---------------------------------------+
| eth/ipv4/gre/ipv4            | inner: src/dst ip, dscp               |
| eth/ipv4/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv4/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv4/gre/eh/ipv6         | inner: src/dst ip, tc                 |
| eth/ipv4/gre/eh/ipv6/udp     | inner: src/dst ip, tc, src/dst port   |
| eth/ipv4/gre/eh/ipv6/tcp     | inner: src/dst ip, tc, src/dst port   |
| eth/ipv6/gre/ipv4            | inner: src/dst ip, dscp               |
| eth/ipv6/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv6/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv6/gre/ipv6            | inner: src/dst ip, tc                 |
| eth/ipv6/gre/ipv6/udp        | inner: src/dst ip, tc, src/dst port   |
| eth/ipv6/gre/ipv6/tcp        | inner: src/dst ip, tc, src/dst port   |
+------------------------------+---------------------------------------+

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/iavf/iavf_fdir.c | 55 ++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index f238a83c84..c0b748caca 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -139,6 +139,30 @@
 #define IAVF_FDIR_INSET_ECPRI (\
 	IAVF_INSET_ECPRI)
 
+#define IAVF_FDIR_INSET_GRE_IPV4 (\
+	IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST | \
+	IAVF_INSET_TUN_IPV4_TOS | IAVF_INSET_TUN_IPV4_PROTO)
+
+#define IAVF_FDIR_INSET_GRE_IPV4_TCP (\
+	IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+	IAVF_INSET_TUN_TCP_DST_PORT)
+
+#define IAVF_FDIR_INSET_GRE_IPV4_UDP (\
+	IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+	IAVF_INSET_TUN_UDP_DST_PORT)
+
+#define IAVF_FDIR_INSET_GRE_IPV6 (\
+	IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST | \
+	IAVF_INSET_TUN_IPV6_TC | IAVF_INSET_TUN_IPV6_NEXT_HDR)
+
+#define IAVF_FDIR_INSET_GRE_IPV6_TCP (\
+	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \
+	IAVF_INSET_TUN_TCP_DST_PORT)
+
+#define IAVF_FDIR_INSET_GRE_IPV6_UDP (\
+	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
+	IAVF_INSET_TUN_UDP_DST_PORT)
+
 static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
 	{iavf_pattern_ethertype,		 IAVF_FDIR_INSET_ETH,		IAVF_INSET_NONE},
 	{iavf_pattern_eth_ipv4,			 IAVF_FDIR_INSET_ETH_IPV4,	IAVF_INSET_NONE},
@@ -178,6 +202,18 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
 	{iavf_pattern_eth_ipv6_pfcp,		 IAVF_FDIR_INSET_PFCP,		IAVF_INSET_NONE},
 	{iavf_pattern_eth_ecpri,		 IAVF_FDIR_INSET_ECPRI,		IAVF_INSET_NONE},
 	{iavf_pattern_eth_ipv4_ecpri,		 IAVF_FDIR_INSET_ECPRI,		IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv4,	IAVF_FDIR_INSET_GRE_IPV4,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv4_tcp,	IAVF_FDIR_INSET_GRE_IPV4_TCP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv4_udp,	IAVF_FDIR_INSET_GRE_IPV4_UDP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv6,	IAVF_FDIR_INSET_GRE_IPV6,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv6_tcp,	IAVF_FDIR_INSET_GRE_IPV6_TCP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv4_gre_ipv6_udp,	IAVF_FDIR_INSET_GRE_IPV6_UDP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv4,	IAVF_FDIR_INSET_GRE_IPV4,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv4_tcp,	IAVF_FDIR_INSET_GRE_IPV4_TCP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv4_udp,	IAVF_FDIR_INSET_GRE_IPV4_UDP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv6,	IAVF_FDIR_INSET_GRE_IPV6,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv6_tcp,	IAVF_FDIR_INSET_GRE_IPV6_TCP,	IAVF_INSET_NONE},
+	{iavf_pattern_eth_ipv6_gre_ipv6_udp,	IAVF_FDIR_INSET_GRE_IPV6_UDP,	IAVF_INSET_NONE},
 };
 
 static struct iavf_flow_parser iavf_fdir_parser;
@@ -596,6 +632,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 	const struct rte_flow_item_ah *ah_spec, *ah_mask;
 	const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;
 	const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;
+	const struct rte_flow_item_gre *gre_spec, *gre_mask;
 	const struct rte_flow_item *item = pattern;
 	struct virtchnl_proto_hdr *hdr, *hdr1 = NULL;
 	struct rte_ecpri_common_hdr ecpri_common;
@@ -1195,6 +1232,24 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 			hdrs->count = ++layer;
 			break;
 
+		case RTE_FLOW_ITEM_TYPE_GRE:
+			gre_spec = item->spec;
+			gre_mask = item->mask;
+
+			hdr = &hdrs->proto_hdr[layer];
+
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE);
+
+			if (gre_spec && gre_mask) {
+				rte_memcpy(hdr->buffer, gre_spec,
+					   sizeof(*gre_spec));
+			}
+
+			tun_inner = 1;
+
+			hdrs->count = ++layer;
+			break;
+
 		case RTE_FLOW_ITEM_TYPE_VOID:
 			break;
 
-- 
2.25.1


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

* [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR for GRE tunnel packet
  2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR " Wenjun Wu
@ 2021-06-10 16:18     ` Singh, Aman Deep
  0 siblings, 0 replies; 6+ messages in thread
From: Singh, Aman Deep @ 2021-06-10 16:18 UTC (permalink / raw)
  To: dev


On 6/2/2021 7:54 AM, Wenjun Wu wrote:
> Support AVF FDIR for inner header of GRE tunnel packet.
>
> +------------------------------+---------------------------------------+
> |           Pattern            |            Input Set                  |
> +------------------------------+---------------------------------------+
> | eth/ipv4/gre/ipv4            | inner: src/dst ip, dscp               |
> | eth/ipv4/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
> | eth/ipv4/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
> | eth/ipv4/gre/eh/ipv6         | inner: src/dst ip, tc                 |
> | eth/ipv4/gre/eh/ipv6/udp     | inner: src/dst ip, tc, src/dst port   |
> | eth/ipv4/gre/eh/ipv6/tcp     | inner: src/dst ip, tc, src/dst port   |
> | eth/ipv6/gre/ipv4            | inner: src/dst ip, dscp               |
> | eth/ipv6/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
> | eth/ipv6/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
> | eth/ipv6/gre/ipv6            | inner: src/dst ip, tc                 |
> | eth/ipv6/gre/ipv6/udp        | inner: src/dst ip, tc, src/dst port   |
> | eth/ipv6/gre/ipv6/tcp        | inner: src/dst ip, tc, src/dst port   |
> +------------------------------+---------------------------------------+
>
> Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
> ---
>   drivers/net/iavf/iavf_fdir.c | 55 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 55 insertions(+)
>
> diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
> index f238a83c84..c0b748caca 100644
> --- a/drivers/net/iavf/iavf_fdir.c
> +++ b/drivers/net/iavf/iavf_fdir.c
> @@ -139,6 +139,30 @@
>   #define IAVF_FDIR_INSET_ECPRI (\
>   	IAVF_INSET_ECPRI)
>   
> +#define IAVF_FDIR_INSET_GRE_IPV4 (\
> +	IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST | \
> +	IAVF_INSET_TUN_IPV4_TOS | IAVF_INSET_TUN_IPV4_PROTO)
> +
> +#define IAVF_FDIR_INSET_GRE_IPV4_TCP (\
> +	IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \
> +	IAVF_INSET_TUN_TCP_DST_PORT)
> +
> +#define IAVF_FDIR_INSET_GRE_IPV4_UDP (\
> +	IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \
> +	IAVF_INSET_TUN_UDP_DST_PORT)
> +
> +#define IAVF_FDIR_INSET_GRE_IPV6 (\
> +	IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST | \
> +	IAVF_INSET_TUN_IPV6_TC | IAVF_INSET_TUN_IPV6_NEXT_HDR)
> +
> +#define IAVF_FDIR_INSET_GRE_IPV6_TCP (\
> +	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \
> +	IAVF_INSET_TUN_TCP_DST_PORT)
> +
> +#define IAVF_FDIR_INSET_GRE_IPV6_UDP (\
> +	IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \
> +	IAVF_INSET_TUN_UDP_DST_PORT)
> +
>   static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
>   	{iavf_pattern_ethertype,		 IAVF_FDIR_INSET_ETH,		IAVF_INSET_NONE},
>   	{iavf_pattern_eth_ipv4,			 IAVF_FDIR_INSET_ETH_IPV4,	IAVF_INSET_NONE},
> @@ -178,6 +202,18 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
>   	{iavf_pattern_eth_ipv6_pfcp,		 IAVF_FDIR_INSET_PFCP,		IAVF_INSET_NONE},
>   	{iavf_pattern_eth_ecpri,		 IAVF_FDIR_INSET_ECPRI,		IAVF_INSET_NONE},
>   	{iavf_pattern_eth_ipv4_ecpri,		 IAVF_FDIR_INSET_ECPRI,		IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv4,	IAVF_FDIR_INSET_GRE_IPV4,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv4_tcp,	IAVF_FDIR_INSET_GRE_IPV4_TCP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv4_udp,	IAVF_FDIR_INSET_GRE_IPV4_UDP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv6,	IAVF_FDIR_INSET_GRE_IPV6,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv6_tcp,	IAVF_FDIR_INSET_GRE_IPV6_TCP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv4_gre_ipv6_udp,	IAVF_FDIR_INSET_GRE_IPV6_UDP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv4,	IAVF_FDIR_INSET_GRE_IPV4,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv4_tcp,	IAVF_FDIR_INSET_GRE_IPV4_TCP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv4_udp,	IAVF_FDIR_INSET_GRE_IPV4_UDP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv6,	IAVF_FDIR_INSET_GRE_IPV6,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv6_tcp,	IAVF_FDIR_INSET_GRE_IPV6_TCP,	IAVF_INSET_NONE},
> +	{iavf_pattern_eth_ipv6_gre_ipv6_udp,	IAVF_FDIR_INSET_GRE_IPV6_UDP,	IAVF_INSET_NONE},
>   };
>   
>   static struct iavf_flow_parser iavf_fdir_parser;
> @@ -596,6 +632,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
>   	const struct rte_flow_item_ah *ah_spec, *ah_mask;
>   	const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask;
>   	const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask;
> +	const struct rte_flow_item_gre *gre_spec, *gre_mask;
>   	const struct rte_flow_item *item = pattern;
>   	struct virtchnl_proto_hdr *hdr, *hdr1 = NULL;
>   	struct rte_ecpri_common_hdr ecpri_common;
> @@ -1195,6 +1232,24 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
>   			hdrs->count = ++layer;
>   			break;
>   
> +		case RTE_FLOW_ITEM_TYPE_GRE:
> +			gre_spec = item->spec;
> +			gre_mask = item->mask;
> +
> +			hdr = &hdrs->proto_hdr[layer];
> +
> +			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE);
> +
> +			if (gre_spec && gre_mask) {
> +				rte_memcpy(hdr->buffer, gre_spec,
> +					   sizeof(*gre_spec));
> +			}
> +
> +			tun_inner = 1;
> +
> +			hdrs->count = ++layer;
> +			break;
> +
>   		case RTE_FLOW_ITEM_TYPE_VOID:
>   			break;
>   

Support AVF FDIR for inner header of GRE tunnel packet.

+------------------------------+---------------------------------------+
|           Pattern            |            Input Set                  |
+------------------------------+---------------------------------------+
| eth/ipv4/gre/ipv4            | inner: src/dst ip, dscp               |
| eth/ipv4/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv4/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv4/gre/eh/ipv6         | inner: src/dst ip, tc                 |
| eth/ipv4/gre/eh/ipv6/udp     | inner: src/dst ip, tc, src/dst port   |
| eth/ipv4/gre/eh/ipv6/tcp     | inner: src/dst ip, tc, src/dst port   |
| eth/ipv6/gre/ipv4            | inner: src/dst ip, dscp               |
| eth/ipv6/gre/ipv4/udp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv6/gre/ipv4/tcp        | inner: src/dst ip, dscp, src/dst port |
| eth/ipv6/gre/ipv6            | inner: src/dst ip, tc                 |
| eth/ipv6/gre/ipv6/udp        | inner: src/dst ip, tc, src/dst port   |
| eth/ipv6/gre/ipv6/tcp        | inner: src/dst ip, tc, src/dst port   |
+------------------------------+---------------------------------------+

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com> Acked-by: Aman Deep 
Singh <aman.deep.singh@intel.com <mailto:aman.deep.singh@intel.com>>


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

end of thread, other threads:[~2021-06-10 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210527074845.1263679>
2021-06-02  2:24 ` [dpdk-dev] [PATCH v2 0/4] support AVF RSS and FDIR for GRE tunnel packet Wenjun Wu
2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 1/4] net/iavf: support flow pattern for GRE Wenjun Wu
2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 2/4] common/iavf: add header types " Wenjun Wu
2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 3/4] net/iavf: support AVF RSS for GRE tunnel packet Wenjun Wu
2021-06-02  2:24   ` [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR " Wenjun Wu
2021-06-10 16:18     ` Singh, Aman Deep

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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