Skip to contentSkip to conversation

support eCPRI MSG TYPE 0 for AVF FDIR and RSS

PATCH Applied Junfeng Guo 3 participants 9 messages Dec 14, 2020 – Jan 5, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

cover support eCPRI MSG TYPE 0 for AVF FDIR and RSS

This patch set enables eCPRI Message Type 0 with input set physical channel ID in rte_flow for AVF FDIR and RSS.

[PATCH 1/5] common/iavf: add proto hdr flds support for eCPRI. [PATCH 2/5] net/iavf: support flow patterns for eCPRI. [PATCH 3/5] net/iavf: define new bits for eCPRI. [PATCH 4/5] net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR. [PATCH 5/5] net/iavf: support eCPRI MSG TYPE 0 for RSS.

Junfeng Guo (3):
common/iavf: add proto hdr flds support for eCPRI net/iavf: define new bits for eCPRI net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR

Simei Su (2):
net/iavf: support flow patterns for eCPRI
net/iavf: support eCPRI MSG TYPE 0 for RSS

 drivers/common/iavf/virtchnl.h       |  5 ++++
 drivers/net/iavf/iavf_fdir.c         | 32 ++++++++++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.c | 15 ++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  8 ++++++-
 drivers/net/iavf/iavf_hash.c         | 34 ++++++++++++++++++++++++++++
 5 files changed, 93 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 common/iavf: add proto hdr flds support for eCPRI

Add eCPRI header and its field selectors, including MSG_TYPE, PCID and RTCID. Since the offset of PCID is same as RTCID, we just add one MACRO for these two fields. For MSG Type 0, ecpriRtcid/ecpriPcid field within the eCPRI header will be extracted to Field Vector for FDIR and RSS.

SPEC for eCPRI:
http://www.cpri.info/downloads/eCPRI_v_2.0_2019_05_10c.pdf

---
 drivers/common/iavf/virtchnl.h | 5 +++++
 1 file changed, 5 insertions(+)
drivers/common/iavf/virtchnl.h +5 -0
index b931da61e5..fcbaa31fa8 100644
@@ -890,6 +890,7 @@ enum virtchnl_proto_hdr_type {
 	VIRTCHNL_PROTO_HDR_AH,
 	VIRTCHNL_PROTO_HDR_PFCP,
 	VIRTCHNL_PROTO_HDR_GTPC,
+	VIRTCHNL_PROTO_HDR_ECPRI,
 };
 
 /* Protocol header field within a protocol header. */
@@ -970,6 +971,10 @@ enum virtchnl_proto_hdr_field {
 	/* GTPC */
 	VIRTCHNL_PROTO_HDR_GTPC_TEID =
 		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPC),
+	/* ECPRI */
+	VIRTCHNL_PROTO_HDR_ECPRI_MSG_TYPE =
+		PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_ECPRI),
+	VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID,
 };
 
 struct virtchnl_proto_hdr {
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/5 net/iavf: support flow patterns for eCPRI

In reply to Junfeng Guo

From: Simei Su <[email protected]>

Add patterns support for eCPRI.
Added patterns are as follows:
eth_ecpri
eth_ipv4_ecpri

---
 drivers/net/iavf/iavf_generic_flow.c | 15 +++++++++++++++
 drivers/net/iavf/iavf_generic_flow.h |  3 +++
 2 files changed, 18 insertions(+)
drivers/net/iavf/iavf_generic_flow.c +15 -0
index 00e7f15c33..aabbcf34c2 100644
@@ -783,6 +783,21 @@ enum rte_flow_item_type iavf_pattern_eth_ipv6_pfcp[] = {
 	RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* ECPRI */
+enum rte_flow_item_type iavf_pattern_eth_ecpri[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_ECPRI,
+	RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[] = {
+	RTE_FLOW_ITEM_TYPE_ETH,
+	RTE_FLOW_ITEM_TYPE_IPV4,
+	RTE_FLOW_ITEM_TYPE_UDP,
+	RTE_FLOW_ITEM_TYPE_ECPRI,
+	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,
drivers/net/iavf/iavf_generic_flow.h +3 -0
index efc7f2200e..9e518bd14c 100644
@@ -262,6 +262,9 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_l2tpv3[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_pfcp[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv6_pfcp[];
 
+/* ECPRI */
+extern enum rte_flow_item_type iavf_pattern_eth_ecpri[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[];
 
 extern const struct rte_flow_ops iavf_flow_ops;
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/5 net/iavf: define new bits for eCPRI

In reply to Junfeng Guo

Define new bits of protocol header, field and input set for eCPRI.

---
 drivers/net/iavf/iavf_generic_flow.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_generic_flow.h +4 -1
index 9e518bd14c..0ccf5901b4 100644
@@ -34,6 +34,7 @@
 #define IAVF_PROT_AH		    (1ULL << 23)
 #define IAVF_PROT_L2TPV3OIP	    (1ULL << 24)
 #define IAVF_PROT_PFCP		    (1ULL << 25)
+#define IAVF_PROT_ECPRI		    (1ULL << 26)
 
 
 /* field */
@@ -59,6 +60,7 @@
 #define IAVF_L2TPV3OIP_SESSION_ID   (1ULL << 45)
 #define IAVF_PFCP_S_FIELD	    (1ULL << 44)
 #define IAVF_PFCP_SEID		    (1ULL << 43)
+#define IAVF_ECPRI_PC_RTC_ID	    (1ULL << 42)
 
 /* input set */
 
@@ -135,7 +137,8 @@
 	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD)
 #define IAVF_INSET_PFCP_SEID \
 	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
-
+#define IAVF_INSET_ECPRI \
+	(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
 
 /* empty pattern */
 extern enum rte_flow_item_type iavf_pattern_empty[];
Signature · 1 line
2.25.1
#4 lore raw

Re: [dpdk-dev] [PATCH 3/5] net/iavf: define new bits for eCPRI

Quoted 29 lines · Junfeng Guo

Define new bits of protocol header, field and input set for eCPRI.

---
  drivers/net/iavf/iavf_generic_flow.h | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_generic_flow.h +2 -0
index 9e518bd14c..0ccf5901b4 100644
@@ -34,6 +34,7 @@
  #define IAVF_PROT_AH		    (1ULL << 23)
  #define IAVF_PROT_L2TPV3OIP	    (1ULL << 24)
  #define IAVF_PROT_PFCP		    (1ULL << 25)
+#define IAVF_PROT_ECPRI		    (1ULL << 26)
 
 
  /* field */
@@ -59,6 +60,7 @@
  #define IAVF_L2TPV3OIP_SESSION_ID   (1ULL << 45)
  #define IAVF_PFCP_S_FIELD	    (1ULL << 44)
  #define IAVF_PFCP_SEID		    (1ULL << 43)
+#define IAVF_ECPRI_PC_RTC_ID	    (1ULL << 42)
 
  /* input set */
 

drivers/net/iavf/iavf_generic_flow.h line 144

Quoted 9 lines
drivers/net/iavf/iavf_generic_flow.h +2 -1
@@ -135,7 +137,8 @@
  	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD)
  #define IAVF_INSET_PFCP_SEID \
  	(IAVF_PROT_PFCP | IAVF_PFCP_S_FIELD | IAVF_PFCP_SEID)
-
+#define IAVF_INSET_ECPRI \
+	(IAVF_PROT_ECPRI | IAVF_ECPRI_PC_RTC_ID)
 
  /* empty pattern */
  extern enum rte_flow_item_type iavf_pattern_empty[];

Squashed into next commit [1], where these defines used.

[1] net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR

#5 lore raw

PATCH 4/5 net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR

In reply to Junfeng Guo

For eCPRI MSG Type 0, ecpriRtcid/ecpriPcid field within the eCPRI header will be extracted to Field Vector for AVF FDIR.

SPEC for eCPRI:
http://www.cpri.info/downloads/eCPRI_v_2.0_2019_05_10c.pdf

---
 drivers/net/iavf/iavf_fdir.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
drivers/net/iavf/iavf_fdir.c +32 -0
index 7054bde0b9..e92ca17581 100644
@@ -104,6 +104,9 @@
 #define IAVF_FDIR_INSET_PFCP (\
 	IAVF_INSET_PFCP_S_FIELD)
 
+#define IAVF_FDIR_INSET_ECPRI (\
+	IAVF_INSET_ECPRI)
+
 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},
@@ -128,6 +131,8 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
 	{iavf_pattern_eth_ipv6_udp_esp,		IAVF_FDIR_INSET_IPV6_NATT_ESP,		IAVF_INSET_NONE},
 	{iavf_pattern_eth_ipv4_pfcp,		IAVF_FDIR_INSET_PFCP,			IAVF_INSET_NONE},
 	{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},
 };
 
 static struct iavf_flow_parser iavf_fdir_parser;
@@ -469,6 +474,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 	const struct rte_flow_item_esp *esp_spec, *esp_mask;
 	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;
+	struct rte_ecpri_common_hdr ecpri_common;
 	uint64_t input_set = IAVF_INSET_NONE;
 
 	enum rte_flow_item_type next_type;
@@ -906,6 +913,31 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 			filter->add_fltr.rule_cfg.proto_hdrs.count = ++layer;
 			break;
 
+		case RTE_FLOW_ITEM_TYPE_ECPRI:
+			ecpri_spec = item->spec;
+			ecpri_mask = item->mask;
+
+			ecpri_common.u32 = rte_be_to_cpu_32(ecpri_spec->hdr.common.u32);
+
+			hdr = &filter->add_fltr.rule_cfg.proto_hdrs.proto_hdr[layer];
+
+			VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, ECPRI);
+
+			if (ecpri_spec && ecpri_mask) {
+				if (ecpri_common.type == RTE_ECPRI_MSG_TYPE_IQ_DATA
+				    && ecpri_mask->hdr.type0.pc_id == UINT16_MAX) {
+					input_set |= IAVF_ECPRI_PC_RTC_ID;
+					VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, ECPRI,
+									 PC_RTC_ID);
+				}
+
+				rte_memcpy(hdr->buffer, ecpri_spec,
+					sizeof(*ecpri_spec));
+			}
+
+			filter->add_fltr.rule_cfg.proto_hdrs.count = ++layer;
+			break;
+
 		case RTE_FLOW_ITEM_TYPE_VOID:
 			break;
 
Signature · 1 line
2.25.1
#6 lore raw

Re: [dpdk-dev] [PATCH 4/5] net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR

Quoted 7 lines · Junfeng Guo

For eCPRI MSG Type 0, ecpriRtcid/ecpriPcid field within the eCPRI header will be extracted to Field Vector for AVF FDIR.

SPEC for eCPRI:
http://www.cpri.info/downloads/eCPRI_v_2.0_2019_05_10c.pdf

fixed following checkpatch warning while merging:

CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #121: FILE: drivers/net/iavf/iavf_fdir.c:928:
+ if (ecpri_common.type == RTE_ECPRI_MSG_TYPE_IQ_DATA
+ && ecpri_mask->hdr.type0.pc_id == UINT16_MAX) {

#7 lore raw

PATCH 5/5 net/iavf: support eCPRI MSG TYPE 0 for RSS

In reply to Junfeng Guo

From: Simei Su <[email protected]>

This patch enables eCPRI Message Type 0 with input set physical channel ID in rte_flow for RSS.

---
 drivers/net/iavf/iavf_hash.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
drivers/net/iavf/iavf_hash.c +34 -0
index c4c73e6644..a20c33e7fb 100644
@@ -152,6 +152,10 @@ iavf_hash_parse_pattern_action(struct iavf_adapter *ad,
 #define proto_hdr_gtpc { \
 	VIRTCHNL_PROTO_HDR_GTPC, 0, {BUFF_NOUSED} }
 
+#define proto_hdr_ecpri { \
+	VIRTCHNL_PROTO_HDR_ECPRI, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), {BUFF_NOUSED} }
+
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_INNER		1
 
@@ -288,6 +292,14 @@ struct virtchnl_proto_hdrs ipv6_udp_gtpc_tmplt = {
 	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv6, proto_hdr_udp, proto_hdr_gtpc}
 };
 
+struct virtchnl_proto_hdrs eth_ecpri_tmplt = {
+	TUNNEL_LEVEL_OUTER, 2, {proto_hdr_eth, proto_hdr_ecpri}
+};
+
+struct virtchnl_proto_hdrs ipv4_ecpri_tmplt = {
+	TUNNEL_LEVEL_OUTER, 3, {proto_hdr_ipv4, proto_hdr_udp, proto_hdr_ecpri}
+};
+
 /* rss type super set */
 
 /* IPv4 outer */
@@ -399,6 +411,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv4_l2tpv3,			IAVF_RSS_TYPE_IPV4_L2TPV3,	&ipv4_l2tpv3_tmplt},
 	{iavf_pattern_eth_ipv4_pfcp,			IAVF_RSS_TYPE_IPV4_PFCP,	&ipv4_pfcp_tmplt},
 	{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},
 	/* IPv6 */
 	{iavf_pattern_eth_ipv6,				IAVF_RSS_TYPE_OUTER_IPV6,	&outer_ipv6_tmplt},
 	{iavf_pattern_eth_ipv6_udp,			IAVF_RSS_TYPE_OUTER_IPV6_UDP,	&outer_ipv6_udp_tmplt},
@@ -525,6 +539,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 {
 	const struct rte_flow_item *item = pattern;
 	const struct rte_flow_item_gtp_psc *psc;
+	const struct rte_flow_item_ecpri *ecpri;
+	struct rte_ecpri_common_hdr ecpri_common;
 
 	for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
 		if (item->last) {
@@ -556,6 +572,20 @@ iavf_hash_parse_pattern(const struct rte_flow_item pattern[], uint64_t *phint,
 			else if (psc->pdu_type == IAVF_GTPU_EH_DWNLINK)
 				*phint |= IAVF_PHINT_GTPU_EH_DWN;
 			break;
+		case RTE_FLOW_ITEM_TYPE_ECPRI:
+			ecpri = item->spec;
+			ecpri_common.u32 = rte_be_to_cpu_32(
+						ecpri->hdr.common.u32);
+			if (!ecpri)
+				break;
+			else if (ecpri_common.type !=
+				 RTE_ECPRI_MSG_TYPE_IQ_DATA) {
+				rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ITEM, item,
+					"Unsupported common type.");
+				return -rte_errno;
+			}
+			break;
 		default:
 			break;
 		}
@@ -711,6 +741,10 @@ iavf_refine_proto_hdrs_l234(struct virtchnl_proto_hdrs *proto_hdrs,
 			if (!(rss_type & ETH_RSS_PFCP))
 				hdr->field_selector = 0;
 			break;
+		case VIRTCHNL_PROTO_HDR_ECPRI:
+			if (!(rss_type & ETH_RSS_ECPRI))
+				hdr->field_selector = 0;
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.25.1
Acked-by on the v1 series Applied
#8 lore raw
In reply to Junfeng Guo
Quoted 36 lines

-----Original Message-----
From: Guo, Junfeng <[email protected]>
Sent: Monday, December 14, 2020 2:49 PM
To: Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Guo, Junfeng <[email protected]>; Su, Simei <[email protected]>; Cao, Yahui <[email protected]>
Subject: [PATCH 0/5] support eCPRI MSG TYPE 0 for AVF FDIR and RSS

This patch set enables eCPRI Message Type 0 with input set physical channel ID in rte_flow for AVF FDIR and RSS.

[PATCH 1/5] common/iavf: add proto hdr flds support for eCPRI. [PATCH 2/5] net/iavf: support flow patterns for eCPRI. [PATCH 3/5] net/iavf: define new bits for eCPRI. [PATCH 4/5] net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR. [PATCH 5/5] net/iavf: support eCPRI MSG TYPE 0 for RSS.

Junfeng Guo (3):
common/iavf: add proto hdr flds support for eCPRI net/iavf: define new bits for eCPRI net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR

Simei Su (2):
net/iavf: support flow patterns for eCPRI
net/iavf: support eCPRI MSG TYPE 0 for RSS

 drivers/common/iavf/virtchnl.h       |  5 ++++
 drivers/net/iavf/iavf_fdir.c         | 32 ++++++++++++++++++++++++++
 drivers/net/iavf/iavf_generic_flow.c | 15 ++++++++++++
drivers/net/iavf/iavf_generic_flow.h |  8 ++++++-
 drivers/net/iavf/iavf_hash.c         | 34 ++++++++++++++++++++++++++++
 5 files changed, 93 insertions(+), 1 deletion(-)
Quoted 2 lines

--
2.25.1

Applied to dpdk-next-net-intel.

Thanks
Qi