DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeff Guo <jia.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, qiming.yang@intel.com,
	simei.su@intel.com, jia.guo@intel.com
Subject: [dpdk-dev] [dpdk-dev v5 3/3] net/iavf: enable some new hash flow
Date: Tue,  7 Jul 2020 13:14:06 +0800
Message-ID: <20200707051406.13817-4-jia.guo@intel.com> (raw)
In-Reply-To: <20200707051406.13817-1-jia.guo@intel.com>

Some new hash flow will be supported to expend the flow hash
capability, the input set are the session id for NAT-T ESP protocol,
the l3 src/dst and the teid for GTPU_IP protocol.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v5->v4:
no change
---
 drivers/net/iavf/iavf_hash.c | 76 ++++++++++++++++++++++++++++++++++--
 1 file changed, 72 insertions(+), 4 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index b3b36cbc7..1394519e7 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -33,9 +33,10 @@ enum iavf_pattern_hint_type {
 	IAVF_PHINT_IPV6_UDP			= 0x00000020,
 	IAVF_PHINT_IPV6_TCP			= 0x00000040,
 	IAVF_PHINT_IPV6_SCTP			= 0x00000080,
-	IAVF_PHINT_IPV4_GTPU_EH			= 0x00000100,
-	IAVF_PHINT_IPV4_GTPU_EH_DWNLINK		= 0x00000200,
-	IAVF_PHINT_IPV4_GTPU_EH_UPLINK		= 0x00000400,
+	IAVF_PHINT_IPV4_GTPU_IP			= 0x00000100,
+	IAVF_PHINT_IPV4_GTPU_EH			= 0x00000200,
+	IAVF_PHINT_IPV4_GTPU_EH_DWNLINK		= 0x00000400,
+	IAVF_PHINT_IPV4_GTPU_EH_UPLINK		= 0x00000800,
 };
 
 #define IAVF_GTPU_EH_DWNLINK	0
@@ -92,6 +93,8 @@ static struct iavf_pattern_match_type phint_eth_ipv4_tcp = {
 	IAVF_PHINT_IPV4_TCP};
 static struct iavf_pattern_match_type phint_eth_ipv4_sctp = {
 	IAVF_PHINT_IPV4_SCTP};
+static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_ipv4 = {
+	IAVF_PHINT_IPV4};
 static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4 = {
 	IAVF_PHINT_IPV4};
 static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_udp = {
@@ -100,6 +103,8 @@ static struct iavf_pattern_match_type phint_eth_ipv4_gtpu_eh_ipv4_tcp = {
 	IAVF_PHINT_IPV4_TCP};
 static struct iavf_pattern_match_type phint_eth_ipv4_esp = {
 	IAVF_PHINT_IPV4};
+static struct iavf_pattern_match_type phint_eth_ipv4_udp_esp = {
+	IAVF_PHINT_IPV4_UDP};
 static struct iavf_pattern_match_type phint_eth_ipv4_ah = {
 	IAVF_PHINT_IPV4};
 static struct iavf_pattern_match_type phint_eth_ipv4_l2tpv3 = {
@@ -124,6 +129,8 @@ static struct iavf_pattern_match_type phint_eth_ipv6_sctp = {
 	IAVF_PHINT_IPV6_SCTP};
 static struct iavf_pattern_match_type phint_eth_ipv6_esp = {
 	IAVF_PHINT_IPV6};
+static struct iavf_pattern_match_type phint_eth_ipv6_udp_esp = {
+	IAVF_PHINT_IPV6_UDP};
 static struct iavf_pattern_match_type phint_eth_ipv6_ah = {
 	IAVF_PHINT_IPV6};
 static struct iavf_pattern_match_type phint_eth_ipv6_l2tpv3 = {
@@ -150,6 +157,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv4_udp, IAVF_INSET_NONE, &phint_eth_ipv4_udp},
 	{iavf_pattern_eth_ipv4_tcp, IAVF_INSET_NONE, &phint_eth_ipv4_tcp},
 	{iavf_pattern_eth_ipv4_sctp, IAVF_INSET_NONE, &phint_eth_ipv4_sctp},
+	{iavf_pattern_eth_ipv4_gtpu_ipv4, IAVF_INSET_NONE,
+					&phint_eth_ipv4_gtpu_ipv4},
 	{iavf_pattern_eth_ipv4_gtpu_eh_ipv4, IAVF_INSET_NONE,
 					&phint_eth_ipv4_gtpu_eh_ipv4},
 	{iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp, IAVF_INSET_NONE,
@@ -157,6 +166,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp, IAVF_INSET_NONE,
 					&phint_eth_ipv4_gtpu_eh_ipv4_tcp},
 	{iavf_pattern_eth_ipv4_esp, IAVF_INSET_NONE, &phint_eth_ipv4_esp},
+	{iavf_pattern_eth_ipv4_udp_esp, IAVF_INSET_NONE,
+					&phint_eth_ipv4_udp_esp},
 	{iavf_pattern_eth_ipv4_ah, IAVF_INSET_NONE, &phint_eth_ipv4_ah},
 	{iavf_pattern_eth_ipv4_l2tpv3, IAVF_INSET_NONE,
 					&phint_eth_ipv4_l2tpv3},
@@ -173,6 +184,8 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_eth_ipv6_tcp, IAVF_INSET_NONE, &phint_eth_ipv6_tcp},
 	{iavf_pattern_eth_ipv6_sctp, IAVF_INSET_NONE, &phint_eth_ipv6_sctp},
 	{iavf_pattern_eth_ipv6_esp, IAVF_INSET_NONE, &phint_eth_ipv6_esp},
+	{iavf_pattern_eth_ipv6_udp_esp, IAVF_INSET_NONE,
+					&phint_eth_ipv6_udp_esp},
 	{iavf_pattern_eth_ipv6_ah, IAVF_INSET_NONE, &phint_eth_ipv6_ah},
 	{iavf_pattern_eth_ipv6_l2tpv3, IAVF_INSET_NONE,
 					&phint_eth_ipv6_l2tpv3},
@@ -348,10 +361,18 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST) | \
 	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), {BUFF_NOUSED } }
 
+#define proto_hint_gtpu_ip_teid { \
+	VIRTCHNL_PROTO_HDR_GTPU_IP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPU_IP_TEID), {BUFF_NOUSED } }
+
 #define proto_hint_gtpu_eh_only { \
 	VIRTCHNL_PROTO_HDR_GTPU_EH, \
 	FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
+#define proto_hint_gtpu_ip_only { \
+	VIRTCHNL_PROTO_HDR_GTPU_IP, \
+	FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
+
 #define proto_hint_gtpu_up_only { \
 	VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, \
 	FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
@@ -620,6 +641,26 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_esp = {
 	proto_hint_udp_only, proto_hint_esp }
 };
 
+/* GTPU IP */
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_ip = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_only,
+	proto_hint_ipv4_src }
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_ip = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_only,
+	proto_hint_ipv4_dst }
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_gtpu_ip = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_only,
+	proto_hint_ipv4 }
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_teid_gtpu_ip = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_ip_teid}
+};
+
 /* GTPU EH */
 
 struct virtchnl_proto_hdrs hdrs_hint_ipv4_udp_src_gtpu_eh = {
@@ -1498,6 +1539,28 @@ struct iavf_hash_match_type iavf_hash_map_list[] = {
 
 struct iavf_hash_match_type iavf_gtpu_hash_map_list[] = {
 	/* GTPU */
+	/* GTPU IP */
+	/* GTPU IPV4*/
+	{ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv4_src_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
+	{ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv4_dst_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv4_src_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
+	{ETH_RSS_IPV4 |
+		ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv4_dst_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
+	{ETH_RSS_IPV4,
+		&hdrs_hint_ipv4_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
+	{ETH_RSS_GTPU,
+		&hdrs_hint_teid_gtpu_ip,
+		IAVF_PHINT_IPV4_GTPU_IP | IAVF_PHINT_IPV4},
 	/* GTPU EH */
 	/* Inner IPV4 */
 	{ETH_RSS_L3_SRC_ONLY,
@@ -2052,8 +2115,12 @@ iavf_hash_parse_pattern(struct iavf_pattern_match_item *pattern_match_item,
 		}
 
 		switch (item->type) {
+		case RTE_FLOW_ITEM_TYPE_GTPU:
+			*phint |= IAVF_PHINT_IPV4_GTPU_IP;
+			break;
 		case RTE_FLOW_ITEM_TYPE_GTP_PSC:
 			psc = item->spec;
+			*phint &= ~IAVF_PHINT_IPV4_GTPU_IP;
 			if (!psc)
 				*phint |= IAVF_PHINT_IPV4_GTPU_EH;
 			else if (psc->pdu_type == IAVF_GTPU_EH_UPLINK)
@@ -2131,7 +2198,8 @@ iavf_hash_parse_action(const struct rte_flow_action actions[],
 			 */
 			rss_type = rte_eth_rss_hf_refine(rss_type);
 
-			if ((pattern_hint & IAVF_PHINT_IPV4_GTPU_EH) ||
+			if ((pattern_hint & IAVF_PHINT_IPV4_GTPU_IP) ||
+			    (pattern_hint & IAVF_PHINT_IPV4_GTPU_EH) ||
 			    (pattern_hint & IAVF_PHINT_IPV4_GTPU_EH_UPLINK) ||
 			    (pattern_hint & IAVF_PHINT_IPV4_GTPU_EH_DWNLINK)) {
 				hash_map_list = iavf_gtpu_hash_map_list;
-- 
2.20.1


  parent reply	other threads:[~2020-07-07  5:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12  2:44 [dpdk-dev] net/iavf: add inner 5 tuple hash for GTPU Jeff Guo
2020-06-14 15:09 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
2020-06-21 14:02   ` [dpdk-dev] [dpdk-dev v3] " Jeff Guo
2020-07-01 12:56     ` Zhang, Qi Z
2020-07-03  3:52       ` Jeff Guo
2020-07-03  3:56     ` [dpdk-dev] [dpdk-dev v4 0/3] enable new hash flow for VF Jeff Guo
2020-07-03  3:56       ` [dpdk-dev] [dpdk-dev v4 1/3] net/iavf: refactor for hash flow Jeff Guo
2020-07-03 14:24         ` Zhang, Qi Z
2020-07-05 11:28           ` Jeff Guo
2020-07-03  3:56       ` [dpdk-dev] [dpdk-dev v4 2/3] net/iavf: enable 5 tuple rss hash Jeff Guo
2020-07-03  3:56       ` [dpdk-dev] [dpdk-dev v4 3/3] net/iavf: enable some new hash flow Jeff Guo
2020-07-07  5:14     ` [dpdk-dev] [dpdk-dev v5 0/3] enable new hash flow for VF Jeff Guo
2020-07-07  5:14       ` [dpdk-dev] [dpdk-dev v5 1/3] net/iavf: refactor for hash flow Jeff Guo
2020-07-07  5:14       ` [dpdk-dev] [dpdk-dev v5 2/3] net/iavf: enable 5 tuple rss hash Jeff Guo
2020-07-07  5:14       ` Jeff Guo [this message]
2020-07-07  9:18       ` [dpdk-dev] [dpdk-dev v5 0/3] enable new hash flow for VF 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=20200707051406.13817-4-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=simei.su@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

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