DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, junfeng.guo@intel.com, simei.su@intel.com,
	yahui.cao@intel.com
Subject: [dpdk-dev] [PATCH 5/5] net/iavf: support eCPRI MSG TYPE 0 for RSS
Date: Mon, 14 Dec 2020 14:49:13 +0800	[thread overview]
Message-ID: <20201214064913.2306802-6-junfeng.guo@intel.com> (raw)
In-Reply-To: <20201214064913.2306802-1-junfeng.guo@intel.com>

From: Simei Su <simei.su@intel.com>

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

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index c4c73e6644..a20c33e7fb 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -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;
 		}
-- 
2.25.1


  parent reply	other threads:[~2020-12-14  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14  6:49 [dpdk-dev] [PATCH 0/5] support eCPRI MSG TYPE 0 for AVF FDIR and RSS Junfeng Guo
2020-12-14  6:49 ` [dpdk-dev] [PATCH 1/5] common/iavf: add proto hdr flds support for eCPRI Junfeng Guo
2020-12-14  6:49 ` [dpdk-dev] [PATCH 2/5] net/iavf: support flow patterns " Junfeng Guo
2020-12-14  6:49 ` [dpdk-dev] [PATCH 3/5] net/iavf: define new bits " Junfeng Guo
2021-01-05 12:28   ` Ferruh Yigit
2020-12-14  6:49 ` [dpdk-dev] [PATCH 4/5] net/iavf: support eCPRI MSG TYPE 0 for AVF FDIR Junfeng Guo
2021-01-05 12:30   ` Ferruh Yigit
2020-12-14  6:49 ` Junfeng Guo [this message]
2020-12-23 11:07 ` [dpdk-dev] [PATCH 0/5] support eCPRI MSG TYPE 0 for AVF FDIR and RSS Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214064913.2306802-6-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=simei.su@intel.com \
    --cc=yahui.cao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).