DPDK patches and discussions
 help / color / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: beilei.xing@intel.com, qi.z.zhang@intel.com, jingjing.wu@intel.com
Cc: xiaolong.ye@intel.com, dev@dpdk.org, jia.guo@intel.com
Subject: [dpdk-dev]  net/iavf: fix protocol field selector configure
Date: Sat, 23 May 2020 07:17:31 +0800
Message-ID: <20200522231731.40803-1-jia.guo@intel.com> (raw)

When VFs configure the rss rule by virtchnl, it need to set bit mask into
the field selector for the protocol, then PF got the configure massage and
parse the field selector to the corresponding protocol field.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 474 +++++++++++++++++++++--------------
 1 file changed, 280 insertions(+), 194 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index af528863b..1e0ffad4c 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -43,6 +43,7 @@ struct iavf_hash_match_type {
 	enum iavf_pattern_hint_type phint_type;
 	uint64_t hash_type;
 	struct virtchnl_proto_hdrs *proto_hdrs;
+	uint32_t link_type;
 };
 
 struct iavf_rss_meta {
@@ -147,8 +148,11 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 	{iavf_pattern_empty, IAVF_INSET_NONE, &phint_empty},
 };
 
-#define	GTP_EH_PDU_LINK_UP		1
-#define	GTP_EH_PDU_LINK_DWN		0
+enum iavf_pattern_link_type {
+	IAVF_PATTERN_LINK_DOWN,
+	IAVF_PATTERN_LINK_UP,
+	IAVF_PATTERN_LINK_NONE,
+};
 
 #define TUNNEL_LEVEL_OUTER		0
 #define TUNNEL_LEVEL_FIRST_INNER	1
@@ -160,103 +164,112 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 #define BUFF_NOUSED			0
 #define FIELD_FOR_PROTO_ONLY		0
 
+#define FIELD_SELECTOR(proto_hdr_field)	(1UL << ((proto_hdr_field) % \
+					 (1UL << PROTO_HDR_SHIFT)))
+
 #define proto_hint_eth_src { \
-	VIRTCHNL_PROTO_HDR_ETH, VIRTCHNL_PROTO_HDR_ETH_SRC, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_ETH, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_SRC), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_eth_dst { \
-	VIRTCHNL_PROTO_HDR_ETH, VIRTCHNL_PROTO_HDR_ETH_DST, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_ETH, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_DST), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_eth_only { \
 	VIRTCHNL_PROTO_HDR_ETH, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_eth { \
 	VIRTCHNL_PROTO_HDR_ETH, \
-	VIRTCHNL_PROTO_HDR_ETH_SRC | VIRTCHNL_PROTO_HDR_ETH_DST, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ETH_DST), {BUFF_NOUSED } }
 
 #define proto_hint_svlan { \
-	VIRTCHNL_PROTO_HDR_S_VLAN, VIRTCHNL_PROTO_HDR_S_VLAN_ID, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_S_VLAN, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_S_VLAN_ID), {BUFF_NOUSED } }
 
 #define proto_hint_cvlan { \
-	VIRTCHNL_PROTO_HDR_C_VLAN, VIRTCHNL_PROTO_HDR_C_VLAN_ID, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_C_VLAN, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_C_VLAN_ID), {BUFF_NOUSED } }
 
 #define proto_hint_ipv4_src { \
-	VIRTCHNL_PROTO_HDR_IPV4, VIRTCHNL_PROTO_HDR_IPV4_SRC, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_ipv4_dst { \
-	VIRTCHNL_PROTO_HDR_IPV4, VIRTCHNL_PROTO_HDR_IPV4_DST, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_ipv4_only { \
 	VIRTCHNL_PROTO_HDR_IPV4, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_ipv4 { \
 	VIRTCHNL_PROTO_HDR_IPV4, \
-	VIRTCHNL_PROTO_HDR_IPV4_SRC | VIRTCHNL_PROTO_HDR_IPV4_DST, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), {BUFF_NOUSED } }
 
 #define proto_hint_udp_src_port { \
-	VIRTCHNL_PROTO_HDR_UDP, VIRTCHNL_PROTO_HDR_UDP_SRC_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_UDP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_udp_dst_port { \
-	VIRTCHNL_PROTO_HDR_UDP, VIRTCHNL_PROTO_HDR_UDP_DST_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_UDP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_udp_only { \
 	VIRTCHNL_PROTO_HDR_UDP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_udp { \
 	VIRTCHNL_PROTO_HDR_UDP, \
-	VIRTCHNL_PROTO_HDR_UDP_SRC_PORT | VIRTCHNL_PROTO_HDR_UDP_DST_PORT, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_tcp_src_port { \
-	VIRTCHNL_PROTO_HDR_TCP, VIRTCHNL_PROTO_HDR_TCP_SRC_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_TCP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_tcp_dst_port { \
-	VIRTCHNL_PROTO_HDR_TCP, VIRTCHNL_PROTO_HDR_TCP_DST_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_TCP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_tcp_only { \
 	VIRTCHNL_PROTO_HDR_TCP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_tcp { \
 	VIRTCHNL_PROTO_HDR_TCP, \
-	VIRTCHNL_PROTO_HDR_TCP_SRC_PORT | VIRTCHNL_PROTO_HDR_TCP_DST_PORT, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_sctp_src_port { \
-	VIRTCHNL_PROTO_HDR_SCTP, VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_SCTP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_sctp_dst_port { \
-	VIRTCHNL_PROTO_HDR_SCTP, VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, \
-	{BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_SCTP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_sctp_only { \
 	VIRTCHNL_PROTO_HDR_SCTP, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_sctp { \
 	VIRTCHNL_PROTO_HDR_SCTP, \
-	VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT | VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT), {BUFF_NOUSED } }
 
 #define proto_hint_ipv6_src { \
-	VIRTCHNL_PROTO_HDR_IPV6, VIRTCHNL_PROTO_HDR_IPV6_SRC, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_ipv6_dst { \
-	VIRTCHNL_PROTO_HDR_IPV6, VIRTCHNL_PROTO_HDR_IPV6_DST, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), \
+	{BUFF_NOUSED } }
 
 #define proto_hint_ipv6_only { \
 	VIRTCHNL_PROTO_HDR_IPV6, FIELD_FOR_PROTO_ONLY, {BUFF_NOUSED } }
 
 #define proto_hint_ipv6 { \
 	VIRTCHNL_PROTO_HDR_IPV6, \
-	VIRTCHNL_PROTO_HDR_IPV6_SRC | VIRTCHNL_PROTO_HDR_IPV6_DST, \
-	{BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC) | \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), {BUFF_NOUSED } }
 
 #define proto_hint_gtpu_up_only { \
 	VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP, \
@@ -268,18 +281,19 @@ static struct iavf_pattern_match_item iavf_hash_pattern_list[] = {
 
 #define proto_hint_esp { \
 	VIRTCHNL_PROTO_HDR_ESP, \
-	VIRTCHNL_PROTO_HDR_ESP_SPI, {BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ESP_SPI), {BUFF_NOUSED } }
 
 #define proto_hint_ah { \
 	VIRTCHNL_PROTO_HDR_AH, \
-	VIRTCHNL_PROTO_HDR_AH_SPI, {BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_AH_SPI), {BUFF_NOUSED } }
 
 #define proto_hint_l2tpv3 { \
 	VIRTCHNL_PROTO_HDR_L2TPV3, \
-	VIRTCHNL_PROTO_HDR_L2TPV3_SESS_ID, {BUFF_NOUSED } }
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV3_SESS_ID), {BUFF_NOUSED } }
 
 #define proto_hint_pfcp { \
-	VIRTCHNL_PROTO_HDR_PFCP, VIRTCHNL_PROTO_HDR_PFCP_SEID, {BUFF_NOUSED } }
+	VIRTCHNL_PROTO_HDR_PFCP, \
+	FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), {BUFF_NOUSED } }
 
 struct virtchnl_proto_hdrs hdrs_hint_eth_src = {
 	TUNNEL_LEVEL_OUTER, PROTO_COUNT_ONE, {proto_hint_eth_src }
@@ -314,6 +328,16 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_up = {
 	proto_hint_ipv4_src }
 };
 
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_src_gtpu_dwn = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
+	proto_hint_ipv4_src }
+};
+
+struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_up = {
+	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_up_only,
+	proto_hint_ipv4_dst }
+};
+
 struct virtchnl_proto_hdrs hdrs_hint_ipv4_dst_gtpu_dwn = {
 	TUNNEL_LEVEL_FIRST_INNER, PROTO_COUNT_TWO, {proto_hint_gtpu_dwn_only,
 	proto_hint_ipv4_dst }
@@ -589,272 +613,333 @@ struct virtchnl_proto_hdrs hdrs_hint_ipv6_sctp = {
  * The first member is pattern hint type,
  * the second member is hash type,
  * the third member is virtchnl protocol hdrs.
+ * the forth member is downlink/uplink type.
  */
 struct iavf_hash_match_type iavf_hash_type_list[] = {
 	/* IPV4 */
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src,
+						IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst,
+						IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH | ETH_RSS_L2_SRC_ONLY,
-						&hdrs_hint_eth_src},
+			&hdrs_hint_eth_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH | ETH_RSS_L2_DST_ONLY,
-						&hdrs_hint_eth_dst},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH, &hdrs_hint_eth},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_S_VLAN, &hdrs_hint_svlan},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst},
+			&hdrs_hint_eth_dst, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH, &hdrs_hint_eth,
+						IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_S_VLAN, &hdrs_hint_svlan,
+						IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan,
+						IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+						IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+						IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
-						&hdrs_hint_ipv4_src},
+			&hdrs_hint_ipv4_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY,
-						&hdrs_hint_ipv4_dst},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ESP, &hdrs_hint_ipv4_esp},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_AH, &hdrs_hint_ipv4_ah},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2TPV3, &hdrs_hint_ipv4_l2tpv3},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4, &hdrs_hint_ipv4},
+			&hdrs_hint_ipv4_dst, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ESP, &hdrs_hint_ipv4_esp,
+	IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_AH, &hdrs_hint_ipv4_ah,
+	IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2TPV3, &hdrs_hint_ipv4_l2tpv3,
+	IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4, &hdrs_hint_ipv4,
+	IAVF_PATTERN_LINK_NONE},
 	/* IPV4 UDP */
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_src_udp_src_port},
+		&hdrs_hint_ipv4_src_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_src_udp_dst_port},
+		&hdrs_hint_ipv4_src_udp_dst_port, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_src_gtpu_up, IAVF_PATTERN_LINK_UP},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
-					&hdrs_hint_ipv4_src_gtpu_up},
+		&hdrs_hint_ipv4_src_gtpu_dwn, IAVF_PATTERN_LINK_DOWN},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_dst_udp_src_port},
+		&hdrs_hint_ipv4_dst_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_dst_udp_dst_port},
+		&hdrs_hint_ipv4_dst_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
-					&hdrs_hint_ipv4_dst_gtpu_dwn},
+		&hdrs_hint_ipv4_dst_gtpu_up, IAVF_PATTERN_LINK_UP},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_dst_gtpu_dwn, IAVF_PATTERN_LINK_DOWN},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_src_udp_src_port},
+		&hdrs_hint_ipv4_src_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_src_udp_dst_port},
+		&hdrs_hint_ipv4_src_udp_dst_port, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
+		ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_src_gtpu_up, IAVF_PATTERN_LINK_UP},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
-		&hdrs_hint_ipv4_src_gtpu_up},
+		&hdrs_hint_ipv4_src_gtpu_dwn, IAVF_PATTERN_LINK_DOWN},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_dst_udp_src_port},
+		&hdrs_hint_ipv4_dst_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_dst_udp_dst_port},
+		&hdrs_hint_ipv4_dst_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
-		&hdrs_hint_ipv4_dst_gtpu_dwn},
+		&hdrs_hint_ipv4_dst_gtpu_up, IAVF_PATTERN_LINK_UP},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst},
+		ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_dst_gtpu_dwn, IAVF_PATTERN_LINK_DOWN},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_udp_src_port},
+		&hdrs_hint_ipv4_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_udp_dst_port},
+		&hdrs_hint_ipv4_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv4_pfcp},
+		&hdrs_hint_ipv4_pfcp, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP,
-					&hdrs_hint_ipv4_udp},
+		&hdrs_hint_ipv4_udp, IAVF_PATTERN_LINK_NONE},
 	/* IPV4 TCP */
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_src_tcp_src_port},
+		&hdrs_hint_ipv4_src_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_src_tcp_dst_port},
+		&hdrs_hint_ipv4_src_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_dst_tcp_src_port},
+		&hdrs_hint_ipv4_dst_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_dst_tcp_dst_port},
+		&hdrs_hint_ipv4_dst_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_src_tcp_src_port},
+		&hdrs_hint_ipv4_src_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_src_tcp_dst_port},
+		&hdrs_hint_ipv4_src_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_dst_tcp_src_port},
+		&hdrs_hint_ipv4_dst_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_dst_tcp_dst_port},
+		&hdrs_hint_ipv4_dst_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst},
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_tcp_src_port},
+		&hdrs_hint_ipv4_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_tcp_dst_port},
+		&hdrs_hint_ipv4_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP,
-					&hdrs_hint_ipv4_tcp},
+		&hdrs_hint_ipv4_tcp, IAVF_PATTERN_LINK_NONE},
 	/* IPV4 SCTP */
-	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_src_sctp_src_port},
-	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_src_sctp_dst_port},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv4_src_sctp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_src_sctp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
-	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_dst_sctp_src_port},
-	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_dst_sctp_dst_port},
+		&hdrs_hint_ipv4_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv4_dst_sctp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_dst_sctp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_src_sctp_src_port},
+		&hdrs_hint_ipv4_src_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_src_sctp_dst_port},
+		&hdrs_hint_ipv4_src_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv4_dst_sctp_src_port},
+		&hdrs_hint_ipv4_dst_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv4_dst_sctp_dst_port},
+		&hdrs_hint_ipv4_dst_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst},
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_sctp_src_port},
+		&hdrs_hint_ipv4_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_sctp_dst_port},
+		&hdrs_hint_ipv4_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP,
-					&hdrs_hint_ipv4_sctp},
+		&hdrs_hint_ipv4_sctp, IAVF_PATTERN_LINK_NONE},
 	/* IPV6 */
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_SRC_ONLY, &hdrs_hint_eth_src},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_SRC_ONLY,
+		&hdrs_hint_eth_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_DST_ONLY,
+		&hdrs_hint_eth_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L2_SRC_ONLY,
-					&hdrs_hint_eth_src},
+		&hdrs_hint_eth_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L2_DST_ONLY,
-					&hdrs_hint_eth_dst},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ETH, &hdrs_hint_eth},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_S_VLAN, &hdrs_hint_svlan},
-	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst},
+		&hdrs_hint_eth_dst, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ETH,
+		&hdrs_hint_eth, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_S_VLAN,
+		&hdrs_hint_svlan, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN,
+		&hdrs_hint_cvlan, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
+		&hdrs_hint_ipv6_src, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ESP, &hdrs_hint_ipv6_esp},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_AH, &hdrs_hint_ipv6_ah},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2TPV3, &hdrs_hint_ipv6_l2tpv3},
-	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6, &hdrs_hint_ipv6},
+		&hdrs_hint_ipv6_dst, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ESP,
+		&hdrs_hint_ipv6_esp, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_AH,
+		&hdrs_hint_ipv6_ah, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2TPV3,
+		&hdrs_hint_ipv6_l2tpv3, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6,
+		&hdrs_hint_ipv6, IAVF_PATTERN_LINK_NONE},
 	/* IPV6 UDP */
-	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_src_udp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_src_udp_dst_port},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_src_udp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_udp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
-	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_dst_udp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_dst_udp_dst_port},
+		&hdrs_hint_ipv6_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_udp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_udp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_src_udp_src_port},
+		&hdrs_hint_ipv6_src_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_src_udp_dst_port},
+		&hdrs_hint_ipv6_src_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_dst_udp_src_port},
+		&hdrs_hint_ipv6_dst_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_dst_udp_dst_port},
+		&hdrs_hint_ipv6_dst_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst},
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_udp_src_port},
+		&hdrs_hint_ipv6_udp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_udp_dst_port},
+		&hdrs_hint_ipv6_udp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv6_pfcp},
+		&hdrs_hint_ipv6_pfcp, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP,
-					&hdrs_hint_ipv6_udp},
+		&hdrs_hint_ipv6_udp, IAVF_PATTERN_LINK_NONE},
 	/* IPV6 TCP */
-	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_src_tcp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_src_tcp_dst_port},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_src_tcp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_tcp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
-	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_dst_tcp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_dst_tcp_dst_port},
+		&hdrs_hint_ipv6_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_tcp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_tcp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_src_tcp_src_port},
+		&hdrs_hint_ipv6_src_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_src_tcp_dst_port},
+		&hdrs_hint_ipv6_src_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_dst_tcp_src_port},
+		&hdrs_hint_ipv6_dst_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_dst_tcp_dst_port},
+		&hdrs_hint_ipv6_dst_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst},
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_tcp_src_port},
+		&hdrs_hint_ipv6_tcp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_tcp_dst_port},
+		&hdrs_hint_ipv6_tcp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP,
-					&hdrs_hint_ipv6_tcp},
+		&hdrs_hint_ipv6_tcp, IAVF_PATTERN_LINK_NONE},
 	/* IPV6 SCTP */
-	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_src_sctp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_src_sctp_dst_port},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_src_sctp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_sctp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
-	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_dst_sctp_src_port},
-	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_dst_sctp_dst_port},
+		&hdrs_hint_ipv6_src, IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_sctp_src_port,
+		IAVF_PATTERN_LINK_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_sctp_dst_port,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_src_sctp_src_port},
+		&hdrs_hint_ipv6_src_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
 		ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_src_sctp_dst_port},
+		&hdrs_hint_ipv6_src_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
-		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src},
+		ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv6_src,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY,
-		&hdrs_hint_ipv6_dst_sctp_src_port},
+		&hdrs_hint_ipv6_dst_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
 		ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY,
-		&hdrs_hint_ipv6_dst_sctp_dst_port},
+		&hdrs_hint_ipv6_dst_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP |
-		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst},
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv6_dst,
+		IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_sctp_src_port},
+		&hdrs_hint_ipv6_sctp_src_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_sctp_dst_port},
+		&hdrs_hint_ipv6_sctp_dst_port, IAVF_PATTERN_LINK_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP,
-					&hdrs_hint_ipv6_sctp},
+		&hdrs_hint_ipv6_sctp, IAVF_PATTERN_LINK_NONE},
 };
 
 struct virtchnl_proto_hdrs *iavf_hash_default_hdrs[] = {
@@ -969,8 +1054,9 @@ iavf_hash_check_inset(const struct rte_flow_item pattern[],
 	return 0;
 }
 
-static uint64_t
-iavf_hash_refine_type(uint64_t rss_type, const struct rte_flow_item pattern[])
+static void
+iavf_hash_refine_type(uint64_t *rss_type, const struct rte_flow_item pattern[],
+		      uint32_t *link_type)
 {
 	const struct rte_flow_item *item;
 
@@ -978,14 +1064,13 @@ iavf_hash_refine_type(uint64_t rss_type, const struct rte_flow_item pattern[])
 		if (item->type == RTE_FLOW_ITEM_TYPE_GTP_PSC) {
 			const struct rte_flow_item_gtp_psc *psc = item->spec;
 
-			if (psc && (psc->pdu_type == GTP_EH_PDU_LINK_UP ||
-				    psc->pdu_type == GTP_EH_PDU_LINK_DWN)) {
-				rss_type |= ETH_RSS_GTPU;
+			if (psc && (psc->pdu_type == IAVF_PATTERN_LINK_UP ||
+				    psc->pdu_type == IAVF_PATTERN_LINK_DOWN)) {
+				*rss_type |= ETH_RSS_GTPU;
+				*link_type = psc->pdu_type;
 			}
 		}
 	}
-
-	return rss_type;
 }
 
 static int
@@ -994,9 +1079,12 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 		       const struct rte_flow_action actions[],
 		       void **meta, struct rte_flow_error *error)
 {
+	struct iavf_pattern_match_type *mt = (struct iavf_pattern_match_type *)
+					(pattern_match_item->meta);
 	struct iavf_rss_meta *rss_meta = (struct iavf_rss_meta *)*meta;
 	uint32_t type_list_len = RTE_DIM(iavf_hash_type_list);
 	struct iavf_hash_match_type *type_match_item;
+	uint32_t link_type = IAVF_PATTERN_LINK_NONE;
 	enum rte_flow_action_type action_type;
 	const struct rte_flow_action_rss *rss;
 	const struct rte_flow_action *action;
@@ -1004,9 +1092,6 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 	uint64_t rss_type;
 	uint16_t i;
 
-	struct iavf_pattern_match_type *tt = (struct iavf_pattern_match_type *)
-		(pattern_match_item->meta);
-
 	/* Supported action is RSS. */
 	for (action = actions; action->type !=
 		RTE_FLOW_ACTION_TYPE_END; action++) {
@@ -1026,7 +1111,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 			 * Refine the hash type base on some specific item of
 			 * the pattern, such as identify the gtpu hash.
 			 */
-			rss_type = iavf_hash_refine_type(rss_type, pattern);
+			iavf_hash_refine_type(&rss_type, pattern, &link_type);
 
 			/* Check if pattern is empty. */
 			if (pattern_match_item->pattern_list !=
@@ -1079,7 +1164,8 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 				struct iavf_hash_match_type *ht_map =
 					&iavf_hash_type_list[i];
 				if (rss_type == ht_map->hash_type &&
-				    tt->phint_type == ht_map->phint_type) {
+				    mt->phint_type == ht_map->phint_type &&
+				    link_type == ht_map->link_type) {
 					type_match_item->hash_type =
 						ht_map->hash_type;
 					type_match_item->proto_hdrs =
-- 
2.20.1


             reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 23:17 Jeff Guo [this message]
2020-05-23  2:03 ` Zhang, Qi Z
2020-05-24  5:46   ` Jeff Guo
2020-05-24  5:52 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
2020-05-24  7:31   ` Zhang, Qi Z
2020-05-25  4:08     ` Ye Xiaolong
2020-05-25  6:50   ` He, Zhiwei
  -- strict thread matches above, loose matches on Subject: below --
2020-05-22 11:10 [dpdk-dev] " Jeff Guo

Reply instructions:

You may reply publically 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=20200522231731.40803-1-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=xiaolong.ye@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

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