net/ice/base: fix memory allocation wrapper
[dpdk.git] / drivers / net / ice / base / ice_switch.c
index d1bc105..229b355 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"
@@ -14,6 +14,8 @@
 #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
 
 /* Dummy ethernet header needed in the ice_aqc_sw_rules_elem
  * struct to configure any switch filter rules.
@@ -504,39 +506,414 @@ 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_ipv4_gtpu_ipv4_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_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_ipv4_gtpu_ipv4_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* Ethernet 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x08, 0x00,
+
+       0x45, 0x00, 0x00, 0x4c, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x38, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x28, /* GTP-U Header 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       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, 0x00, 0x00, /* UDP 82 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00, /* 2 bytes for 4 byte alignment */
+};
+
+/* 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,
+
+       0x45, 0x00, 0x00, 0x6c, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x58, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x48, /* GTP-U Header 42 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x85,
+
+       0x02, 0x00, 0x00, 0x00, /* GTP_PDUSession_ExtensionHeader 54 */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x60, 0x00, 0x00, 0x00, /* IPv6 62 */
+       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 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_gtpu_ipv6_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV4_OFOS,        14 },
+       { ICE_UDP_OF,           34 },
+       { ICE_GTP,              42 },
+       { ICE_IPV6_IL,          62 },
+       { ICE_UDP_ILOS,         102 },
+       { ICE_PROTOCOL_LAST,    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, 0x60, /* IP 14 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x08, 0x68, /* UDP 34 */
+       0x00, 0x4c, 0x00, 0x00,
+
+       0x34, 0xff, 0x00, 0x3c, /* GTP-U Header 42 */
+       0x00, 0x00, 0x00, 0x00,
+       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_gtpu_ipv4_tcp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_IPV6_OFOS,        14 },
+       { ICE_UDP_OF,           54 },
+       { ICE_GTP,              62 },
+       { ICE_IPV4_IL,          82 },
+       { ICE_TCP_IL,           102 },
+       { ICE_PROTOCOL_LAST,    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,
+
+       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 },
@@ -718,8 +1095,39 @@ static const u8 dummy_ipv6_gtpu_ipv6_packet[] = {
        0x00, 0x00,
 };
 
-static const
-struct ice_dummy_pkt_offsets dummy_ipv4_gtp_no_pay_packet_offsets[] = {
+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 },
@@ -736,6 +1144,32 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtp_no_pay_packet_offsets[] = {
        { 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_ETYPE_OL,         12 },
@@ -1165,28 +1599,185 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = {
        0x40, 0x73, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
-
-       0x00, 0x00, 0x00, 0x00, /* ICE_L2TPV3 34 */
+
+       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_ETYPE_OL,         12 },
+       { ICE_VLAN_EX,          14 },
+       { ICE_VLAN_IN,          18 },
+       { 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,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */
+       0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_IN 18 */
+
+       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_UDP_ILOS 42 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_qinq_ipv6_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_EX,          14 },
+       { ICE_VLAN_IN,          18 },
+       { ICE_IPV6_OFOS,        22 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_qinq_ipv6_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x91, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */
+       0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_IN 18 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */
+       0x00, 0x10, 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 62 */
+       0x00, 0x10, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* needed for ESP packets */
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,     /* 2 bytes for 4 byte alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_EX,          14 },
+       { ICE_VLAN_IN,          18 },
+       { ICE_PPPOE,            22 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_qinq_pppoe_ipv4_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_EX,          14 },
+       { ICE_VLAN_IN,          18 },
+       { 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,
+
+       0x91, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_IN 18 */
+
+       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,
        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_ETYPE_OL,         12 },
+       { ICE_VLAN_EX,          14},
+       { ICE_VLAN_IN,          18 },
+       { 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,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_IN 18 */
+
+       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,
@@ -1196,9 +1787,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 */
 };
 
@@ -1225,18 +1813,45 @@ 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)
+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 = ICE_NON_TUN;
-       u16 i, j, profile_num = 0;
+       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;
@@ -1310,18 +1925,12 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid)
        }
 
        if (tun_type == ICE_SW_TUN_GTP) {
-               if (ice_is_bit_set(recipe_to_profile[rid],
-                                  ICE_PROFID_IPV4_GTPU_IPV4_OTHER))
-                       tun_type = ICE_SW_TUN_IPV4_GTPU_IPV4;
-               else if (ice_is_bit_set(recipe_to_profile[rid],
-                                       ICE_PROFID_IPV4_GTPU_IPV6_OTHER))
-                       tun_type = ICE_SW_TUN_IPV4_GTPU_IPV6;
-               else if (ice_is_bit_set(recipe_to_profile[rid],
-                                       ICE_PROFID_IPV6_GTPU_IPV4_OTHER))
-                       tun_type = ICE_SW_TUN_IPV6_GTPU_IPV4;
-               else if (ice_is_bit_set(recipe_to_profile[rid],
-                                       ICE_PROFID_IPV6_GTPU_IPV6_OTHER))
-                       tun_type = ICE_SW_TUN_IPV6_GTPU_IPV6;
+               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)) {
@@ -1416,6 +2025,19 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid)
                }
        }
 
+       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;
 }
 
@@ -1440,6 +2062,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);
@@ -1528,6 +2151,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
@@ -1562,7 +2188,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);
+       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);
@@ -1684,6 +2310,71 @@ ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp_elem *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
@@ -2367,7 +3058,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)
  */
@@ -2394,7 +3085,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)
  */
@@ -2532,12 +3223,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
@@ -2726,7 +3474,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;
 }
 
@@ -2805,6 +3553,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;
@@ -2877,6 +3626,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;
@@ -2920,6 +3671,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 */
@@ -2982,8 +3735,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);
@@ -3064,13 +3816,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);
@@ -3140,8 +3890,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;
 
@@ -3458,6 +4207,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
                 */
@@ -4275,7 +5027,7 @@ enum ice_status 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
@@ -4525,7 +5277,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;
@@ -4790,6 +5543,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))));
 }
@@ -4864,14 +5618,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;
        }
@@ -4967,7 +5719,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
@@ -5374,7 +6126,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:
@@ -5402,6 +6154,7 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,
                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);
@@ -5817,7 +6570,7 @@ 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 } },
@@ -5825,6 +6578,8 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
        { 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,          { 0, 2 } },
+       { ICE_VLAN_IN,          { 0, 2 } },
 };
 
 /* The following table describes preferred grouping of recipes.
@@ -5833,7 +6588,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 },
@@ -5858,6 +6613,8 @@ static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
        { 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 },
 };
 
 /**
@@ -5868,7 +6625,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;
@@ -5930,13 +6687,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 && 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
@@ -5957,7 +6732,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
  *
@@ -5976,7 +6751,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;
@@ -6556,7 +7331,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
  */
@@ -6569,6 +7344,12 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask)
        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;
 
@@ -6627,6 +7408,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:
@@ -6645,12 +7427,15 @@ 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);
@@ -6662,6 +7447,7 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
                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);
@@ -6724,39 +7510,102 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
        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_EH_IPV4_OTHER, bm);
                ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_OTHER, bm);
-               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm);
                ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_UDP, bm);
-               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, 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_EH_IPV4_OTHER, bm);
                ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_OTHER, bm);
-               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm);
                ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_UDP, bm);
-               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, 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_EH_IPV6_OTHER, bm);
                ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_OTHER, bm);
-               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm);
                ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_UDP, bm);
-               ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, 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_EH_IPV6_OTHER, bm);
                ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_OTHER, bm);
-               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm);
                ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_UDP, bm);
-               ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, 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;
@@ -6915,7 +7764,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        }
 
        /* 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;
@@ -7046,36 +7895,53 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                        tcp = true;
        }
 
+       if ((tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
+            tun_type == ICE_NON_TUN_QINQ) && ipv6) {
+               *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) {
+               *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_gtpu_ipv6_packet;
-               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet);
+               *pkt = dummy_ipv6_gtp_packet;
+               *pkt_len = sizeof(dummy_ipv6_gtp_packet);
                *offsets = dummy_ipv6_gtp_no_pay_packet_offsets;
                return;
-       } else if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4) {
-               *pkt = dummy_ipv4_gtpu_ipv4_packet;
-               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
-               *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;
-               return;
-       } else if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6) {
-               *pkt = dummy_ipv4_gtpu_ipv6_packet;
-               *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
-               *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
-               return;
-       } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4) {
-               *pkt = dummy_ipv6_gtpu_ipv4_packet;
-               *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_packet);
-               *offsets = dummy_ipv6_gtpu_ipv4_packet_offsets;
-               return;
-       } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_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_IPV4_ESP) {
@@ -7141,6 +8007,102 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                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);
@@ -7364,6 +8326,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:
@@ -8005,7 +8969,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;
@@ -8038,9 +9002,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;
@@ -8103,7 +9066,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
 }
 
 /**
- * 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.
@@ -8385,7 +9348,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
  *