net/ice/base: support L4 for QinQ switch filter
[dpdk.git] / drivers / net / ice / base / ice_switch.c
index f5dd86b..43ad018 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2001-2020 Intel Corporation
+ * Copyright(c) 2001-2021 Intel Corporation
  */
 
 #include "ice_switch.h"
 #define ICE_ETH_ETHTYPE_OFFSET         12
 #define ICE_ETH_VLAN_TCI_OFFSET                14
 #define ICE_MAX_VLAN_ID                        0xFFF
+#define ICE_IPV6_ETHER_ID              0x86DD
 #define ICE_IPV4_NVGRE_PROTO_ID                0x002F
 #define ICE_PPP_IPV6_PROTO_ID          0x0057
-#define ICE_IPV6_ETHER_ID              0x86DD
+#define ICE_TCP_PROTO_ID               0x06
+#define ICE_GTPU_PROFILE               24
+#define ICE_ETH_P_8021Q                        0x8100
+#define ICE_MPLS_ETHER_ID              0x8847
 
 /* Dummy ethernet header needed in the ice_aqc_sw_rules_elem
  * struct to configure any switch filter rules.
@@ -256,8 +260,8 @@ static const u8 dummy_udp_packet[] = {
 /* offset info for MAC + VLAN + IPv4 + UDP dummy packet */
 static const struct ice_dummy_pkt_offsets dummy_vlan_udp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_ETYPE_OL,         12 },
-       { ICE_VLAN_OFOS,        14 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
        { ICE_IPV4_OFOS,        18 },
        { ICE_UDP_ILOS,         38 },
        { ICE_PROTOCOL_LAST,    0 },
@@ -269,9 +273,9 @@ static const u8 dummy_vlan_udp_packet[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
 
-       0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_OFOS 14 */
+       0x08, 0x00,             /* ICE_ETYPE_OL 16 */
 
        0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 18 */
        0x00, 0x01, 0x00, 0x00,
@@ -317,11 +321,30 @@ static const u8 dummy_tcp_packet[] = {
        0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
+/* offset info for MAC + MPLS dummy packet */
+static const struct ice_dummy_pkt_offsets dummy_mpls_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+/* Dummy packet for MAC + MPLS */
+static const u8 dummy_mpls_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x88, 0x47,             /* ICE_ETYPE_OL 12 */
+       0x00, 0x00, 0x01, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
+};
+
 /* offset info for MAC + VLAN (C-tag, 802.1Q) + IPv4 + TCP dummy packet */
 static const struct ice_dummy_pkt_offsets dummy_vlan_tcp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_ETYPE_OL,         12 },
-       { ICE_VLAN_OFOS,        14 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
        { ICE_IPV4_OFOS,        18 },
        { ICE_TCP_IL,           38 },
        { ICE_PROTOCOL_LAST,    0 },
@@ -333,9 +356,9 @@ static const u8 dummy_vlan_tcp_packet[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
 
-       0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_OFOS 14 */
+       0x08, 0x00,             /* ICE_ETYPE_OL 16 */
 
        0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 18 */
        0x00, 0x01, 0x00, 0x00,
@@ -391,8 +414,8 @@ static const u8 dummy_tcp_ipv6_packet[] = {
 static const struct ice_dummy_pkt_offsets
 dummy_vlan_tcp_ipv6_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_ETYPE_OL,         12 },
-       { ICE_VLAN_OFOS,        14 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
        { ICE_IPV6_OFOS,        18 },
        { ICE_TCP_IL,           58 },
        { ICE_PROTOCOL_LAST,    0 },
@@ -404,9 +427,9 @@ static const u8 dummy_vlan_tcp_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
 
-       0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_OFOS 14 */
+       0x86, 0xDD,             /* ICE_ETYPE_OL 16 */
 
        0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 18 */
        0x00, 0x14, 0x06, 0x00, /* Next header is TCP */
@@ -446,7 +469,7 @@ static const u8 dummy_udp_ipv6_packet[] = {
        0x86, 0xDD,             /* ICE_ETYPE_OL 12 */
 
        0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 40 */
-       0x00, 0x08, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x10, 0x11, 0x00, /* Next header UDP */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
@@ -457,7 +480,10 @@ static const u8 dummy_udp_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00,
 
        0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 54 */
-       0x00, 0x08, 0x00, 0x00,
+       0x00, 0x10, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* needed for ESP packets */
+       0x00, 0x00, 0x00, 0x00,
 
        0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
@@ -466,8 +492,8 @@ static const u8 dummy_udp_ipv6_packet[] = {
 static const struct ice_dummy_pkt_offsets
 dummy_vlan_udp_ipv6_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_ETYPE_OL,         12 },
-       { ICE_VLAN_OFOS,        14 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
        { ICE_IPV6_OFOS,        18 },
        { ICE_UDP_ILOS,         58 },
        { ICE_PROTOCOL_LAST,    0 },
@@ -479,9 +505,9 @@ static const u8 dummy_vlan_udp_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+       0x81, 0x00, 0x00, 0x00,/* ICE_VLAN_OFOS 12 */
 
-       0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_OFOS 14 */
+       0x86, 0xDD,             /* ICE_ETYPE_OL 16 */
 
        0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 18 */
        0x00, 0x08, 0x11, 0x00, /* Next header UDP */
@@ -500,84 +526,134 @@ static const u8 dummy_vlan_udp_ipv6_packet[] = {
        0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {
+/* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner TCP */
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_tcp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
        { ICE_IPV4_OFOS,        14 },
        { ICE_UDP_OF,           34 },
        { ICE_GTP,              42 },
+       { ICE_IPV4_IL,          62 },
+       { ICE_TCP_IL,           82 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_udp_gtp_packet[] = {
-       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+static const u8 dummy_ipv4_gtpu_ipv4_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x08, 0x00,
 
-       0x45, 0x00, 0x00, 0x30, /* ICE_IPV4_OFOS 14 */
+       0x45, 0x00, 0x00, 0x58, /* IP 14 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x11, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x08, 0x68, /* ICE_UDP_OF 34 */
-       0x00, 0x1c, 0x00, 0x00,
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x44, 0x00, 0x00,
 
-       0x34, 0xff, 0x00, 0x0c, /* ICE_GTP 42 */
+       0x34, 0xff, 0x00, 0x34, /* GTP-U Header 42 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x85,
 
-       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x28, /* IP 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x06, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* TCP 82 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_offsets[] = {
+/* Outer IPv4 + Outer UDP + GTP + Inner IPv4 + Inner UDP */
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_udp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_ETYPE_OL,         12 },
-       { ICE_VLAN_OFOS,        14},
-       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV4_IL,          62 },
+       { ICE_UDP_ILOS,         82 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_pppoe_ipv4_packet[] = {
-       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+static const u8 dummy_ipv4_gtpu_ipv4_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
-
-       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+       0x45, 0x00, 0x00, 0x4c, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
 
-       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
-       0x00, 0x16,
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x38, 0x00, 0x00,
 
-       0x00, 0x21,             /* PPP Link Layer 24 */
+       0x34, 0xff, 0x00, 0x28, /* GTP-U Header 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
 
-       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_IL 26 */
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 54 */
        0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x1c, /* IP 62 */
        0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00, 0x00, 0x00, /* UDP 82 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-static const u8 dummy_pppoe_ipv6_packet[] = {
-       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+/* Outer IPv6 + Outer UDP + GTP + Inner IPv4 + Inner TCP */
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_tcp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV6_IL,          62 },
+       { ICE_TCP_IL,           102 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_gtpu_ipv6_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
 
-       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+       0x45, 0x00, 0x00, 0x6c, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x58, 0x00, 0x00,
 
-       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
-       0x00, 0x2a,
+       0x34, 0xff, 0x00, 0x48, /* GTP-U Header 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
 
-       0x00, 0x57,             /* PPP Link Layer 24 */
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 54 */
+       0x00, 0x00, 0x00, 0x00,
 
-       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
-       0x00, 0x00, 0x3b, 0x00,
+       0x60, 0x00, 0x00, 0x00, /* IPv6 62 */
+       0x00, 0x14, 0x06, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
@@ -587,102 +663,1113 @@ static const u8 dummy_pppoe_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00, 0x00, 0x00, /* TCP 102 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv4_esp_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_udp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
        { ICE_IPV4_OFOS,        14 },
-       { ICE_ESP,                      34 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV6_IL,          62 },
+       { ICE_UDP_ILOS,         102 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv4_esp_pkt[] = {
-       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+static const u8 dummy_ipv4_gtpu_ipv6_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x08, 0x00,
 
-       0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_IL 14 */
-       0x00, 0x00, 0x40, 0x00,
-       0x40, 0x32, 0x00, 0x00,
+       0x45, 0x00, 0x00, 0x60, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x00, 0x00, /* ICE_ESP 34 */
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x4c, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x3c, /* GTP-U Header 42 */
        0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 62 */
+       0x00, 0x08, 0x11, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* UDP 102 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv6_esp_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_tcp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
        { ICE_IPV6_OFOS,        14 },
-       { ICE_ESP,                      54 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV4_IL,          82 },
+       { ICE_TCP_IL,           102 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv6_esp_pkt[] = {
-       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+static const u8 dummy_ipv6_gtpu_ipv4_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x86, 0xDD,
+       0x86, 0xdd,
 
-       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
-       0x00, 0x08, 0x32, 0x00, /* Next header ESP */
+       0x60, 0x00, 0x00, 0x00, /* IPv6 14 */
+       0x00, 0x44, 0x11, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 54 */
+       0x00, 0x44, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x34, /* GTP-U Header 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 74 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x28, /* IP 82 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x06, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* TCP 102 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV4_IL,          82 },
+       { ICE_UDP_ILOS,         102 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtpu_ipv4_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 14 */
+       0x00, 0x38, 0x11, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 54 */
+       0x00, 0x38, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28, /* GTP-U Header 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 74 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x1c, /* IP 82 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* UDP 102 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_tcp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV6_IL,          82 },
+       { ICE_TCP_IL,           122 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtpu_ipv6_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 14 */
+       0x00, 0x58, 0x11, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 54 */
+       0x00, 0x58, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x48, /* GTP-U Header 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 74 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 82 */
+       0x00, 0x14, 0x06, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* TCP 122 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV6_IL,          82 },
+       { ICE_UDP_ILOS,         122 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 14 */
+       0x00, 0x4c, 0x11, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 54 */
+       0x00, 0x4c, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x3c, /* GTP-U Header 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 74 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 82 */
+       0x00, 0x08, 0x11, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* UDP 122 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv4_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV4_IL,          62 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_gtpu_ipv4_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x44, /* ICE_IPV4_OFOS 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 34 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28,  /* ICE_GTP 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_IL 62 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_ipv4_gtpu_ipv6_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV6_IL,          62 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_gtpu_ipv6_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x58, /* ICE_IPV4_OFOS 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 34 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28,  /* ICE_GTP 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_IL 62 */
+       0x00, 0x00, 0x3b, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv4_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV4_IL,          82 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtpu_ipv4_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x58, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28,  /* ICE_GTP 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_IL 82 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_ipv6_gtpu_ipv6_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV6_IL,          82 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtpu_ipv6_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x6c, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28,  /* ICE_GTP 62 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFIL 82 */
+       0x00, 0x00, 0x3b, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,
+};
+
+static const struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_udp_gtp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x30, /* ICE_IPV4_OFOS 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* ICE_UDP_OF 34 */
+       0x00, 0x1c, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x0c, /* ICE_GTP 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */
+       0x00, 0x00, 0x00, 0x00,
+
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_gtp_no_pay_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP_NO_PAY,       42 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_ipv6_gtp_no_pay_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP_NO_PAY,       62 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_gtp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xdd,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x6c, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x30, 0x00, 0x00, 0x28,  /* ICE_GTP 62 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,
+};
+
+static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv4_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv4_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 24 */
+
+       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_IL 26 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_tcp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_TCP_IL,           46 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv4_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 24 */
+
+       0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 26 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x06, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 46 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_UDP_ILOS,         46 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv4_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 24 */
+
+       0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 26 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 46 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv6_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 24 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
+       0x00, 0x00, 0x3b, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_tcp_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_TCP_IL,           66 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv6_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 24 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
+       0x00, 0x14, 0x06, 0x00, /* Next header is TCP */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 66 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_udp_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_OFOS,        12 },
+       { ICE_ETYPE_OL,         16 },
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_UDP_ILOS,         66 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv6_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_OFOS 12 */
+
+       0x88, 0x64,             /* ICE_ETYPE_OL 16 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 24 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
+       0x00, 0x08, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 66 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_esp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_ESP,                      34 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_esp_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_IL 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x32, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_ESP 34 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_esp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_ESP,                      54 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_esp_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xDD,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x08, 0x32, 0x00, /* Next header ESP */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_ESP 54 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_ah_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_AH,                       34 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_ah_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x20, /* ICE_IPV4_IL 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x33, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_AH 34 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_ah_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_AH,                       54 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_ah_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xDD,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x0c, 0x33, 0x00, /* Next header AH */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_AH 54 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_nat_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_ILOS,         34 },
+       { ICE_NAT_T,            42 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_nat_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x24, /* ICE_IPV4_IL 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x11, 0x94, /* ICE_NAT_T 34 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_nat_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_ILOS,         54 },
+       { ICE_NAT_T,            62 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_nat_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xDD,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
+       0x00, 0x10, 0x11, 0x00, /* Next header NAT_T */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x11, 0x94, /* ICE_NAT_T 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_L2TPV3,           34 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv4_l2tpv3_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x20, /* ICE_IPV4_IL 14 */
+       0x00, 0x00, 0x40, 0x00,
+       0x40, 0x73, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_L2TPV3 34 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_L2TPV3,           54 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_ipv6_l2tpv3_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x86, 0xDD,
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_IL 14 */
+       0x00, 0x0c, 0x73, 0x40,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_L2TPV3 54 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_qinq_ipv4_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV4_OFOS,        22 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_qinq_ipv4_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x08, 0x00,             /* ICE_ETYPE_OL 20 */
+
+       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_OFOS 22 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_ipv4_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV4_OFOS,        22 },
+       { ICE_UDP_ILOS,         42 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_qinq_ipv4_udp_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x08, 0x00,             /* ICE_ETYPE_OL 20 */
+
+       0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 22 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x00, 0x00, /* ICE_ESP 54 */
-       0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 42 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv4_ah_packet_offsets[] = {
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_ipv4_tcp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV4_OFOS,        14 },
-       { ICE_AH,                       34 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV4_OFOS,        22 },
+       { ICE_TCP_IL,           42 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv4_ah_pkt[] = {
+static const u8 dummy_qinq_ipv4_tcp_pkt[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x08, 0x00,
 
-       0x45, 0x00, 0x00, 0x20, /* ICE_IPV4_IL 14 */
-       0x00, 0x00, 0x40, 0x00,
-       0x40, 0x33, 0x00, 0x00,
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x08, 0x00,             /* ICE_ETYPE_OL 20 */
+
+       0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 22 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x06, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x00, 0x00, /* ICE_AH 34 */
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 42 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv6_ah_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_qinq_ipv6_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV6_OFOS,        14 },
-       { ICE_AH,                       54 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV6_OFOS,        22 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv6_ah_pkt[] = {
+static const u8 dummy_qinq_ipv6_pkt[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x86, 0xDD,
 
-       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
-       0x00, 0x0c, 0x33, 0x00, /* Next header AH */
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x86, 0xDD,             /* ICE_ETYPE_OL 20 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */
+       0x00, 0x00, 0x3b, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
@@ -692,56 +1779,68 @@ static const u8 dummy_ipv6_ah_pkt[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x00, 0x00, /* ICE_AH 54 */
-       0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv4_nat_packet_offsets[] = {
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_ipv6_udp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV4_OFOS,        14 },
-       { ICE_UDP_ILOS,         34 },
-       { ICE_NAT_T,            42 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV6_OFOS,        22 },
+       { ICE_UDP_ILOS,         62 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv4_nat_pkt[] = {
+static const u8 dummy_qinq_ipv6_udp_pkt[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x08, 0x00,
 
-       0x45, 0x00, 0x00, 0x24, /* ICE_IPV4_IL 14 */
-       0x00, 0x00, 0x40, 0x00,
-       0x40, 0x11, 0x00, 0x00,
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x86, 0xDD,             /* ICE_ETYPE_OL 20 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */
+       0x00, 0x08, 0x11, 0x00, /* Next header UDP */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-
-       0x00, 0x00, 0x11, 0x94, /* ICE_NAT_T 34 */
        0x00, 0x00, 0x00, 0x00,
-
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 62 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv6_nat_packet_offsets[] = {
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_ipv6_tcp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV6_OFOS,        14 },
-       { ICE_UDP_ILOS,         54 },
-       { ICE_NAT_T,            62 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_IPV6_OFOS,        22 },
+       { ICE_TCP_IL,           62 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv6_nat_pkt[] = {
+static const u8 dummy_qinq_ipv6_tcp_pkt[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x86, 0xDD,
 
-       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */
-       0x00, 0x10, 0x11, 0x00, /* Next header NAT_T */
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x86, 0xDD,             /* ICE_ETYPE_OL 20 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */
+       0x00, 0x14, 0x06, 0x00, /* Next header TCP */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
@@ -751,55 +1850,85 @@ static const u8 dummy_ipv6_nat_pkt[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x11, 0x94, /* ICE_NAT_T 54 */
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 62 */
        0x00, 0x00, 0x00, 0x00,
-
        0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
 
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv4_l2tpv3_packet_offsets[] = {
+static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV4_OFOS,        14 },
-       { ICE_L2TPV3,           34 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_PPPOE,            22 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv4_l2tpv3_pkt[] = {
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_pppoe_ipv4_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_PPPOE,            22 },
+       { ICE_IPV4_OFOS,        30 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_qinq_pppoe_ipv4_pkt[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x08, 0x00,
 
-       0x45, 0x00, 0x00, 0x20, /* ICE_IPV4_IL 14 */
-       0x00, 0x00, 0x40, 0x00,
-       0x40, 0x73, 0x00, 0x00,
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x88, 0x64,             /* ICE_ETYPE_OL 20 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 22 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 28 */
+
+       0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_OFOS 30 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-
-       0x00, 0x00, 0x00, 0x00, /* ICE_L2TPV3 34 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
 };
 
-static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = {
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_ipv6_offsets[] = {
        { ICE_MAC_OFOS,         0 },
-       { ICE_IPV6_OFOS,        14 },
-       { ICE_L2TPV3,           54 },
+       { ICE_VLAN_EX,          12 },
+       { ICE_VLAN_IN,          16 },
+       { ICE_ETYPE_OL,         20 },
+       { ICE_PPPOE,            22 },
+       { ICE_IPV6_OFOS,        30 },
        { ICE_PROTOCOL_LAST,    0 },
 };
 
-static const u8 dummy_ipv6_l2tpv3_pkt[] = {
+static const u8 dummy_qinq_pppoe_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-       0x86, 0xDD,
 
-       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_IL 14 */
-       0x00, 0x0c, 0x73, 0x40,
+       0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */
+       0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */
+       0x88, 0x64,             /* ICE_ETYPE_OL 20 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 22 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 28*/
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 30 */
+       0x00, 0x00, 0x3b, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
@@ -809,9 +1938,6 @@ static const u8 dummy_ipv6_l2tpv3_pkt[] = {
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
 
-       0x00, 0x00, 0x00, 0x00, /* ICE_L2TPV3 54 */
-       0x00, 0x00, 0x00, 0x00,
-       0x00, 0x00, 0x00, 0x00,
        0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
 };
 
@@ -838,6 +1964,234 @@ static void ice_collect_result_idx(struct ice_aqc_recipe_data_elem *buf,
                            ~ICE_AQ_RECIPE_RESULT_EN, recp->res_idxs);
 }
 
+static struct ice_prof_type_entry ice_prof_type_tbl[ICE_GTPU_PROFILE] = {
+       { ICE_PROFID_IPV4_GTPU_IPV4_OTHER,    ICE_SW_TUN_IPV4_GTPU_IPV4},
+       { ICE_PROFID_IPV4_GTPU_IPV4_UDP,      ICE_SW_TUN_IPV4_GTPU_IPV4_UDP},
+       { ICE_PROFID_IPV4_GTPU_IPV4_TCP,      ICE_SW_TUN_IPV4_GTPU_IPV4_TCP},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER, ICE_SW_TUN_IPV4_GTPU_EH_IPV4},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP,   ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP,   ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP},
+       { ICE_PROFID_IPV4_GTPU_IPV6_OTHER,    ICE_SW_TUN_IPV4_GTPU_IPV6},
+       { ICE_PROFID_IPV4_GTPU_IPV6_UDP,      ICE_SW_TUN_IPV4_GTPU_IPV6_UDP},
+       { ICE_PROFID_IPV4_GTPU_IPV6_TCP,      ICE_SW_TUN_IPV4_GTPU_IPV6_TCP},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV6_OTHER, ICE_SW_TUN_IPV4_GTPU_EH_IPV6},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP,   ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP},
+       { ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP,   ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP},
+       { ICE_PROFID_IPV6_GTPU_IPV4_OTHER,    ICE_SW_TUN_IPV6_GTPU_IPV4},
+       { ICE_PROFID_IPV6_GTPU_IPV4_UDP,      ICE_SW_TUN_IPV6_GTPU_IPV4_UDP},
+       { ICE_PROFID_IPV6_GTPU_IPV4_TCP,      ICE_SW_TUN_IPV6_GTPU_IPV4_TCP},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV4_OTHER, ICE_SW_TUN_IPV6_GTPU_EH_IPV4},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP,   ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP,   ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP},
+       { ICE_PROFID_IPV6_GTPU_IPV6_OTHER,    ICE_SW_TUN_IPV6_GTPU_IPV6},
+       { ICE_PROFID_IPV6_GTPU_IPV6_UDP,      ICE_SW_TUN_IPV6_GTPU_IPV6_UDP},
+       { ICE_PROFID_IPV6_GTPU_IPV6_TCP,      ICE_SW_TUN_IPV6_GTPU_IPV6_TCP},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV6_OTHER, ICE_SW_TUN_IPV6_GTPU_EH_IPV6},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP,   ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP},
+       { ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP,   ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP},
+};
+
+/**
+ * ice_get_tun_type_for_recipe - get tunnel type for the recipe
+ * @rid: recipe ID that we are populating
+ */
+static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan)
+{
+       u8 vxlan_profile[12] = {10, 11, 12, 16, 17, 18, 22, 23, 24, 25, 26, 27};
+       u8 gre_profile[12] = {13, 14, 15, 19, 20, 21, 28, 29, 30, 31, 32, 33};
+       u8 pppoe_profile[7] = {34, 35, 36, 37, 38, 39, 40};
+       u8 non_tun_profile[6] = {4, 5, 6, 7, 8, 9};
+       enum ice_sw_tunnel_type tun_type;
+       u16 i, j, k, profile_num = 0;
+       bool non_tun_valid = false;
+       bool pppoe_valid = false;
+       bool vxlan_valid = false;
+       bool gre_valid = false;
+       bool gtp_valid = false;
+       bool flag_valid = false;
+
+       for (j = 0; j < ICE_MAX_NUM_PROFILES; j++) {
+               if (!ice_is_bit_set(recipe_to_profile[rid], j))
+                       continue;
+               else
+                       profile_num++;
+
+               for (i = 0; i < 12; i++) {
+                       if (gre_profile[i] == j)
+                               gre_valid = true;
+               }
+
+               for (i = 0; i < 12; i++) {
+                       if (vxlan_profile[i] == j)
+                               vxlan_valid = true;
+               }
+
+               for (i = 0; i < 7; i++) {
+                       if (pppoe_profile[i] == j)
+                               pppoe_valid = true;
+               }
+
+               for (i = 0; i < 6; i++) {
+                       if (non_tun_profile[i] == j)
+                               non_tun_valid = true;
+               }
+
+               if (j >= ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER &&
+                   j <= ICE_PROFID_IPV6_GTPU_IPV6_TCP)
+                       gtp_valid = true;
+
+               if ((j >= ICE_PROFID_IPV4_ESP &&
+                    j <= ICE_PROFID_IPV6_PFCP_SESSION) ||
+                   (j >= ICE_PROFID_IPV4_GTPC_TEID &&
+                    j <= ICE_PROFID_IPV6_GTPU_TEID))
+                       flag_valid = true;
+       }
+
+       if (!non_tun_valid && vxlan_valid)
+               tun_type = ICE_SW_TUN_VXLAN;
+       else if (!non_tun_valid && gre_valid)
+               tun_type = ICE_SW_TUN_NVGRE;
+       else if (!non_tun_valid && pppoe_valid)
+               tun_type = ICE_SW_TUN_PPPOE;
+       else if (!non_tun_valid && gtp_valid)
+               tun_type = ICE_SW_TUN_GTP;
+       else if (non_tun_valid &&
+                (vxlan_valid || gre_valid || gtp_valid || pppoe_valid))
+               tun_type = ICE_SW_TUN_AND_NON_TUN;
+       else if (non_tun_valid && !vxlan_valid && !gre_valid && !gtp_valid &&
+                !pppoe_valid)
+               tun_type = ICE_NON_TUN;
+       else
+               tun_type = ICE_NON_TUN;
+
+       if (profile_num > 1 && tun_type == ICE_SW_TUN_PPPOE) {
+               i = ice_is_bit_set(recipe_to_profile[rid],
+                                  ICE_PROFID_PPPOE_IPV4_OTHER);
+               j = ice_is_bit_set(recipe_to_profile[rid],
+                                  ICE_PROFID_PPPOE_IPV6_OTHER);
+               if (i && !j)
+                       tun_type = ICE_SW_TUN_PPPOE_IPV4;
+               else if (!i && j)
+                       tun_type = ICE_SW_TUN_PPPOE_IPV6;
+       }
+
+       if (tun_type == ICE_SW_TUN_GTP) {
+               for (k = 0; k < ARRAY_SIZE(ice_prof_type_tbl); k++)
+                       if (ice_is_bit_set(recipe_to_profile[rid],
+                                          ice_prof_type_tbl[k].prof_id)) {
+                               tun_type = ice_prof_type_tbl[k].type;
+                               break;
+                       }
+       }
+
+       if (profile_num == 1 && (flag_valid || non_tun_valid || pppoe_valid)) {
+               for (j = 0; j < ICE_MAX_NUM_PROFILES; j++) {
+                       if (ice_is_bit_set(recipe_to_profile[rid], j)) {
+                               switch (j) {
+                               case ICE_PROFID_IPV4_TCP:
+                                       tun_type = ICE_SW_IPV4_TCP;
+                                       break;
+                               case ICE_PROFID_IPV4_UDP:
+                                       tun_type = ICE_SW_IPV4_UDP;
+                                       break;
+                               case ICE_PROFID_IPV6_TCP:
+                                       tun_type = ICE_SW_IPV6_TCP;
+                                       break;
+                               case ICE_PROFID_IPV6_UDP:
+                                       tun_type = ICE_SW_IPV6_UDP;
+                                       break;
+                               case ICE_PROFID_PPPOE_PAY:
+                                       tun_type = ICE_SW_TUN_PPPOE_PAY;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV4_TCP:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV4_TCP;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV4_UDP:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV4_UDP;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV4_OTHER:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV4;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV6_TCP:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV6_TCP;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV6_UDP:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV6_UDP;
+                                       break;
+                               case ICE_PROFID_PPPOE_IPV6_OTHER:
+                                       tun_type = ICE_SW_TUN_PPPOE_IPV6;
+                                       break;
+                               case ICE_PROFID_IPV4_ESP:
+                                       tun_type = ICE_SW_TUN_IPV4_ESP;
+                                       break;
+                               case ICE_PROFID_IPV6_ESP:
+                                       tun_type = ICE_SW_TUN_IPV6_ESP;
+                                       break;
+                               case ICE_PROFID_IPV4_AH:
+                                       tun_type = ICE_SW_TUN_IPV4_AH;
+                                       break;
+                               case ICE_PROFID_IPV6_AH:
+                                       tun_type = ICE_SW_TUN_IPV6_AH;
+                                       break;
+                               case ICE_PROFID_IPV4_NAT_T:
+                                       tun_type = ICE_SW_TUN_IPV4_NAT_T;
+                                       break;
+                               case ICE_PROFID_IPV6_NAT_T:
+                                       tun_type = ICE_SW_TUN_IPV6_NAT_T;
+                                       break;
+                               case ICE_PROFID_IPV4_PFCP_NODE:
+                                       tun_type =
+                                       ICE_SW_TUN_PROFID_IPV4_PFCP_NODE;
+                                       break;
+                               case ICE_PROFID_IPV6_PFCP_NODE:
+                                       tun_type =
+                                       ICE_SW_TUN_PROFID_IPV6_PFCP_NODE;
+                                       break;
+                               case ICE_PROFID_IPV4_PFCP_SESSION:
+                                       tun_type =
+                                       ICE_SW_TUN_PROFID_IPV4_PFCP_SESSION;
+                                       break;
+                               case ICE_PROFID_IPV6_PFCP_SESSION:
+                                       tun_type =
+                                       ICE_SW_TUN_PROFID_IPV6_PFCP_SESSION;
+                                       break;
+                               case ICE_PROFID_MAC_IPV4_L2TPV3:
+                                       tun_type = ICE_SW_TUN_IPV4_L2TPV3;
+                                       break;
+                               case ICE_PROFID_MAC_IPV6_L2TPV3:
+                                       tun_type = ICE_SW_TUN_IPV6_L2TPV3;
+                                       break;
+                               case ICE_PROFID_IPV4_GTPU_TEID:
+                                       tun_type = ICE_SW_TUN_IPV4_GTPU_NO_PAY;
+                                       break;
+                               case ICE_PROFID_IPV6_GTPU_TEID:
+                                       tun_type = ICE_SW_TUN_IPV6_GTPU_NO_PAY;
+                                       break;
+                               default:
+                                       break;
+                               }
+
+                               return tun_type;
+                       }
+               }
+       }
+
+       if (vlan && tun_type == ICE_SW_TUN_PPPOE)
+               tun_type = ICE_SW_TUN_PPPOE_QINQ;
+       else if (vlan && tun_type == ICE_SW_TUN_PPPOE_IPV6)
+               tun_type = ICE_SW_TUN_PPPOE_IPV6_QINQ;
+       else if (vlan && tun_type == ICE_SW_TUN_PPPOE_IPV4)
+               tun_type = ICE_SW_TUN_PPPOE_IPV4_QINQ;
+       else if (vlan && tun_type == ICE_SW_TUN_PPPOE_PAY)
+               tun_type = ICE_SW_TUN_PPPOE_PAY_QINQ;
+       else if (vlan && tun_type == ICE_SW_TUN_AND_NON_TUN)
+               tun_type = ICE_SW_TUN_AND_NON_TUN_QINQ;
+       else if (vlan && tun_type == ICE_NON_TUN)
+               tun_type = ICE_NON_TUN_QINQ;
+
+       return tun_type;
+}
+
 /**
  * ice_get_recp_frm_fw - update SW bookkeeping from FW recipe entries
  * @hw: pointer to hardware structure
@@ -859,6 +2213,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
        struct ice_prot_lkup_ext *lkup_exts;
        enum ice_status status;
        u8 fv_word_idx = 0;
+       bool vlan = false;
        u16 sub_recps;
 
        ice_zero_bitmap(result_bm, ICE_MAX_FV_WORDS);
@@ -947,6 +2302,9 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
                        lkup_exts->fv_words[fv_word_idx].off = off;
                        lkup_exts->field_mask[fv_word_idx] =
                                rg_entry->fv_mask[i];
+                       if (prot == ICE_META_DATA_ID_HW &&
+                           off == ICE_TUN_FLAG_MDID_OFF)
+                               vlan = true;
                        fv_word_idx++;
                }
                /* populate rg_list with the data from the child entry of this
@@ -981,6 +2339,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
        lkup_exts->n_val_words = fv_word_idx;
        recps[rid].big_recp = (num_recps > 1);
        recps[rid].n_grp_count = (u8)num_recps;
+       recps[rid].tun_type = ice_get_tun_type_for_recipe(rid, vlan);
        recps[rid].root_buf = (struct ice_aqc_recipe_data_elem *)
                ice_memdup(hw, tmp, recps[rid].n_grp_count *
                           sizeof(*recps[rid].root_buf), ICE_NONDMA_TO_NONDMA);
@@ -1004,13 +2363,12 @@ err_unroll:
  * this array is the recipe ID and the element is the mapping of which profiles
  * is this recipe mapped to.
  */
-static void
-ice_get_recp_to_prof_map(struct ice_hw *hw)
+static void ice_get_recp_to_prof_map(struct ice_hw *hw)
 {
        ice_declare_bitmap(r_bitmap, ICE_MAX_NUM_RECIPES);
        u16 i;
 
-       for (i = 0; i < ICE_MAX_NUM_PROFILES; i++) {
+       for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) {
                u16 j;
 
                ice_zero_bitmap(profile_to_recipe[i], ICE_MAX_NUM_RECIPES);
@@ -1019,9 +2377,8 @@ ice_get_recp_to_prof_map(struct ice_hw *hw)
                        continue;
                ice_cp_bitmap(profile_to_recipe[i], r_bitmap,
                              ICE_MAX_NUM_RECIPES);
-               for (j = 0; j < ICE_MAX_NUM_RECIPES; j++)
-                       if (ice_is_bit_set(r_bitmap, j))
-                               ice_set_bit(i, recipe_to_profile[j]);
+               ice_for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES)
+                       ice_set_bit(i, recipe_to_profile[j]);
        }
 }
 
@@ -1066,7 +2423,7 @@ ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list)
  * @num_elems: pointer to number of elements
  * @cd: pointer to command details structure or NULL
  *
- * Get switch configuration (0x0200) to be placed in 'buff'.
+ * Get switch configuration (0x0200) to be placed in buf.
  * This admin command returns information such as initial VSI/port number
  * and switch ID it belongs to.
  *
@@ -1083,13 +2440,13 @@ ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list)
  * parsing the response buffer.
  */
 static enum ice_status
-ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp *buf,
+ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp_elem *buf,
                  u16 buf_size, u16 *req_desc, u16 *num_elems,
                  struct ice_sq_cd *cd)
 {
        struct ice_aqc_get_sw_cfg *cmd;
-       enum ice_status status;
        struct ice_aq_desc desc;
+       enum ice_status status;
 
        ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sw_cfg);
        cmd = &desc.params.get_sw_conf;
@@ -1104,6 +2461,71 @@ ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp *buf,
        return status;
 }
 
+/**
+ * ice_alloc_rss_global_lut - allocate a RSS global LUT
+ * @hw: pointer to the HW struct
+ * @shared_res: true to allocate as a shared resource and false to allocate as a dedicated resource
+ * @global_lut_id: output parameter for the RSS global LUT's ID
+ */
+enum ice_status ice_alloc_rss_global_lut(struct ice_hw *hw, bool shared_res, u16 *global_lut_id)
+{
+       struct ice_aqc_alloc_free_res_elem *sw_buf;
+       enum ice_status status;
+       u16 buf_len;
+
+       buf_len = ice_struct_size(sw_buf, elem, 1);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
+       if (!sw_buf)
+               return ICE_ERR_NO_MEMORY;
+
+       sw_buf->num_elems = CPU_TO_LE16(1);
+       sw_buf->res_type = CPU_TO_LE16(ICE_AQC_RES_TYPE_GLOBAL_RSS_HASH |
+                                      (shared_res ? ICE_AQC_RES_TYPE_FLAG_SHARED :
+                                      ICE_AQC_RES_TYPE_FLAG_DEDICATED));
+
+       status = ice_aq_alloc_free_res(hw, 1, sw_buf, buf_len, ice_aqc_opc_alloc_res, NULL);
+       if (status) {
+               ice_debug(hw, ICE_DBG_RES, "Failed to allocate %s RSS global LUT, status %d\n",
+                         shared_res ? "shared" : "dedicated", status);
+               goto ice_alloc_global_lut_exit;
+       }
+
+       *global_lut_id = LE16_TO_CPU(sw_buf->elem[0].e.sw_resp);
+
+ice_alloc_global_lut_exit:
+       ice_free(hw, sw_buf);
+       return status;
+}
+
+/**
+ * ice_free_rss_global_lut - free a RSS global LUT
+ * @hw: pointer to the HW struct
+ * @global_lut_id: ID of the RSS global LUT to free
+ */
+enum ice_status ice_free_rss_global_lut(struct ice_hw *hw, u16 global_lut_id)
+{
+       struct ice_aqc_alloc_free_res_elem *sw_buf;
+       u16 buf_len, num_elems = 1;
+       enum ice_status status;
+
+       buf_len = ice_struct_size(sw_buf, elem, num_elems);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
+       if (!sw_buf)
+               return ICE_ERR_NO_MEMORY;
+
+       sw_buf->num_elems = CPU_TO_LE16(num_elems);
+       sw_buf->res_type = CPU_TO_LE16(ICE_AQC_RES_TYPE_GLOBAL_RSS_HASH);
+       sw_buf->elem[0].e.sw_resp = CPU_TO_LE16(global_lut_id);
+
+       status = ice_aq_alloc_free_res(hw, num_elems, sw_buf, buf_len, ice_aqc_opc_free_res, NULL);
+       if (status)
+               ice_debug(hw, ICE_DBG_RES, "Failed to free RSS global LUT %d, status %d\n",
+                         global_lut_id, status);
+
+       ice_free(hw, sw_buf);
+       return status;
+}
+
 /**
  * ice_alloc_sw - allocate resources specific to switch
  * @hw: pointer to the HW struct
@@ -1123,9 +2545,8 @@ ice_alloc_sw(struct ice_hw *hw, bool ena_stats, bool shared_res, u16 *sw_id,
        enum ice_status status;
        u16 buf_len;
 
-       buf_len = sizeof(*sw_buf);
-       sw_buf = (struct ice_aqc_alloc_free_res_elem *)
-                  ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(sw_buf, elem, 1);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!sw_buf)
                return ICE_ERR_NO_MEMORY;
 
@@ -1205,9 +2626,8 @@ enum ice_status ice_free_sw(struct ice_hw *hw, u16 sw_id, u16 counter_id)
        enum ice_status status, ret_status;
        u16 buf_len;
 
-       buf_len = sizeof(*sw_buf);
-       sw_buf = (struct ice_aqc_alloc_free_res_elem *)
-                  ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(sw_buf, elem, 1);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!sw_buf)
                return ICE_ERR_NO_MEMORY;
 
@@ -1245,8 +2665,7 @@ enum ice_status ice_free_sw(struct ice_hw *hw, u16 sw_id, u16 counter_id)
        status = ice_aq_alloc_free_res(hw, 1, counter_buf, buf_len,
                                       ice_aqc_opc_free_res, NULL);
        if (status) {
-               ice_debug(hw, ICE_DBG_SW,
-                         "VEB counter resource could not be freed\n");
+               ice_debug(hw, ICE_DBG_SW, "VEB counter resource could not be freed\n");
                ret_status = status;
        }
 
@@ -1640,8 +3059,7 @@ ice_aq_add_update_mir_rule(struct ice_hw *hw, u16 rule_type, u16 dest_vsi,
                        return ICE_ERR_PARAM;
                break;
        default:
-               ice_debug(hw, ICE_DBG_SW,
-                         "Error due to unsupported rule_type %u\n", rule_type);
+               ice_debug(hw, ICE_DBG_SW, "Error due to unsupported rule_type %u\n", rule_type);
                return ICE_ERR_OUT_OF_RANGE;
        }
 
@@ -1663,8 +3081,7 @@ ice_aq_add_update_mir_rule(struct ice_hw *hw, u16 rule_type, u16 dest_vsi,
                         * than ICE_MAX_VSI, if not return with error.
                         */
                        if (id >= ICE_MAX_VSI) {
-                               ice_debug(hw, ICE_DBG_SW,
-                                         "Error VSI index (%u) out-of-range\n",
+                               ice_debug(hw, ICE_DBG_SW, "Error VSI index (%u) out-of-range\n",
                                          id);
                                ice_free(hw, mr_list);
                                return ICE_ERR_OUT_OF_RANGE;
@@ -1748,9 +3165,8 @@ ice_aq_alloc_free_vsi_list(struct ice_hw *hw, u16 *vsi_list_id,
        enum ice_status status;
        u16 buf_len;
 
-       buf_len = sizeof(*sw_buf);
-       sw_buf = (struct ice_aqc_alloc_free_res_elem *)
-               ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(sw_buf, elem, 1);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!sw_buf)
                return ICE_ERR_NO_MEMORY;
        sw_buf->num_elems = CPU_TO_LE16(1);
@@ -1793,7 +3209,7 @@ ice_aq_alloc_free_vsi_list_exit:
  * @hw: pointer to the HW struct
  * @bcast_thresh: represents the upper threshold for broadcast storm control
  * @mcast_thresh: represents the upper threshold for multicast storm control
- * @ctl_bitmask: storm control control knobs
+ * @ctl_bitmask: storm control knobs
  *
  * Sets the storm control configuration (0x0280)
  */
@@ -1820,7 +3236,7 @@ ice_aq_set_storm_ctrl(struct ice_hw *hw, u32 bcast_thresh, u32 mcast_thresh,
  * @hw: pointer to the HW struct
  * @bcast_thresh: represents the upper threshold for broadcast storm control
  * @mcast_thresh: represents the upper threshold for multicast storm control
- * @ctl_bitmask: storm control control knobs
+ * @ctl_bitmask: storm control knobs
  *
  * Gets the storm control configuration (0x0281)
  */
@@ -1866,6 +3282,7 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
                u8 num_rules, enum ice_adminq_opc opc, struct ice_sq_cd *cd)
 {
        struct ice_aq_desc desc;
+       enum ice_status status;
 
        ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
@@ -1879,7 +3296,12 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
        desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
        desc.params.sw_rules.num_rules_fltr_entry_index =
                CPU_TO_LE16(num_rules);
-       return ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+       status = ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+       if (opc != ice_aqc_opc_add_sw_rules &&
+           hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT)
+               status = ICE_ERR_DOES_NOT_EXIST;
+
+       return status;
 }
 
 /**
@@ -1952,12 +3374,69 @@ ice_aq_get_recipe(struct ice_hw *hw,
        buf_size = *num_recipes * sizeof(*s_recipe_list);
 
        status = ice_aq_send_cmd(hw, &desc, s_recipe_list, buf_size, cd);
-       /* cppcheck-suppress constArgument */
        *num_recipes = LE16_TO_CPU(cmd->num_sub_recipes);
 
        return status;
 }
 
+/**
+ * ice_update_recipe_lkup_idx - update a default recipe based on the lkup_idx
+ * @hw: pointer to the HW struct
+ * @params: parameters used to update the default recipe
+ *
+ * This function only supports updating default recipes and it only supports
+ * updating a single recipe based on the lkup_idx at a time.
+ *
+ * This is done as a read-modify-write operation. First, get the current recipe
+ * contents based on the recipe's ID. Then modify the field vector index and
+ * mask if it's valid at the lkup_idx. Finally, use the add recipe AQ to update
+ * the pre-existing recipe with the modifications.
+ */
+enum ice_status
+ice_update_recipe_lkup_idx(struct ice_hw *hw,
+                          struct ice_update_recipe_lkup_idx_params *params)
+{
+       struct ice_aqc_recipe_data_elem *rcp_list;
+       u16 num_recps = ICE_MAX_NUM_RECIPES;
+       enum ice_status status;
+
+       rcp_list = (struct ice_aqc_recipe_data_elem *)ice_malloc(hw, num_recps * sizeof(*rcp_list));
+       if (!rcp_list)
+               return ICE_ERR_NO_MEMORY;
+
+       /* read current recipe list from firmware */
+       rcp_list->recipe_indx = params->rid;
+       status = ice_aq_get_recipe(hw, rcp_list, &num_recps, params->rid, NULL);
+       if (status) {
+               ice_debug(hw, ICE_DBG_SW, "Failed to get recipe %d, status %d\n",
+                         params->rid, status);
+               goto error_out;
+       }
+
+       /* only modify existing recipe's lkup_idx and mask if valid, while
+        * leaving all other fields the same, then update the recipe firmware
+        */
+       rcp_list->content.lkup_indx[params->lkup_idx] = params->fv_idx;
+       if (params->mask_valid)
+               rcp_list->content.mask[params->lkup_idx] =
+                       CPU_TO_LE16(params->mask);
+
+       if (params->ignore_valid)
+               rcp_list->content.lkup_indx[params->lkup_idx] |=
+                       ICE_AQ_RECIPE_LKUP_IGNORE;
+
+       status = ice_aq_add_recipe(hw, &rcp_list[0], 1, NULL);
+       if (status)
+               ice_debug(hw, ICE_DBG_SW, "Failed to update recipe %d lkup_idx %d fv_idx %d mask %d mask_valid %s, status %d\n",
+                         params->rid, params->lkup_idx, params->fv_idx,
+                         params->mask, params->mask_valid ? "true" : "false",
+                         status);
+
+error_out:
+       ice_free(hw, rcp_list);
+       return status;
+}
+
 /**
  * ice_aq_map_recipe_to_profile - Map recipe to packet profile
  * @hw: pointer to the HW struct
@@ -2026,7 +3505,7 @@ enum ice_status ice_alloc_recipe(struct ice_hw *hw, u16 *rid)
        enum ice_status status;
        u16 buf_len;
 
-       buf_len = sizeof(*sw_buf);
+       buf_len = ice_struct_size(sw_buf, elem, 1);
        sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!sw_buf)
                return ICE_ERR_NO_MEMORY;
@@ -2066,8 +3545,7 @@ ice_init_port_info(struct ice_port_info *pi, u16 vsi_port_num, u8 type,
                pi->dflt_rx_vsi_num = ICE_DFLT_VSI_INVAL;
                break;
        default:
-               ice_debug(pi->hw, ICE_DBG_SW,
-                         "incorrect VSI/port type received\n");
+               ice_debug(pi->hw, ICE_DBG_SW, "incorrect VSI/port type received\n");
                break;
        }
 }
@@ -2077,7 +3555,7 @@ ice_init_port_info(struct ice_port_info *pi, u16 vsi_port_num, u8 type,
  */
 enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
 {
-       struct ice_aqc_get_sw_cfg_resp *rbuf;
+       struct ice_aqc_get_sw_cfg_resp_elem *rbuf;
        enum ice_status status;
        u8 num_total_ports;
        u16 req_desc = 0;
@@ -2087,7 +3565,7 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
 
        num_total_ports = 1;
 
-       rbuf = (struct ice_aqc_get_sw_cfg_resp *)
+       rbuf = (struct ice_aqc_get_sw_cfg_resp_elem *)
                ice_malloc(hw, ICE_SW_CFG_MAX_BUF_LEN);
 
        if (!rbuf)
@@ -2099,19 +3577,19 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
         * writing a non-zero value in req_desc
         */
        do {
+               struct ice_aqc_get_sw_cfg_resp_elem *ele;
+
                status = ice_aq_get_sw_cfg(hw, rbuf, ICE_SW_CFG_MAX_BUF_LEN,
                                           &req_desc, &num_elems, NULL);
 
                if (status)
                        break;
 
-               for (i = 0; i < num_elems; i++) {
-                       struct ice_aqc_get_sw_cfg_resp_elem *ele;
+               for (i = 0, ele = rbuf; i < num_elems; i++, ele++) {
                        u16 pf_vf_num, swid, vsi_port_num;
                        bool is_vf = false;
                        u8 res_type;
 
-                       ele = rbuf[i].elements;
                        vsi_port_num = LE16_TO_CPU(ele->vsi_port_num) &
                                ICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_M;
 
@@ -2128,11 +3606,14 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
                                        ICE_AQC_GET_SW_CONF_RESP_TYPE_S);
 
                        switch (res_type) {
+                       case ICE_AQC_GET_SW_CONF_RESP_VSI:
+                               if (hw->dcf_enabled && !is_vf)
+                                       hw->pf_id = pf_vf_num;
+                               break;
                        case ICE_AQC_GET_SW_CONF_RESP_PHYS_PORT:
                        case ICE_AQC_GET_SW_CONF_RESP_VIRT_PORT:
                                if (j == num_total_ports) {
-                                       ice_debug(hw, ICE_DBG_SW,
-                                                 "more ports than expected\n");
+                                       ice_debug(hw, ICE_DBG_SW, "more ports than expected\n");
                                        status = ICE_ERR_CFG;
                                        goto out;
                                }
@@ -2148,7 +3629,7 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
        } while (req_desc && !status);
 
 out:
-       ice_free(hw, (void *)rbuf);
+       ice_free(hw, rbuf);
        return status;
 }
 
@@ -2163,15 +3644,13 @@ out:
  */
 static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
 {
-       fi->lb_en = false;
-       fi->lan_en = false;
-
        if ((fi->flag & ICE_FLTR_RX) &&
            (fi->fltr_act == ICE_FWD_TO_VSI ||
             fi->fltr_act == ICE_FWD_TO_VSI_LIST) &&
            fi->lkup_type == ICE_SW_LKUP_LAST)
                fi->lan_en = true;
-
+       fi->lb_en = false;
+       fi->lan_en = false;
        if ((fi->flag & ICE_FLTR_TX) &&
            (fi->fltr_act == ICE_FWD_TO_VSI ||
             fi->fltr_act == ICE_FWD_TO_VSI_LIST ||
@@ -2229,6 +3708,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
                 struct ice_aqc_sw_rules_elem *s_rule, enum ice_adminq_opc opc)
 {
        u16 vlan_id = ICE_MAX_VLAN_ID + 1;
+       u16 vlan_tpid = ICE_ETH_P_8021Q;
        void *daddr = NULL;
        u16 eth_hdr_sz;
        u8 *eth_hdr;
@@ -2301,6 +3781,8 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
                break;
        case ICE_SW_LKUP_VLAN:
                vlan_id = f_info->l_data.vlan.vlan_id;
+               if (f_info->l_data.vlan.tpid_valid)
+                       vlan_tpid = f_info->l_data.vlan.tpid;
                if (f_info->fltr_act == ICE_FWD_TO_VSI ||
                    f_info->fltr_act == ICE_FWD_TO_VSI_LIST) {
                        act |= ICE_SINGLE_ACT_PRUNE;
@@ -2344,6 +3826,8 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
        if (!(vlan_id > ICE_MAX_VLAN_ID)) {
                off = (_FORCE_ __be16 *)(eth_hdr + ICE_ETH_VLAN_TCI_OFFSET);
                *off = CPU_TO_BE16(vlan_id);
+               off = (_FORCE_ __be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET);
+               *off = CPU_TO_BE16(vlan_tpid);
        }
 
        /* Create the switch rule with the final dummy Ethernet header */
@@ -2406,8 +3890,7 @@ ice_add_marker_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent,
                m_ent->fltr_info.fwd_id.hw_vsi_id;
 
        act = ICE_LG_ACT_VSI_FORWARDING | ICE_LG_ACT_VALID_BIT;
-       act |= (id << ICE_LG_ACT_VSI_LIST_ID_S) &
-               ICE_LG_ACT_VSI_LIST_ID_M;
+       act |= (id << ICE_LG_ACT_VSI_LIST_ID_S) & ICE_LG_ACT_VSI_LIST_ID_M;
        if (m_ent->vsi_count > 1)
                act |= ICE_LG_ACT_VSI_LIST;
        lg_act->pdata.lg_act.act[0] = CPU_TO_LE32(act);
@@ -2488,13 +3971,11 @@ ice_add_counter_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent,
         */
        lg_act_size = (u16)ICE_SW_RULE_LG_ACT_SIZE(num_acts);
        rules_size = lg_act_size + ICE_SW_RULE_RX_TX_ETH_HDR_SIZE;
-       lg_act = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw,
-                                                                rules_size);
+       lg_act = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rules_size);
        if (!lg_act)
                return ICE_ERR_NO_MEMORY;
 
-       rx_tx = (struct ice_aqc_sw_rules_elem *)
-               ((u8 *)lg_act + lg_act_size);
+       rx_tx = (struct ice_aqc_sw_rules_elem *)((u8 *)lg_act + lg_act_size);
 
        /* Fill in the first switch rule i.e. large action */
        lg_act->type = CPU_TO_LE16(ICE_AQC_SW_RULES_T_LG_ACT);
@@ -2564,8 +4045,7 @@ ice_create_vsi_list_map(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
        struct ice_vsi_list_map_info *v_map;
        int i;
 
-       v_map = (struct ice_vsi_list_map_info *)ice_calloc(hw, 1,
-               sizeof(*v_map));
+       v_map = (struct ice_vsi_list_map_info *)ice_malloc(hw, sizeof(*v_map));
        if (!v_map)
                return NULL;
 
@@ -2882,6 +4362,9 @@ ice_add_update_vsi_list(struct ice_hw *hw,
                        ice_create_vsi_list_map(hw, &vsi_handle_arr[0], 2,
                                                vsi_list_id);
 
+               if (!m_entry->vsi_list_info)
+                       return ICE_ERR_NO_MEMORY;
+
                /* If this entry was large action then the large action needs
                 * to be updated to point to FWD to VSI list
                 */
@@ -3062,26 +4545,11 @@ static enum ice_status
 ice_remove_vsi_list_rule(struct ice_hw *hw, u16 vsi_list_id,
                         enum ice_sw_lkup_type lkup_type)
 {
-       struct ice_aqc_sw_rules_elem *s_rule;
-       enum ice_status status;
-       u16 s_rule_size;
-
-       s_rule_size = (u16)ICE_SW_RULE_VSI_LIST_SIZE(0);
-       s_rule = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, s_rule_size);
-       if (!s_rule)
-               return ICE_ERR_NO_MEMORY;
-
-       s_rule->type = CPU_TO_LE16(ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR);
-       s_rule->pdata.vsi_list.index = CPU_TO_LE16(vsi_list_id);
-
        /* Free the vsi_list resource that we allocated. It is assumed that the
         * list is empty at this point.
         */
-       status = ice_aq_alloc_free_vsi_list(hw, &vsi_list_id, lkup_type,
+       return ice_aq_alloc_free_vsi_list(hw, &vsi_list_id, lkup_type,
                                            ice_aqc_opc_free_res);
-
-       ice_free(hw, s_rule);
-       return status;
 }
 
 /**
@@ -3143,8 +4611,7 @@ ice_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
                tmp_fltr_info.vsi_handle = rem_vsi_handle;
                status = ice_update_pkt_fwd_rule(hw, &tmp_fltr_info);
                if (status) {
-                       ice_debug(hw, ICE_DBG_SW,
-                                 "Failed to update pkt fwd rule to FWD_TO_VSI on HW VSI %d, error %d\n",
+                       ice_debug(hw, ICE_DBG_SW, "Failed to update pkt fwd rule to FWD_TO_VSI on HW VSI %d, error %d\n",
                                  tmp_fltr_info.fwd_id.hw_vsi_id, status);
                        return status;
                }
@@ -3160,8 +4627,7 @@ ice_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
                /* Remove the VSI list since it is no longer used */
                status = ice_remove_vsi_list_rule(hw, vsi_list_id, lkup_type);
                if (status) {
-                       ice_debug(hw, ICE_DBG_SW,
-                                 "Failed to remove VSI list %d, error %d\n",
+                       ice_debug(hw, ICE_DBG_SW, "Failed to remove VSI list %d, error %d\n",
                                  vsi_list_id, status);
                        return status;
                }
@@ -3269,17 +4735,18 @@ exit:
  * ice_aq_get_res_alloc - get allocated resources
  * @hw: pointer to the HW struct
  * @num_entries: pointer to u16 to store the number of resource entries returned
- * @buf: pointer to user-supplied buffer
- * @buf_size: size of buff
+ * @buf: pointer to buffer
+ * @buf_size: size of buf
  * @cd: pointer to command details structure or NULL
  *
- * The user-supplied buffer must be large enough to store the resource
+ * The caller-supplied buffer must be large enough to store the resource
  * information for all resource types. Each resource type is an
- * ice_aqc_get_res_resp_data_elem structure.
+ * ice_aqc_get_res_resp_elem structure.
  */
 enum ice_status
-ice_aq_get_res_alloc(struct ice_hw *hw, u16 *num_entries, void *buf,
-                    u16 buf_size, struct ice_sq_cd *cd)
+ice_aq_get_res_alloc(struct ice_hw *hw, u16 *num_entries,
+                    struct ice_aqc_get_res_resp_elem *buf, u16 buf_size,
+                    struct ice_sq_cd *cd)
 {
        struct ice_aqc_get_res_alloc *resp;
        enum ice_status status;
@@ -3306,8 +4773,8 @@ ice_aq_get_res_alloc(struct ice_hw *hw, u16 *num_entries, void *buf,
  * ice_aq_get_res_descs - get allocated resource descriptors
  * @hw: pointer to the hardware structure
  * @num_entries: number of resource entries in buffer
- * @buf: Indirect buffer to hold data parameters and response
- * @buf_size: size of buffer for indirect commands
+ * @buf: structure to hold response data buffer
+ * @buf_size: size of buffer
  * @res_type: resource type
  * @res_shared: is resource shared
  * @desc_id: input - first desc ID to start; output - next desc ID
@@ -3315,9 +4782,8 @@ ice_aq_get_res_alloc(struct ice_hw *hw, u16 *num_entries, void *buf,
  */
 enum ice_status
 ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
-                    struct ice_aqc_get_allocd_res_desc_resp *buf,
-                    u16 buf_size, u16 res_type, bool res_shared, u16 *desc_id,
-                    struct ice_sq_cd *cd)
+                    struct ice_aqc_res_elem *buf, u16 buf_size, u16 res_type,
+                    bool res_shared, u16 *desc_id, struct ice_sq_cd *cd)
 {
        struct ice_aqc_get_allocd_res_desc *cmd;
        struct ice_aq_desc desc;
@@ -3354,7 +4820,7 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
  * @sw: pointer to switch info struct for which function add rule
  * @lport: logic port number on which function add rule
  *
- * IMPORTANT: When the ucast_shared flag is set to false and m_list has
+ * IMPORTANT: When the umac_shared flag is set to false and m_list has
  * multiple unicast addresses, the function assumes that all the
  * addresses are unique in a given add_mac call. It doesn't
  * check for duplicates in this case, removing duplicates from a given
@@ -3397,18 +4863,18 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
                if (m_list_itr->fltr_info.lkup_type != ICE_SW_LKUP_MAC ||
                    IS_ZERO_ETHER_ADDR(add))
                        return ICE_ERR_PARAM;
-               if (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {
+               if (IS_UNICAST_ETHER_ADDR(add) && !hw->umac_shared) {
                        /* Don't overwrite the unicast address */
                        ice_acquire_lock(rule_lock);
                        if (ice_find_rule_entry(rule_head,
                                                &m_list_itr->fltr_info)) {
                                ice_release_lock(rule_lock);
-                               return ICE_ERR_ALREADY_EXISTS;
+                               continue;
                        }
                        ice_release_lock(rule_lock);
                        num_unicast++;
                } else if (IS_MULTICAST_ETHER_ADDR(add) ||
-                          (IS_UNICAST_ETHER_ADDR(add) && hw->ucast_shared)) {
+                          (IS_UNICAST_ETHER_ADDR(add) && hw->umac_shared)) {
                        m_list_itr->status =
                                ice_add_rule_internal(hw, recp_list, lport,
                                                      m_list_itr);
@@ -3510,8 +4976,7 @@ ice_add_mac_exit:
  *
  * Function add MAC rule for logical port from HW struct
  */
-enum ice_status
-ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
+enum ice_status ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
 {
        if (!m_list || !hw)
                return ICE_ERR_PARAM;
@@ -3623,8 +5088,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_sw_recipe *recp_list,
                 */
                if (v_list_itr->vsi_count > 1 &&
                    v_list_itr->vsi_list_info->ref_cnt > 1) {
-                       ice_debug(hw, ICE_DBG_SW,
-                                 "Invalid configuration: Optimization to reuse VSI list with more than one VSI is not being done yet\n");
+                       ice_debug(hw, ICE_DBG_SW, "Invalid configuration: Optimization to reuse VSI list with more than one VSI is not being done yet\n");
                        status = ICE_ERR_CFG;
                        goto exit;
                }
@@ -3709,8 +5173,7 @@ ice_add_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list,
  *
  * Function add VLAN rule for logical port from HW struct
  */
-enum ice_status
-ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)
+enum ice_status ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)
 {
        if (!v_list || !hw)
                return ICE_ERR_PARAM;
@@ -3719,7 +5182,7 @@ ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)
 }
 
 /**
- * ice_add_mac_vlan - Add MAC and VLAN pair based filter rule
+ * ice_add_mac_vlan_rule - Add MAC and VLAN pair based filter rule
  * @hw: pointer to the hardware structure
  * @mv_list: list of MAC and VLAN filters
  * @sw: pointer to switch info struct for which function add rule
@@ -3813,7 +5276,6 @@ ice_add_eth_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list,
        return ICE_SUCCESS;
 }
 
-enum ice_status
 /**
  * ice_add_eth_mac - Add a ethertype based filter rule
  * @hw: pointer to the hardware structure
@@ -3821,6 +5283,7 @@ enum ice_status
  *
  * Function add ethertype rule for logical port from HW struct
  */
+enum ice_status
 ice_add_eth_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list)
 {
        if (!em_list || !hw)
@@ -3936,6 +5399,9 @@ void ice_rem_all_sw_rules_info(struct ice_hw *hw)
                        ice_rem_sw_rule_info(hw, rule_head);
                else
                        ice_rem_adv_rule_info(hw, rule_head);
+               if (sw->recp_list[i].adv_rule &&
+                   LIST_EMPTY(&sw->recp_list[i].filt_rules))
+                       sw->recp_list[i].adv_rule = false;
        }
 }
 
@@ -3966,7 +5432,8 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set,
        hw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);
 
        s_rule_size = set ? ICE_SW_RULE_RX_TX_ETH_HDR_SIZE :
-                           ICE_SW_RULE_RX_TX_NO_HDR_SIZE;
+               ICE_SW_RULE_RX_TX_NO_HDR_SIZE;
+
        s_rule = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, s_rule_size);
        if (!s_rule)
                return ICE_ERR_NO_MEMORY;
@@ -4096,7 +5563,7 @@ ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
 
                list_itr->fltr_info.fwd_id.hw_vsi_id =
                                        ice_get_hw_vsi_num(hw, vsi_handle);
-               if (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {
+               if (IS_UNICAST_ETHER_ADDR(add) && !hw->umac_shared) {
                        /* Don't remove the unicast address that belongs to
                         * another VSI on the switch, since it is not being
                         * shared...
@@ -4123,8 +5590,7 @@ ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
  * @m_list: list of MAC addresses and forwarding information
  *
  */
-enum ice_status
-ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
+enum ice_status ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
 {
        struct ice_sw_recipe *recp_list;
 
@@ -4232,6 +5698,7 @@ ice_vsi_uses_fltr(struct ice_fltr_mgmt_list_entry *fm_entry, u16 vsi_handle)
        return ((fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI &&
                 fm_entry->fltr_info.vsi_handle == vsi_handle) ||
                (fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI_LIST &&
+                fm_entry->vsi_list_info &&
                 (ice_is_bit_set(fm_entry->vsi_list_info->vsi_map,
                                 vsi_handle))));
 }
@@ -4306,14 +5773,12 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle,
 
        LIST_FOR_EACH_ENTRY(fm_entry, lkup_list_head,
                            ice_fltr_mgmt_list_entry, list_entry) {
-               struct ice_fltr_info *fi;
-
-               fi = &fm_entry->fltr_info;
-               if (!fi || !ice_vsi_uses_fltr(fm_entry, vsi_handle))
+               if (!ice_vsi_uses_fltr(fm_entry, vsi_handle))
                        continue;
 
                status = ice_add_entry_to_vsi_fltr_list(hw, vsi_handle,
-                                                       vsi_list_head, fi);
+                                                       vsi_list_head,
+                                                       &fm_entry->fltr_info);
                if (status)
                        return status;
        }
@@ -4409,7 +5874,7 @@ ice_get_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 *promisc_mask,
 }
 
 /**
- * ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI
+ * _ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI
  * @hw: pointer to the hardware structure
  * @vsi_handle: VSI handle to retrieve info from
  * @promisc_mask: pointer to mask to be filled in
@@ -4816,7 +6281,7 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,
                                          &remove_list_head);
        ice_release_lock(rule_lock);
        if (status)
-               return;
+               goto free_fltr_list;
 
        switch (lkup) {
        case ICE_SW_LKUP_MAC:
@@ -4837,14 +6302,14 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,
                ice_remove_eth_mac(hw, &remove_list_head);
                break;
        case ICE_SW_LKUP_DFLT:
-               ice_debug(hw, ICE_DBG_SW,
-                         "Remove filters for this lookup type hasn't been implemented yet\n");
+               ice_debug(hw, ICE_DBG_SW, "Remove filters for this lookup type hasn't been implemented yet\n");
                break;
        case ICE_SW_LKUP_LAST:
                ice_debug(hw, ICE_DBG_SW, "Unsupported lookup type\n");
                break;
        }
 
+free_fltr_list:
        LIST_FOR_EACH_ENTRY_SAFE(fm_entry, tmp, &remove_list_head,
                                 ice_fltr_list_entry, list_entry) {
                LIST_DEL(&fm_entry->list_entry);
@@ -4909,9 +6374,8 @@ ice_alloc_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
        u16 buf_len;
 
        /* Allocate resource */
-       buf_len = sizeof(*buf);
-       buf = (struct ice_aqc_alloc_free_res_elem *)
-               ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(buf, elem, 1);
+       buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!buf)
                return ICE_ERR_NO_MEMORY;
 
@@ -4948,9 +6412,8 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
        u16 buf_len;
 
        /* Free resource */
-       buf_len = sizeof(*buf);
-       buf = (struct ice_aqc_alloc_free_res_elem *)
-               ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(buf, elem, 1);
+       buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!buf)
                return ICE_ERR_NO_MEMORY;
 
@@ -4962,8 +6425,7 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
        status = ice_aq_alloc_free_res(hw, 1, buf, buf_len,
                                       ice_aqc_opc_free_res, NULL);
        if (status)
-               ice_debug(hw, ICE_DBG_SW,
-                         "counter resource could not be freed\n");
+               ice_debug(hw, ICE_DBG_SW, "counter resource could not be freed\n");
 
        ice_free(hw, buf);
        return status;
@@ -5010,9 +6472,8 @@ ice_alloc_res_lg_act(struct ice_hw *hw, u16 *l_id, u16 num_acts)
                return ICE_ERR_PARAM;
 
        /* Allocate resource for large action */
-       buf_len = sizeof(*sw_buf);
-       sw_buf = (struct ice_aqc_alloc_free_res_elem *)
-               ice_malloc(hw, buf_len);
+       buf_len = ice_struct_size(sw_buf, elem, 1);
+       sw_buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
        if (!sw_buf)
                return ICE_ERR_NO_MEMORY;
 
@@ -5249,7 +6710,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
        { ICE_MAC_OFOS,         { 0, 2, 4, 6, 8, 10, 12 } },
        { ICE_MAC_IL,           { 0, 2, 4, 6, 8, 10, 12 } },
        { ICE_ETYPE_OL,         { 0 } },
-       { ICE_VLAN_OFOS,        { 0, 2 } },
+       { ICE_VLAN_OFOS,        { 2, 0 } },
        { ICE_IPV4_OFOS,        { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
        { ICE_IPV4_IL,          { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
        { ICE_IPV6_OFOS,        { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24,
@@ -5264,13 +6725,16 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
        { ICE_GENEVE,           { 8, 10, 12, 14 } },
        { ICE_VXLAN_GPE,        { 8, 10, 12, 14 } },
        { ICE_NVGRE,            { 0, 2, 4, 6 } },
-       { ICE_GTP,              { 8, 10, 12, 14, 16, 18, 20 } },
+       { ICE_GTP,              { 8, 10, 12, 14, 16, 18, 20, 22 } },
        { ICE_PPPOE,            { 0, 2, 4, 6 } },
        { ICE_PFCP,             { 8, 10, 12, 14, 16, 18, 20, 22 } },
        { ICE_L2TPV3,           { 0, 2, 4, 6, 8, 10 } },
        { ICE_ESP,              { 0, 2, 4, 6 } },
        { ICE_AH,               { 0, 2, 4, 6, 8, 10 } },
        { ICE_NAT_T,            { 8, 10, 12, 14 } },
+       { ICE_GTP_NO_PAY,       { 8, 10, 12, 14 } },
+       { ICE_VLAN_EX,          { 2, 0 } },
+       { ICE_VLAN_IN,          { 2, 0 } },
 };
 
 /* The following table describes preferred grouping of recipes.
@@ -5279,7 +6743,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
  * following policy.
  */
 
-static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
+static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
        { ICE_MAC_OFOS,         ICE_MAC_OFOS_HW },
        { ICE_MAC_IL,           ICE_MAC_IL_HW },
        { ICE_ETYPE_OL,         ICE_ETYPE_OL_HW },
@@ -5303,6 +6767,9 @@ static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
        { ICE_ESP,              ICE_ESP_HW },
        { ICE_AH,               ICE_AH_HW },
        { ICE_NAT_T,            ICE_UDP_ILOS_HW },
+       { ICE_GTP_NO_PAY,       ICE_UDP_ILOS_HW },
+       { ICE_VLAN_EX,          ICE_VLAN_OF_HW },
+       { ICE_VLAN_IN,          ICE_VLAN_OL_HW },
 };
 
 /**
@@ -5313,7 +6780,7 @@ static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
  * Returns index of matching recipe, or ICE_MAX_NUM_RECIPES if not found.
  */
 static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
-                        enum ice_sw_tunnel_type tun_type)
+                        enum ice_sw_tunnel_type tun_type, u32 priority)
 {
        bool refresh_required = true;
        struct ice_sw_recipe *recp;
@@ -5348,7 +6815,7 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
                        u8 pe, qr;
 
                        /* ar, cr, and qr are related to the recipe words, while
-                        * be, de and pe are related to the lookup words
+                        * be, de, and pe are related to the lookup words
                         */
                        for (pe = 0; pe < lkup_exts->n_val_words; pe++) {
                                for (qr = 0; qr < recp[i].lkup_exts.n_val_words;
@@ -5375,14 +6842,31 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
                        /* If for "i"th recipe the found was never set to false
                         * then it means we found our match
                         */
-                       if ((tun_type == recp[i].tun_type ||
-                            tun_type == ICE_SW_TUN_AND_NON_TUN) && found)
+                       if (tun_type == recp[i].tun_type && found &&
+                           priority == recp[i].priority)
                                return i; /* Return the recipe ID */
                }
        }
        return ICE_MAX_NUM_RECIPES;
 }
 
+/**
+ * ice_change_proto_id_to_dvm - change proto id in prot_id_tbl
+ *
+ * As protocol id for outer vlan is different in dvm and svm, if dvm is
+ * supported protocol array record for outer vlan has to be modified to
+ * reflect the value proper for DVM.
+ */
+void ice_change_proto_id_to_dvm(void)
+{
+       u8 i;
+
+       for (i = 0; i < ARRAY_SIZE(ice_prot_id_tbl); i++)
+               if (ice_prot_id_tbl[i].type == ICE_VLAN_OFOS &&
+                   ice_prot_id_tbl[i].protocol_id != ICE_VLAN_OF_HW)
+                       ice_prot_id_tbl[i].protocol_id = ICE_VLAN_OF_HW;
+}
+
 /**
  * ice_prot_type_to_id - get protocol ID from protocol type
  * @type: protocol type
@@ -5403,7 +6887,7 @@ static bool ice_prot_type_to_id(enum ice_protocol_type type, u8 *id)
 }
 
 /**
- * ice_find_valid_words - count valid words
+ * ice_fill_valid_words - count valid words
  * @rule: advanced rule with lookup information
  * @lkup_exts: byte offset extractions of the words that are valid
  *
@@ -5422,7 +6906,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
 
        for (j = 0; j < sizeof(rule->m_u) / sizeof(u16); j++)
                if (((u16 *)&rule->m_u)[j] &&
-                   rule->type < ARRAY_SIZE(ice_prot_ext)) {
+                   (size_t)rule->type < ARRAY_SIZE(ice_prot_ext)) {
                        /* No more space to accommodate */
                        if (word >= ICE_MAX_CHAIN_WORDS)
                                return 0;
@@ -5431,7 +6915,7 @@ ice_fill_valid_words(struct ice_adv_lkup_elem *rule,
                        lkup_exts->fv_words[word].prot_id =
                                ice_prot_id_tbl[rule->type].protocol_id;
                        lkup_exts->field_mask[word] =
-                               BE16_TO_CPU(((__be16 *)&rule->m_u)[j]);
+                               BE16_TO_CPU(((_FORCE_ __be16 *)&rule->m_u)[j]);
                        word++;
                }
 
@@ -5595,7 +7079,6 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
        ice_declare_bitmap(possible_idx, ICE_MAX_FV_WORDS);
        ice_declare_bitmap(recipes, ICE_MAX_NUM_RECIPES);
        ice_declare_bitmap(used_idx, ICE_MAX_FV_WORDS);
-       u16 count = 0;
        u16 bit;
 
        ice_zero_bitmap(possible_idx, ICE_MAX_FV_WORDS);
@@ -5603,59 +7086,44 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
        ice_zero_bitmap(used_idx, ICE_MAX_FV_WORDS);
        ice_zero_bitmap(free_idx, ICE_MAX_FV_WORDS);
 
-       for (count = 0; count < ICE_MAX_FV_WORDS; count++)
-               ice_set_bit(count, possible_idx);
+       ice_bitmap_set(possible_idx, 0, ICE_MAX_FV_WORDS);
 
        /* For each profile we are going to associate the recipe with, add the
         * recipes that are associated with that profile. This will give us
         * the set of recipes that our recipe may collide with. Also, determine
         * what possible result indexes are usable given this set of profiles.
         */
-       bit = 0;
-       while (ICE_MAX_NUM_PROFILES >
-              (bit = ice_find_next_bit(profiles, ICE_MAX_NUM_PROFILES, bit))) {
+       ice_for_each_set_bit(bit, profiles, ICE_MAX_NUM_PROFILES) {
                ice_or_bitmap(recipes, recipes, profile_to_recipe[bit],
                              ICE_MAX_NUM_RECIPES);
                ice_and_bitmap(possible_idx, possible_idx,
                               hw->switch_info->prof_res_bm[bit],
                               ICE_MAX_FV_WORDS);
-               bit++;
        }
 
        /* For each recipe that our new recipe may collide with, determine
         * which indexes have been used.
         */
-       for (bit = 0; bit < ICE_MAX_NUM_RECIPES; bit++)
-               if (ice_is_bit_set(recipes, bit)) {
-                       ice_or_bitmap(used_idx, used_idx,
-                                     hw->switch_info->recp_list[bit].res_idxs,
-                                     ICE_MAX_FV_WORDS);
-               }
+       ice_for_each_set_bit(bit, recipes, ICE_MAX_NUM_RECIPES)
+               ice_or_bitmap(used_idx, used_idx,
+                             hw->switch_info->recp_list[bit].res_idxs,
+                             ICE_MAX_FV_WORDS);
 
        ice_xor_bitmap(free_idx, used_idx, possible_idx, ICE_MAX_FV_WORDS);
 
        /* return number of free indexes */
-       count = 0;
-       bit = 0;
-       while (ICE_MAX_FV_WORDS >
-              (bit = ice_find_next_bit(free_idx, ICE_MAX_FV_WORDS, bit))) {
-               count++;
-               bit++;
-       }
-
-       return count;
+       return (u16)ice_bitmap_hweight(free_idx, ICE_MAX_FV_WORDS);
 }
 
 /**
  * ice_add_sw_recipe - function to call AQ calls to create switch recipe
  * @hw: pointer to hardware structure
  * @rm: recipe management list entry
- * @match_tun: if field vector index for tunnel needs to be programmed
- * @profiles: bitmap of profiles that will be assocated.
+ * @profiles: bitmap of profiles that will be associated.
  */
 static enum ice_status
 ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
-                 bool match_tun, ice_bitmap_t *profiles)
+                 ice_bitmap_t *profiles)
 {
        ice_declare_bitmap(result_idx_bm, ICE_MAX_FV_WORDS);
        struct ice_aqc_recipe_data_elem *tmp;
@@ -5758,8 +7226,7 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
                         * that can be used.
                         */
                        if (chain_idx >= ICE_MAX_FV_WORDS) {
-                               ice_debug(hw, ICE_DBG_SW,
-                                         "No chain index available\n");
+                               ice_debug(hw, ICE_DBG_SW, "No chain index available\n");
                                status = ICE_ERR_MAX_LIMIT;
                                goto err_unroll;
                        }
@@ -5870,15 +7337,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
                }
                buf[recps].content.act_ctrl_fwd_priority = rm->priority;
 
-               /* To differentiate among different UDP tunnels, a meta data ID
-                * flag is used.
-                */
-               if (match_tun) {
-                       buf[recps].content.lkup_indx[i] = ICE_TUN_FLAG_FV_IND;
-                       buf[recps].content.mask[i] =
-                               CPU_TO_LE16(ICE_TUN_FLAG_MASK);
-               }
-
                recps++;
                rm->root_rid = (u8)rid;
        }
@@ -5945,7 +7403,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
                recp->n_grp_count = rm->n_grp_count;
                recp->tun_type = rm->tun_type;
                recp->recp_created = true;
-               recp->adv_rule = 1;
        }
        rm->root_buf = buf;
        ice_free(hw, tmp);
@@ -6029,7 +7486,7 @@ free_mem:
 }
 
 /**
- * ice_tun_type_match_mask - determine if tun type needs a match mask
+ * ice_tun_type_match_word - determine if tun type needs a match mask
  * @tun_type: tunnel type
  * @mask: mask to be used for the tunnel
  */
@@ -6037,12 +7494,25 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask)
 {
        switch (tun_type) {
        case ICE_SW_TUN_VXLAN_GPE:
+       case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_VXLAN:
        case ICE_SW_TUN_NVGRE:
        case ICE_SW_TUN_UDP:
        case ICE_ALL_TUNNELS:
+       case ICE_SW_TUN_AND_NON_TUN_QINQ:
+       case ICE_NON_TUN_QINQ:
+       case ICE_SW_TUN_PPPOE_QINQ:
+       case ICE_SW_TUN_PPPOE_PAY_QINQ:
+       case ICE_SW_TUN_PPPOE_IPV4_QINQ:
+       case ICE_SW_TUN_PPPOE_IPV6_QINQ:
                *mask = ICE_TUN_FLAG_MASK;
                return true;
 
+       case ICE_SW_TUN_GENEVE_VLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
+               *mask = ICE_TUN_FLAG_MASK & ~ICE_TUN_FLAG_VLAN_MASK;
+               return true;
+
        default:
                *mask = 0;
                return false;
@@ -6093,6 +7563,7 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
 
        switch (rinfo->tun_type) {
        case ICE_NON_TUN:
+       case ICE_NON_TUN_QINQ:
                prof_type = ICE_PROF_NON_TUN;
                break;
        case ICE_ALL_TUNNELS:
@@ -6100,7 +7571,9 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
                break;
        case ICE_SW_TUN_VXLAN_GPE:
        case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_GENEVE_VLAN:
        case ICE_SW_TUN_VXLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
        case ICE_SW_TUN_UDP:
        case ICE_SW_TUN_GTP:
                prof_type = ICE_PROF_TUN_UDP;
@@ -6109,8 +7582,37 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
                prof_type = ICE_PROF_TUN_GRE;
                break;
        case ICE_SW_TUN_PPPOE:
+       case ICE_SW_TUN_PPPOE_QINQ:
                prof_type = ICE_PROF_TUN_PPPOE;
                break;
+       case ICE_SW_TUN_PPPOE_PAY:
+       case ICE_SW_TUN_PPPOE_PAY_QINQ:
+               ice_set_bit(ICE_PROFID_PPPOE_PAY, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4:
+       case ICE_SW_TUN_PPPOE_IPV4_QINQ:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6:
+       case ICE_SW_TUN_PPPOE_IPV6_QINQ:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_UDP, bm);
+               return;
        case ICE_SW_TUN_PROFID_IPV6_ESP:
        case ICE_SW_TUN_IPV6_ESP:
                ice_set_bit(ICE_PROFID_IPV6_ESP, bm);
@@ -6151,7 +7653,114 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
        case ICE_SW_TUN_IPV4_AH:
                ice_set_bit(ICE_PROFID_IPV4_AH, bm);
                return;
+       case ICE_SW_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_IPV4_TCP, bm);
+               return;
+       case ICE_SW_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_IPV4_UDP, bm);
+               return;
+       case ICE_SW_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_IPV6_TCP, bm);
+               return;
+       case ICE_SW_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_IPV6_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_NO_PAY:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_TEID, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_NO_PAY:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_TEID, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV4:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV4:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV4:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV4:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV6:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV6:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV6:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV6:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm);
+               return;
+       case ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, bm);
+               return;
        case ICE_SW_TUN_AND_NON_TUN:
+       case ICE_SW_TUN_AND_NON_TUN_QINQ:
        default:
                prof_type = ICE_PROF_ALL;
                break;
@@ -6208,8 +7817,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        struct ice_sw_fv_list_entry *tmp;
        enum ice_status status = ICE_SUCCESS;
        struct ice_sw_recipe *rm;
-       bool match_tun = false;
-       u16 mask;
        u8 i;
 
        if (!ice_is_prof_rule(rinfo->tun_type) && !lkups_cnt)
@@ -6260,6 +7867,13 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        if (status)
                goto err_unroll;
 
+       /* Create any special protocol/offset pairs, such as looking at tunnel
+        * bits by extracting metadata
+        */
+       status = ice_add_special_words(rinfo, lkup_exts);
+       if (status)
+               goto err_free_lkup_exts;
+
        /* Group match words into recipes using preferred recipe grouping
         * criteria.
         */
@@ -6267,14 +7881,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        if (status)
                goto err_unroll;
 
-       /* For certain tunnel types it is necessary to use a metadata ID flag to
-        * differentiate different tunnel types. A separate recipe needs to be
-        * used for the metadata.
-        */
-       if (ice_tun_type_match_word(rinfo->tun_type,  &mask) &&
-           rm->n_grp_count > 1)
-               match_tun = mask;
-
        /* set the recipe priority if specified */
        rm->priority = (u8)rinfo->priority;
 
@@ -6291,18 +7897,17 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        if (LIST_EMPTY(&rm->fv_list)) {
                u16 j;
 
-               for (j = 0; j < ICE_MAX_NUM_PROFILES; j++)
-                       if (ice_is_bit_set(fv_bitmap, j)) {
-                               struct ice_sw_fv_list_entry *fvl;
-
-                               fvl = (struct ice_sw_fv_list_entry *)
-                                       ice_malloc(hw, sizeof(*fvl));
-                               if (!fvl)
-                                       goto err_unroll;
-                               fvl->fv_ptr = NULL;
-                               fvl->profile_id = j;
-                               LIST_ADD(&fvl->list_entry, &rm->fv_list);
-                       }
+               ice_for_each_set_bit(j, fv_bitmap, ICE_MAX_NUM_PROFILES) {
+                       struct ice_sw_fv_list_entry *fvl;
+
+                       fvl = (struct ice_sw_fv_list_entry *)
+                               ice_malloc(hw, sizeof(*fvl));
+                       if (!fvl)
+                               goto err_unroll;
+                       fvl->fv_ptr = NULL;
+                       fvl->profile_id = j;
+                       LIST_ADD(&fvl->list_entry, &rm->fv_list);
+               }
        }
 
        /* get bitmap of all profiles the recipe will be associated with */
@@ -6313,22 +7918,15 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
                ice_set_bit((u16)fvit->profile_id, profiles);
        }
 
-       /* Create any special protocol/offset pairs, such as looking at tunnel
-        * bits by extracting metadata
-        */
-       status = ice_add_special_words(rinfo, lkup_exts);
-       if (status)
-               goto err_free_lkup_exts;
-
        /* Look for a recipe which matches our requested fv / mask list */
-       *rid = ice_find_recp(hw, lkup_exts, rinfo->tun_type);
+       *rid = ice_find_recp(hw, lkup_exts, rinfo->tun_type, rinfo->priority);
        if (*rid < ICE_MAX_NUM_RECIPES)
                /* Success if found a recipe that match the existing criteria */
                goto err_unroll;
 
        rm->tun_type = rinfo->tun_type;
        /* Recipe we need does not exist, add a recipe */
-       status = ice_add_sw_recipe(hw, rm, match_tun, profiles);
+       status = ice_add_sw_recipe(hw, rm, profiles);
        if (status)
                goto err_unroll;
 
@@ -6364,10 +7962,9 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
                              ICE_MAX_NUM_RECIPES);
 
                /* Update recipe to profile bitmap array */
-               for (j = 0; j < ICE_MAX_NUM_RECIPES; j++)
-                       if (ice_is_bit_set(r_bitmap, j))
-                               ice_set_bit((u16)fvit->profile_id,
-                                           recipe_to_profile[j]);
+               ice_for_each_set_bit(j, rm->r_bitmap, ICE_MAX_NUM_RECIPES)
+                       ice_set_bit((u16)fvit->profile_id,
+                                   recipe_to_profile[j]);
        }
 
        *rid = rm->root_rid;
@@ -6415,7 +8012,7 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                      const struct ice_dummy_pkt_offsets **offsets)
 {
        bool tcp = false, udp = false, ipv6 = false, vlan = false;
-       bool gre = false;
+       bool gre = false, mpls = false;
        u16 i;
 
        for (i = 0; i < lkups_cnt; i++) {
@@ -6427,6 +8024,12 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                        ipv6 = true;
                else if (lkups[i].type == ICE_VLAN_OFOS)
                        vlan = true;
+               else if (lkups[i].type == ICE_ETYPE_OL &&
+                        lkups[i].h_u.ethertype.ethtype_id ==
+                               CPU_TO_BE16(ICE_IPV6_ETHER_ID) &&
+                        lkups[i].m_u.ethertype.ethtype_id ==
+                               CPU_TO_BE16(0xFFFF))
+                       ipv6 = true;
                else if (lkups[i].type == ICE_IPV4_OFOS &&
                         lkups[i].h_u.ipv4_hdr.protocol ==
                                ICE_IPV4_NVGRE_PROTO_ID &&
@@ -6439,12 +8042,94 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                         lkups[i].m_u.pppoe_hdr.ppp_prot_id ==
                                0xFFFF)
                        ipv6 = true;
+               else if (lkups[i].type == ICE_IPV4_IL &&
+                        lkups[i].h_u.ipv4_hdr.protocol ==
+                               ICE_TCP_PROTO_ID &&
+                        lkups[i].m_u.ipv4_hdr.protocol ==
+                               0xFF)
+                       tcp = true;
                else if (lkups[i].type == ICE_ETYPE_OL &&
                         lkups[i].h_u.ethertype.ethtype_id ==
-                               CPU_TO_BE16(ICE_IPV6_ETHER_ID) &&
-                        lkups[i].m_u.ethertype.ethtype_id ==
-                                       0xFFFF)
-                       ipv6 = true;
+                               CPU_TO_BE16(ICE_MPLS_ETHER_ID) &&
+                        lkups[i].m_u.ethertype.ethtype_id == 0xFFFF)
+                       mpls = true;
+       }
+
+       if ((tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
+            tun_type == ICE_NON_TUN_QINQ) && ipv6) {
+               if (tcp) {
+                       *pkt = dummy_qinq_ipv6_tcp_pkt;
+                       *pkt_len = sizeof(dummy_qinq_ipv6_tcp_pkt);
+                       *offsets = dummy_qinq_ipv6_tcp_packet_offsets;
+                       return;
+               }
+
+               if (udp) {
+                       *pkt = dummy_qinq_ipv6_udp_pkt;
+                       *pkt_len = sizeof(dummy_qinq_ipv6_udp_pkt);
+                       *offsets = dummy_qinq_ipv6_udp_packet_offsets;
+                       return;
+               }
+
+               *pkt = dummy_qinq_ipv6_pkt;
+               *pkt_len = sizeof(dummy_qinq_ipv6_pkt);
+               *offsets = dummy_qinq_ipv6_packet_offsets;
+               return;
+       } else if (tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
+                          tun_type == ICE_NON_TUN_QINQ) {
+               if (tcp) {
+                       *pkt = dummy_qinq_ipv4_tcp_pkt;
+                       *pkt_len = sizeof(dummy_qinq_ipv4_tcp_pkt);
+                       *offsets = dummy_qinq_ipv4_tcp_packet_offsets;
+                       return;
+               }
+
+               if (udp) {
+                       *pkt = dummy_qinq_ipv4_udp_pkt;
+                       *pkt_len = sizeof(dummy_qinq_ipv4_udp_pkt);
+                       *offsets = dummy_qinq_ipv4_udp_packet_offsets;
+                       return;
+               }
+
+               *pkt = dummy_qinq_ipv4_pkt;
+               *pkt_len = sizeof(dummy_qinq_ipv4_pkt);
+               *offsets = dummy_qinq_ipv4_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6_QINQ) {
+               *pkt = dummy_qinq_pppoe_ipv6_packet;
+               *pkt_len = sizeof(dummy_qinq_pppoe_ipv6_packet);
+               *offsets = dummy_qinq_pppoe_packet_ipv6_offsets;
+               return;
+       } else if (tun_type == ICE_SW_TUN_PPPOE_IPV4_QINQ) {
+               *pkt = dummy_qinq_pppoe_ipv4_pkt;
+               *pkt_len = sizeof(dummy_qinq_pppoe_ipv4_pkt);
+               *offsets = dummy_qinq_pppoe_ipv4_packet_offsets;
+               return;
+       } else if (tun_type == ICE_SW_TUN_PPPOE_QINQ && ipv6) {
+               *pkt = dummy_qinq_pppoe_ipv6_packet;
+               *pkt_len = sizeof(dummy_qinq_pppoe_ipv6_packet);
+               *offsets = dummy_qinq_pppoe_packet_offsets;
+               return;
+       } else if (tun_type == ICE_SW_TUN_PPPOE_QINQ ||
+                       tun_type == ICE_SW_TUN_PPPOE_PAY_QINQ) {
+               *pkt = dummy_qinq_pppoe_ipv4_pkt;
+               *pkt_len = sizeof(dummy_qinq_pppoe_ipv4_pkt);
+               *offsets = dummy_qinq_pppoe_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_NO_PAY) {
+               *pkt = dummy_ipv4_gtpu_ipv4_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
+               *offsets = dummy_ipv4_gtp_no_pay_packet_offsets;
+               return;
+       } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_NO_PAY) {
+               *pkt = dummy_ipv6_gtp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtp_packet);
+               *offsets = dummy_ipv6_gtp_no_pay_packet_offsets;
+               return;
        }
 
        if (tun_type == ICE_SW_TUN_IPV4_ESP) {
@@ -6509,18 +8194,186 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                *offsets = dummy_udp_gtp_packet_offsets;
                return;
        }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4 ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4) {
+               *pkt = dummy_ipv4_gtpu_ipv4_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
+               *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4_UDP ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP) {
+               *pkt = dummy_ipv4_gtpu_ipv4_udp_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_udp_packet);
+               *offsets = dummy_ipv4_gtpu_ipv4_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4_TCP ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP) {
+               *pkt = dummy_ipv4_gtpu_ipv4_tcp_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_tcp_packet);
+               *offsets = dummy_ipv4_gtpu_ipv4_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6 ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6) {
+               *pkt = dummy_ipv4_gtpu_ipv6_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
+               *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6_UDP ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP) {
+               *pkt = dummy_ipv4_gtpu_ipv6_udp_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_udp_packet);
+               *offsets = dummy_ipv4_gtpu_ipv6_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6_TCP ||
+           tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP) {
+               *pkt = dummy_ipv4_gtpu_ipv6_tcp_packet;
+               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_tcp_packet);
+               *offsets = dummy_ipv4_gtpu_ipv6_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4 ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4) {
+               *pkt = dummy_ipv6_gtpu_ipv4_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_packet);
+               *offsets = dummy_ipv6_gtpu_ipv4_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4_UDP ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP) {
+               *pkt = dummy_ipv6_gtpu_ipv4_udp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_udp_packet);
+               *offsets = dummy_ipv6_gtpu_ipv4_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4_TCP ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP) {
+               *pkt = dummy_ipv6_gtpu_ipv4_tcp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_tcp_packet);
+               *offsets = dummy_ipv6_gtpu_ipv4_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6 ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6) {
+               *pkt = dummy_ipv6_gtpu_ipv6_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet);
+               *offsets = dummy_ipv6_gtpu_ipv6_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6_UDP ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP) {
+               *pkt = dummy_ipv6_gtpu_ipv6_udp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_udp_packet);
+               *offsets = dummy_ipv6_gtpu_ipv6_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6_TCP ||
+           tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP) {
+               *pkt = dummy_ipv6_gtpu_ipv6_tcp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_tcp_packet);
+               *offsets = dummy_ipv6_gtpu_ipv6_tcp_packet_offsets;
+               return;
+       }
+
        if (tun_type == ICE_SW_TUN_PPPOE && ipv6) {
                *pkt = dummy_pppoe_ipv6_packet;
                *pkt_len = sizeof(dummy_pppoe_ipv6_packet);
                *offsets = dummy_pppoe_packet_offsets;
                return;
-       } else if (tun_type == ICE_SW_TUN_PPPOE) {
+       } else if (tun_type == ICE_SW_TUN_PPPOE ||
+               tun_type == ICE_SW_TUN_PPPOE_PAY) {
                *pkt = dummy_pppoe_ipv4_packet;
                *pkt_len = sizeof(dummy_pppoe_ipv4_packet);
                *offsets = dummy_pppoe_packet_offsets;
                return;
        }
 
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4) {
+               *pkt = dummy_pppoe_ipv4_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_packet);
+               *offsets = dummy_pppoe_packet_ipv4_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4_TCP) {
+               *pkt = dummy_pppoe_ipv4_tcp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_tcp_packet);
+               *offsets = dummy_pppoe_ipv4_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4_UDP) {
+               *pkt = dummy_pppoe_ipv4_udp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_udp_packet);
+               *offsets = dummy_pppoe_ipv4_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6) {
+               *pkt = dummy_pppoe_ipv6_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_packet);
+               *offsets = dummy_pppoe_packet_ipv6_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6_TCP) {
+               *pkt = dummy_pppoe_ipv6_tcp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_tcp_packet);
+               *offsets = dummy_pppoe_packet_ipv6_tcp_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6_UDP) {
+               *pkt = dummy_pppoe_ipv6_udp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_udp_packet);
+               *offsets = dummy_pppoe_packet_ipv6_udp_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_IPV4_TCP) {
+               *pkt = dummy_tcp_packet;
+               *pkt_len = sizeof(dummy_tcp_packet);
+               *offsets = dummy_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_IPV4_UDP) {
+               *pkt = dummy_udp_packet;
+               *pkt_len = sizeof(dummy_udp_packet);
+               *offsets = dummy_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_IPV6_TCP) {
+               *pkt = dummy_tcp_ipv6_packet;
+               *pkt_len = sizeof(dummy_tcp_ipv6_packet);
+               *offsets = dummy_tcp_ipv6_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_IPV6_UDP) {
+               *pkt = dummy_udp_ipv6_packet;
+               *pkt_len = sizeof(dummy_udp_ipv6_packet);
+               *offsets = dummy_udp_ipv6_packet_offsets;
+               return;
+       }
+
        if (tun_type == ICE_ALL_TUNNELS) {
                *pkt = dummy_gre_udp_packet;
                *pkt_len = sizeof(dummy_gre_udp_packet);
@@ -6543,7 +8396,9 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
        }
 
        if (tun_type == ICE_SW_TUN_VXLAN || tun_type == ICE_SW_TUN_GENEVE ||
-           tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP) {
+           tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP ||
+           tun_type == ICE_SW_TUN_GENEVE_VLAN ||
+           tun_type == ICE_SW_TUN_VXLAN_VLAN) {
                if (tcp) {
                        *pkt = dummy_udp_tun_tcp_packet;
                        *pkt_len = sizeof(dummy_udp_tun_tcp_packet);
@@ -6596,6 +8451,10 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                *pkt = dummy_vlan_tcp_packet;
                *pkt_len = sizeof(dummy_vlan_tcp_packet);
                *offsets = dummy_vlan_tcp_packet_offsets;
+       }  else if (mpls) {
+               *pkt = dummy_mpls_packet;
+               *pkt_len = sizeof(dummy_mpls_packet);
+               *offsets = dummy_mpls_packet_offsets;
        } else {
                *pkt = dummy_tcp_packet;
                *pkt_len = sizeof(dummy_tcp_packet);
@@ -6659,6 +8518,8 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                        len = sizeof(struct ice_ethtype_hdr);
                        break;
                case ICE_VLAN_OFOS:
+               case ICE_VLAN_EX:
+               case ICE_VLAN_IN:
                        len = sizeof(struct ice_vlan_hdr);
                        break;
                case ICE_IPV4_OFOS:
@@ -6687,6 +8548,7 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                        break;
 
                case ICE_GTP:
+               case ICE_GTP_NO_PAY:
                        len = sizeof(struct ice_udp_gtp_hdr);
                        break;
                case ICE_PPPOE:
@@ -6750,12 +8612,14 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type,
        case ICE_SW_TUN_AND_NON_TUN:
        case ICE_SW_TUN_VXLAN_GPE:
        case ICE_SW_TUN_VXLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
        case ICE_SW_TUN_UDP:
                if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, &open_port))
                        return ICE_ERR_CFG;
                break;
 
        case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_GENEVE_VLAN:
                if (!ice_get_open_tunnel_port(hw, TNL_GENEVE, &open_port))
                        return ICE_ERR_CFG;
                break;
@@ -6864,13 +8728,6 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
             cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI_LIST))
                return ICE_ERR_NOT_IMPL;
 
-       /* Workaround fix for unexpected rule deletion by kernel PF
-        * during VF reset.
-        */
-       if (new_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI &&
-           cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI)
-               return ICE_ERR_NOT_IMPL;
-
        if (m_entry->vsi_count < 2 && !m_entry->vsi_list_info) {
                 /* Only one entry existed in the mapping and it was not already
                  * a part of a VSI list. So, create a VSI list with the old and
@@ -7229,23 +9086,23 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
                        ice_get_hw_vsi_num(hw, rem_vsi_handle);
                fm_list->rule_info.sw_act.fwd_id.hw_vsi_id =
                        ice_get_hw_vsi_num(hw, rem_vsi_handle);
+               fm_list->rule_info.sw_act.vsi_handle = rem_vsi_handle;
 
                /* Update the previous switch rule of "MAC forward to VSI" to
                 * "MAC fwd to VSI list"
                 */
                status = ice_update_pkt_fwd_rule(hw, &tmp_fltr);
                if (status) {
-                       ice_debug(hw, ICE_DBG_SW,
-                                 "Failed to update pkt fwd rule to FWD_TO_VSI on HW VSI %d, error %d\n",
+                       ice_debug(hw, ICE_DBG_SW, "Failed to update pkt fwd rule to FWD_TO_VSI on HW VSI %d, error %d\n",
                                  tmp_fltr.fwd_id.hw_vsi_id, status);
                        return status;
                }
+               fm_list->vsi_list_info->ref_cnt--;
 
                /* Remove the VSI list since it is no longer used */
                status = ice_remove_vsi_list_rule(hw, vsi_list_id, lkup_type);
                if (status) {
-                       ice_debug(hw, ICE_DBG_SW,
-                                 "Failed to remove VSI list %d, error %d\n",
+                       ice_debug(hw, ICE_DBG_SW, "Failed to remove VSI list %d, error %d\n",
                                  vsi_list_id, status);
                        return status;
                }
@@ -7304,7 +9161,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        if (status)
                return status;
 
-       rid = ice_find_recp(hw, &lkup_exts, rinfo->tun_type);
+       rid = ice_find_recp(hw, &lkup_exts, rinfo->tun_type, rinfo->priority);
        /* If did not find a recipe that match the existing criteria */
        if (rid == ICE_MAX_NUM_RECIPES)
                return ICE_ERR_PARAM;
@@ -7318,7 +9175,6 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        if (list_elem->rule_info.sw_act.fltr_act != ICE_FWD_TO_VSI_LIST) {
                remove_rule = true;
        } else if (list_elem->vsi_count > 1) {
-               list_elem->vsi_list_info->ref_cnt--;
                remove_rule = false;
                vsi_handle = rinfo->sw_act.vsi_handle;
                status = ice_adv_rem_update_vsi_list(hw, vsi_handle, list_elem);
@@ -7338,9 +9194,8 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
                u16 rule_buf_sz;
 
                rule_buf_sz = ICE_SW_RULE_RX_TX_NO_HDR_SIZE;
-               s_rule =
-                       (struct ice_aqc_sw_rules_elem *)ice_malloc(hw,
-                                                                  rule_buf_sz);
+               s_rule = (struct ice_aqc_sw_rules_elem *)
+                       ice_malloc(hw, rule_buf_sz);
                if (!s_rule)
                        return ICE_ERR_NO_MEMORY;
                s_rule->pdata.lkup_tx_rx.act = 0;
@@ -7350,12 +9205,16 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
                status = ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule,
                                         rule_buf_sz, 1,
                                         ice_aqc_opc_remove_sw_rules, NULL);
-               if (status == ICE_SUCCESS) {
+               if (status == ICE_SUCCESS || status == ICE_ERR_DOES_NOT_EXIST) {
+                       struct ice_switch_info *sw = hw->switch_info;
+
                        ice_acquire_lock(rule_lock);
                        LIST_DEL(&list_elem->list_entry);
                        ice_free(hw, list_elem->lkups);
                        ice_free(hw, list_elem);
                        ice_release_lock(rule_lock);
+                       if (LIST_EMPTY(&sw->recp_list[rid].filt_rules))
+                               sw->recp_list[rid].adv_rule = false;
                }
                ice_free(hw, s_rule);
        }
@@ -7394,11 +9253,12 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
                                                list_itr->lkups_cnt, &rinfo);
                }
        }
-       return ICE_ERR_PARAM;
+       /* either list is empty or unable to find rule */
+       return ICE_ERR_DOES_NOT_EXIST;
 }
 
 /**
- * ice_rem_adv_for_vsi - removes existing advanced switch rules for a
+ * ice_rem_adv_rule_for_vsi - removes existing advanced switch rules for a
  *                       given VSI handle
  * @hw: pointer to the hardware structure
  * @vsi_handle: VSI handle for which we are supposed to remove all the rules.
@@ -7407,16 +9267,14 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
  * as removing a rule fails, it will return immediately with the error code,
  * else it will return ICE_SUCCESS
  */
-enum ice_status
-ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
+enum ice_status ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
 {
-       struct ice_adv_fltr_mgmt_list_entry *list_itr;
+       struct ice_adv_fltr_mgmt_list_entry *list_itr, *tmp_entry;
        struct ice_vsi_list_map_info *map_info;
        struct LIST_HEAD_TYPE *list_head;
        struct ice_adv_rule_info rinfo;
        struct ice_switch_info *sw;
        enum ice_status status;
-       u16 vsi_list_id = 0;
        u8 rid;
 
        sw = hw->switch_info;
@@ -7425,22 +9283,31 @@ ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
                        continue;
                if (!sw->recp_list[rid].adv_rule)
                        continue;
+
                list_head = &sw->recp_list[rid].filt_rules;
-               map_info = NULL;
-               LIST_FOR_EACH_ENTRY(list_itr, list_head,
-                                   ice_adv_fltr_mgmt_list_entry, list_entry) {
-                       map_info = ice_find_vsi_list_entry(&sw->recp_list[rid],
-                                                          vsi_handle,
-                                                          &vsi_list_id);
-                       if (!map_info)
-                               continue;
+               LIST_FOR_EACH_ENTRY_SAFE(list_itr, tmp_entry, list_head,
+                                        ice_adv_fltr_mgmt_list_entry,
+                                        list_entry) {
                        rinfo = list_itr->rule_info;
+
+                       if (rinfo.sw_act.fltr_act == ICE_FWD_TO_VSI_LIST) {
+                               map_info = list_itr->vsi_list_info;
+                               if (!map_info)
+                                       continue;
+
+                               if (!ice_is_bit_set(map_info->vsi_map,
+                                                   vsi_handle))
+                                       continue;
+                       } else if (rinfo.sw_act.vsi_handle != vsi_handle) {
+                               continue;
+                       }
+
                        rinfo.sw_act.vsi_handle = vsi_handle;
                        status = ice_rem_adv_rule(hw, list_itr->lkups,
                                                  list_itr->lkups_cnt, &rinfo);
+
                        if (status)
                                return status;
-                       map_info = NULL;
                }
        }
        return ICE_SUCCESS;
@@ -7477,6 +9344,7 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head)
        LIST_FOR_EACH_ENTRY(itr, &l_head, ice_fltr_mgmt_list_entry,
                            list_entry) {
                struct ice_fltr_list_entry f_entry;
+               u16 vsi_handle;
 
                f_entry.fltr_info = itr->fltr_info;
                if (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN) {
@@ -7488,12 +9356,8 @@ ice_replay_fltr(struct ice_hw *hw, u8 recp_id, struct LIST_HEAD_TYPE *list_head)
                }
 
                /* Add a filter per VSI separately */
-               while (1) {
-                       u16 vsi_handle;
-
-                       vsi_handle =
-                               ice_find_first_bit(itr->vsi_list_info->vsi_map,
-                                                  ICE_MAX_VSI);
+               ice_for_each_set_bit(vsi_handle, itr->vsi_list_info->vsi_map,
+                                    ICE_MAX_VSI) {
                        if (!ice_is_vsi_valid(hw, vsi_handle))
                                break;
 
@@ -7676,7 +9540,7 @@ ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi,
 }
 
 /**
- * ice_rm_all_sw_replay_rule - helper function to delete filter replay rules
+ * ice_rm_sw_replay_rule_info - helper function to delete filter replay rules
  * @hw: pointer to the HW struct
  * @sw: pointer to switch info struct for which function removes filters
  *