DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  net/iavf: fix protocol field selector configure
@ 2020-05-22 23:17 Jeff Guo
  2020-05-23  2:03 ` Zhang, Qi Z
  2020-05-24  5:52 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Guo @ 2020-05-22 23:17 UTC (permalink / raw)
  To: beilei.xing, qi.z.zhang, jingjing.wu; +Cc: xiaolong.ye, dev, jia.guo

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


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

* Re: [dpdk-dev] net/iavf: fix protocol field selector configure
  2020-05-22 23:17 [dpdk-dev] net/iavf: fix protocol field selector configure Jeff Guo
@ 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
  1 sibling, 1 reply; 8+ messages in thread
From: Zhang, Qi Z @ 2020-05-23  2:03 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Saturday, May 23, 2020 7:18 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> <jia.guo@intel.com>
> Subject: [dpdk-dev] net/iavf: fix protocol field selector configure
> 
> 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;

If this is just a hint for gtpu link type.
Better to rename to "gtpu_hint"
And use the already defined enum but not uint32_t.
 
>  };
> 
>  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 {

Rename to iavf_gtpu_hint.

> +	IAVF_PATTERN_LINK_DOWN,
> +	IAVF_PATTERN_LINK_UP,
> +	IAVF_PATTERN_LINK_NONE,
> +};

The configure is for GTP down/up link, 
The name "xxx_LINK_DOWN", and "xxx_LINK_UP" is a little bit misleading.
Could be 
IAVF_GTPU_HINT_UPLINK.
IAVF_GTPU_HINT_DOWNLINK.
IAVF_GTPU_HINT_N/A

> 
>  #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)))

Could be simplified to.
#define FIELD_SELECTOR(proto_hdr_field) \
	(1UL << (proto_hdr_field & PROTO_HDR_FIELD_MASK))

......

Regards
Qi

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

* Re: [dpdk-dev] net/iavf: fix protocol field selector configure
  2020-05-23  2:03 ` Zhang, Qi Z
@ 2020-05-24  5:46   ` Jeff Guo
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Guo @ 2020-05-24  5:46 UTC (permalink / raw)
  To: Zhang, Qi Z, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev

hi, qi

On 5/23/2020 10:03 AM, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Guo, Jia <jia.guo@intel.com>
>> Sent: Saturday, May 23, 2020 7:18 AM
>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
>> <jia.guo@intel.com>
>> Subject: [dpdk-dev] net/iavf: fix protocol field selector configure
>>
>> 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;
> If this is just a hint for gtpu link type.
> Better to rename to "gtpu_hint"
> And use the already defined enum but not uint32_t.
>   


ok.


>>   };
>>
>>   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 {
> Rename to iavf_gtpu_hint.


seem it is better.


>> +	IAVF_PATTERN_LINK_DOWN,
>> +	IAVF_PATTERN_LINK_UP,
>> +	IAVF_PATTERN_LINK_NONE,
>> +};
> The configure is for GTP down/up link,
> The name "xxx_LINK_DOWN", and "xxx_LINK_UP" is a little bit misleading.
> Could be
> IAVF_GTPU_HINT_UPLINK.
> IAVF_GTPU_HINT_DOWNLINK.
> IAVF_GTPU_HINT_N/A


ok, but i will choose  IAVF_GTPU_HINT_NONE but not IAVF_GTPU_HINT_N/A 
for common and it should also knowledgeable.


>>   #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)))
> Could be simplified to.
> #define FIELD_SELECTOR(proto_hdr_field) \
> 	(1UL << (proto_hdr_field & PROTO_HDR_FIELD_MASK))


Use the currently macro to make it simple, sounds good. Thanks.


> ......
>
> Regards
> Qi

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

* [dpdk-dev] [dpdk-dev v2] net/iavf: fix protocol field selector configure
  2020-05-22 23:17 [dpdk-dev] net/iavf: fix protocol field selector configure Jeff Guo
  2020-05-23  2:03 ` Zhang, Qi Z
@ 2020-05-24  5:52 ` Jeff Guo
  2020-05-24  7:31   ` Zhang, Qi Z
  2020-05-25  6:50   ` He, Zhiwei
  1 sibling, 2 replies; 8+ messages in thread
From: Jeff Guo @ 2020-05-24  5:52 UTC (permalink / raw)
  To: beilei.xing, qi.z.zhang, jingjing.wu; +Cc: xiaolong.ye, dev, jia.guo

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 | 476 +++++++++++++++++++++--------------
 1 file changed, 281 insertions(+), 195 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index af528863b..a7691ef0c 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -35,6 +35,12 @@ enum iavf_pattern_hint_type {
 	IAVF_PATTERN_HINT_IPV6_SCTP,
 };
 
+enum iavf_gtpu_hint {
+	IAVF_GTPU_HINT_DOWNLINK,
+	IAVF_GTPU_HINT_UPLINK,
+	IAVF_GTPU_HINT_NONE,
+};
+
 struct iavf_pattern_match_type {
 	enum iavf_pattern_hint_type phint_type;
 };
@@ -43,6 +49,7 @@ struct iavf_hash_match_type {
 	enum iavf_pattern_hint_type phint_type;
 	uint64_t hash_type;
 	struct virtchnl_proto_hdrs *proto_hdrs;
+	enum iavf_gtpu_hint gtpu_hint;
 };
 
 struct iavf_rss_meta {
@@ -147,9 +154,6 @@ 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
-
 #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) & PROTO_HDR_FIELD_MASK))
+
 #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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst,
+						IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH | ETH_RSS_L2_SRC_ONLY,
-						&hdrs_hint_eth_src},
+			&hdrs_hint_eth_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH, &hdrs_hint_eth,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_S_VLAN, &hdrs_hint_svlan,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+						IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
-						&hdrs_hint_ipv4_src},
+			&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ESP, &hdrs_hint_ipv4_esp,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_AH, &hdrs_hint_ipv4_ah,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2TPV3, &hdrs_hint_ipv4_l2tpv3,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4, &hdrs_hint_ipv4,
+	IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_src_gtpu_up, IAVF_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_dst_gtpu_dwn, IAVF_GTPU_HINT_DOWNLINK},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
 	{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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_udp_src_port},
+		&hdrs_hint_ipv4_udp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_udp_dst_port},
+		&hdrs_hint_ipv4_udp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv4_pfcp},
+		&hdrs_hint_ipv4_pfcp, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP,
-					&hdrs_hint_ipv4_udp},
+		&hdrs_hint_ipv4_udp, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_tcp_src_port},
+		&hdrs_hint_ipv4_tcp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_tcp_dst_port},
+		&hdrs_hint_ipv4_tcp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP,
-					&hdrs_hint_ipv4_tcp},
+		&hdrs_hint_ipv4_tcp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_src_sctp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv4_dst_sctp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_dst_sctp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_sctp_src_port},
+		&hdrs_hint_ipv4_sctp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_sctp_dst_port},
+		&hdrs_hint_ipv4_sctp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP,
-					&hdrs_hint_ipv4_sctp},
+		&hdrs_hint_ipv4_sctp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_DST_ONLY,
+		&hdrs_hint_eth_dst, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L2_SRC_ONLY,
-					&hdrs_hint_eth_src},
+		&hdrs_hint_eth_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ETH,
+		&hdrs_hint_eth, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_S_VLAN,
+		&hdrs_hint_svlan, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN,
+		&hdrs_hint_cvlan, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
+		&hdrs_hint_ipv6_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ESP,
+		&hdrs_hint_ipv6_esp, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_AH,
+		&hdrs_hint_ipv6_ah, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2TPV3,
+		&hdrs_hint_ipv6_l2tpv3, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6,
+		&hdrs_hint_ipv6, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_udp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_udp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_udp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_udp_src_port},
+		&hdrs_hint_ipv6_udp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_udp_dst_port},
+		&hdrs_hint_ipv6_udp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv6_pfcp},
+		&hdrs_hint_ipv6_pfcp, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP,
-					&hdrs_hint_ipv6_udp},
+		&hdrs_hint_ipv6_udp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_tcp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_tcp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_tcp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_tcp_src_port},
+		&hdrs_hint_ipv6_tcp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_tcp_dst_port},
+		&hdrs_hint_ipv6_tcp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP,
-					&hdrs_hint_ipv6_tcp},
+		&hdrs_hint_ipv6_tcp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_sctp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_sctp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_sctp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_sctp_src_port},
+		&hdrs_hint_ipv6_sctp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_sctp_dst_port},
+		&hdrs_hint_ipv6_sctp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP,
-					&hdrs_hint_ipv6_sctp},
+		&hdrs_hint_ipv6_sctp, IAVF_GTPU_HINT_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[],
+		      enum iavf_gtpu_hint *gtpu_hint)
 {
 	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_GTPU_HINT_UPLINK ||
+				    psc->pdu_type == IAVF_GTPU_HINT_DOWNLINK)) {
+				*rss_type |= ETH_RSS_GTPU;
+				*gtpu_hint = 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;
+	enum iavf_gtpu_hint gtpu_hint = IAVF_GTPU_HINT_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, &gtpu_hint);
 
 			/* 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 &&
+				    gtpu_hint == ht_map->gtpu_hint) {
 					type_match_item->hash_type =
 						ht_map->hash_type;
 					type_match_item->proto_hdrs =
-- 
2.20.1


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

* Re: [dpdk-dev] [dpdk-dev v2] net/iavf: fix protocol field selector configure
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Zhang, Qi Z @ 2020-05-24  7:31 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Wu, Jingjing; +Cc: Ye, Xiaolong, dev



> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Sunday, May 24, 2020 1:53 PM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
> <jia.guo@intel.com>
> Subject: [dpdk-dev v2] net/iavf: fix protocol field selector configure
> 
> 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>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>


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

* Re: [dpdk-dev] [dpdk-dev v2] net/iavf: fix protocol field selector configure
  2020-05-24  7:31   ` Zhang, Qi Z
@ 2020-05-25  4:08     ` Ye Xiaolong
  0 siblings, 0 replies; 8+ messages in thread
From: Ye Xiaolong @ 2020-05-25  4:08 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: Guo, Jia, Xing, Beilei, Wu, Jingjing, dev

On 05/24, Zhang, Qi Z wrote:
>
>
>> -----Original Message-----
>> From: Guo, Jia <jia.guo@intel.com>
>> Sent: Sunday, May 24, 2020 1:53 PM
>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia
>> <jia.guo@intel.com>
>> Subject: [dpdk-dev v2] net/iavf: fix protocol field selector configure
>> 
>> 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>
>
>Acked-by: Qi Zhang <qi.z.zhang@intel.com>
>

Applied to dpdk-next-net-intel, Thanks.

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

* Re: [dpdk-dev] [dpdk-dev v2] net/iavf: fix protocol field selector configure
  2020-05-24  5:52 ` [dpdk-dev] [dpdk-dev v2] " Jeff Guo
  2020-05-24  7:31   ` Zhang, Qi Z
@ 2020-05-25  6:50   ` He, Zhiwei
  1 sibling, 0 replies; 8+ messages in thread
From: He, Zhiwei @ 2020-05-25  6:50 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, Zhang, Qi Z, Wu, Jingjing
  Cc: Ye, Xiaolong, dev, Guo, Jia

Tested-by: Zhiwei.He <zhiwei.he@intel.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Jeff Guo
Sent: Sunday, May 24, 2020 1:53 PM
To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
Cc: Ye, Xiaolong <xiaolong.ye@intel.com>; dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
Subject: [dpdk-dev] [dpdk-dev v2] net/iavf: fix protocol field selector configure

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 | 476 +++++++++++++++++++++--------------
 1 file changed, 281 insertions(+), 195 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index af528863b..a7691ef0c 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -35,6 +35,12 @@ enum iavf_pattern_hint_type {
 	IAVF_PATTERN_HINT_IPV6_SCTP,
 };
 
+enum iavf_gtpu_hint {
+	IAVF_GTPU_HINT_DOWNLINK,
+	IAVF_GTPU_HINT_UPLINK,
+	IAVF_GTPU_HINT_NONE,
+};
+
 struct iavf_pattern_match_type {
 	enum iavf_pattern_hint_type phint_type;  }; @@ -43,6 +49,7 @@ struct iavf_hash_match_type {
 	enum iavf_pattern_hint_type phint_type;
 	uint64_t hash_type;
 	struct virtchnl_proto_hdrs *proto_hdrs;
+	enum iavf_gtpu_hint gtpu_hint;
 };
 
 struct iavf_rss_meta {
@@ -147,9 +154,6 @@ 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
-
 #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) & PROTO_HDR_FIELD_MASK))
+
 #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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2_DST_ONLY, &hdrs_hint_eth_dst,
+						IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH | ETH_RSS_L2_SRC_ONLY,
-						&hdrs_hint_eth_src},
+			&hdrs_hint_eth_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ETH, &hdrs_hint_eth,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_S_VLAN, &hdrs_hint_svlan,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN, &hdrs_hint_cvlan,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_SRC_ONLY, &hdrs_hint_ipv4_src,
+						IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+						IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY,
-						&hdrs_hint_ipv4_src},
+			&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_ESP, &hdrs_hint_ipv4_esp,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_AH, &hdrs_hint_ipv4_ah,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_L2TPV3, &hdrs_hint_ipv4_l2tpv3,
+	IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_IPV4, &hdrs_hint_ipv4,
+	IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_src_gtpu_up, IAVF_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
+		&hdrs_hint_ipv4_dst_gtpu_dwn, IAVF_GTPU_HINT_DOWNLINK},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
 	{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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_UPLINK},
 	{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_GTPU_HINT_DOWNLINK},
+	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP |
+		ETH_RSS_L3_DST_ONLY, &hdrs_hint_ipv4_dst,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_udp_src_port},
+		&hdrs_hint_ipv4_udp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_udp_dst_port},
+		&hdrs_hint_ipv4_udp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv4_pfcp},
+		&hdrs_hint_ipv4_pfcp, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_UDP, ETH_RSS_NONFRAG_IPV4_UDP,
-					&hdrs_hint_ipv4_udp},
+		&hdrs_hint_ipv4_udp, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv4_src},
+		&hdrs_hint_ipv4_src, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_tcp_src_port},
+		&hdrs_hint_ipv4_tcp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_tcp_dst_port},
+		&hdrs_hint_ipv4_tcp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_TCP, ETH_RSS_NONFRAG_IPV4_TCP,
-					&hdrs_hint_ipv4_tcp},
+		&hdrs_hint_ipv4_tcp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_src_sctp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv4_dst_sctp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv4_dst_sctp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv4_dst},
+		&hdrs_hint_ipv4_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv4_sctp_src_port},
+		&hdrs_hint_ipv4_sctp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv4_sctp_dst_port},
+		&hdrs_hint_ipv4_sctp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV4_SCTP, ETH_RSS_NONFRAG_IPV4_SCTP,
-					&hdrs_hint_ipv4_sctp},
+		&hdrs_hint_ipv4_sctp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2_DST_ONLY,
+		&hdrs_hint_eth_dst, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L2_SRC_ONLY,
-					&hdrs_hint_eth_src},
+		&hdrs_hint_eth_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ETH,
+		&hdrs_hint_eth, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_S_VLAN,
+		&hdrs_hint_svlan, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV4, ETH_RSS_C_VLAN,
+		&hdrs_hint_cvlan, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_SRC_ONLY,
+		&hdrs_hint_ipv6_src, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L3_DST_ONLY,
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY,
-					&hdrs_hint_ipv6_src},
+		&hdrs_hint_ipv6_src, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_ESP,
+		&hdrs_hint_ipv6_esp, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_AH,
+		&hdrs_hint_ipv6_ah, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_L2TPV3,
+		&hdrs_hint_ipv6_l2tpv3, IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6, ETH_RSS_IPV6,
+		&hdrs_hint_ipv6, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_udp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_udp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_udp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_udp_src_port},
+		&hdrs_hint_ipv6_udp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_udp_dst_port},
+		&hdrs_hint_ipv6_udp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_PFCP,
-					&hdrs_hint_ipv6_pfcp},
+		&hdrs_hint_ipv6_pfcp, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_UDP, ETH_RSS_NONFRAG_IPV6_UDP,
-					&hdrs_hint_ipv6_udp},
+		&hdrs_hint_ipv6_udp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_tcp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_tcp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_tcp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_tcp_src_port},
+		&hdrs_hint_ipv6_tcp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_tcp_dst_port},
+		&hdrs_hint_ipv6_tcp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_TCP, ETH_RSS_NONFRAG_IPV6_TCP,
-					&hdrs_hint_ipv6_tcp},
+		&hdrs_hint_ipv6_tcp, IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_SRC_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_src_sctp_dst_port,
+		IAVF_GTPU_HINT_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_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_SRC_ONLY, &hdrs_hint_ipv6_dst_sctp_src_port,
+		IAVF_GTPU_HINT_NONE},
+	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY |
+		ETH_RSS_L4_DST_ONLY, &hdrs_hint_ipv6_dst_sctp_dst_port,
+		IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L3_DST_ONLY,
-					&hdrs_hint_ipv6_dst},
+		&hdrs_hint_ipv6_dst, IAVF_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_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_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_SRC_ONLY,
-					&hdrs_hint_ipv6_sctp_src_port},
+		&hdrs_hint_ipv6_sctp_src_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_L4_DST_ONLY,
-					&hdrs_hint_ipv6_sctp_dst_port},
+		&hdrs_hint_ipv6_sctp_dst_port, IAVF_GTPU_HINT_NONE},
 	{IAVF_PATTERN_HINT_IPV6_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP,
-					&hdrs_hint_ipv6_sctp},
+		&hdrs_hint_ipv6_sctp, IAVF_GTPU_HINT_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[],
+		      enum iavf_gtpu_hint *gtpu_hint)
 {
 	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_GTPU_HINT_UPLINK ||
+				    psc->pdu_type == IAVF_GTPU_HINT_DOWNLINK)) {
+				*rss_type |= ETH_RSS_GTPU;
+				*gtpu_hint = 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;
+	enum iavf_gtpu_hint gtpu_hint = IAVF_GTPU_HINT_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, &gtpu_hint);
 
 			/* 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 &&
+				    gtpu_hint == ht_map->gtpu_hint) {
 					type_match_item->hash_type =
 						ht_map->hash_type;
 					type_match_item->proto_hdrs =
--
2.20.1


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

* [dpdk-dev]  net/iavf: fix protocol field selector configure
@ 2020-05-22 11:10 Jeff Guo
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Guo @ 2020-05-22 11:10 UTC (permalink / raw)
  To: beilei.xing, qi.z.zhang, jingjing.wu; +Cc: xiaolong.ye, dev, jia.guo

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


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

end of thread, other threads:[~2020-05-25  6:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 23:17 [dpdk-dev] net/iavf: fix protocol field selector configure Jeff Guo
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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	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

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