X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fbase%2Fice_switch.c;h=43ad0181186a812e7103f92bbb9f19fa05f0ac13;hb=ccf69617ce96e1b708c7644289ee8df4586f7556;hp=dc55d7e3ceedc284a9ab99840d40b110fbf9e20c;hpb=323e51eb25d4fa9c3a980df019ed446b3be8bce4;p=dpdk.git diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index dc55d7e3ce..43ad018118 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -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" @@ -10,10 +10,13 @@ #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. @@ -257,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 }, @@ -270,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, @@ -318,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 }, @@ -334,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, @@ -392,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 }, @@ -405,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 */ @@ -470,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 }, @@ -483,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 */ @@ -504,39 +526,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 +1115,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,18 +1164,44 @@ 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 }, - { ICE_VLAN_OFOS, 14}, + { 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_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV4_OFOS, 26 }, { ICE_PROTOCOL_LAST, 0 }, @@ -758,9 +1212,9 @@ static const u8 dummy_pppoe_ipv4_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x16, @@ -779,8 +1233,8 @@ static const u8 dummy_pppoe_ipv4_packet[] = { static const struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_tcp_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV4_OFOS, 26 }, { ICE_TCP_IL, 46 }, @@ -792,9 +1246,9 @@ static const u8 dummy_pppoe_ipv4_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x16, @@ -819,8 +1273,8 @@ static const u8 dummy_pppoe_ipv4_tcp_packet[] = { static const struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_udp_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV4_OFOS, 26 }, { ICE_UDP_ILOS, 46 }, @@ -832,9 +1286,9 @@ static const u8 dummy_pppoe_ipv4_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x16, @@ -855,8 +1309,8 @@ static const u8 dummy_pppoe_ipv4_udp_packet[] = { static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV6_OFOS, 26 }, { ICE_PROTOCOL_LAST, 0 }, @@ -867,9 +1321,9 @@ static const u8 dummy_pppoe_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x2a, @@ -893,8 +1347,8 @@ static const u8 dummy_pppoe_ipv6_packet[] = { static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_tcp_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV6_OFOS, 26 }, { ICE_TCP_IL, 66 }, @@ -906,9 +1360,9 @@ static const u8 dummy_pppoe_ipv6_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x2a, @@ -938,8 +1392,8 @@ static const u8 dummy_pppoe_ipv6_tcp_packet[] = { static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_udp_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_OFOS, 14}, + { ICE_VLAN_OFOS, 12 }, + { ICE_ETYPE_OL, 16 }, { ICE_PPPOE, 18 }, { ICE_IPV6_OFOS, 26 }, { ICE_UDP_ILOS, 66 }, @@ -951,9 +1405,9 @@ static const u8 dummy_pppoe_ipv6_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, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */ + 0x88, 0x64, /* ICE_ETYPE_OL 16 */ 0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */ 0x00, 0x2a, @@ -1172,21 +1626,150 @@ static const u8 dummy_ipv4_l2tpv3_pkt[] = { 0x00, 0x00, /* 2 bytes for 4 bytes alignment */ }; -static const struct ice_dummy_pkt_offsets dummy_ipv6_l2tpv3_packet_offsets[] = { +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_UDP_ILOS 42 */ + 0x00, 0x08, 0x00, 0x00, + + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv4_tcp_packet_offsets[] = { + { ICE_MAC_OFOS, 0 }, + { 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_qinq_ipv4_tcp_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, 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_TCP_IL 42 */ + 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_qinq_ipv6_packet_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_IPV6_OFOS, 22 }, { ICE_PROTOCOL_LAST, 0 }, }; -static const u8 dummy_ipv6_l2tpv3_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_IL 14 */ - 0x00, 0x0c, 0x73, 0x40, + 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, @@ -1196,60 +1779,68 @@ 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 */ + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ }; -static const struct ice_dummy_pkt_offsets dummy_qinq_ipv4_packet_offsets[] = { +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv6_udp_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, - { ICE_IPV4_OFOS, 22 }, + { 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_qinq_ipv4_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, - 0x91, 0x00, - 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ - 0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_OFOS 18 */ + 0x91, 0x00, 0x00, 0x00, /* ICE_VLAN_EX 12 */ + 0x81, 0x00, 0x00, 0x00, /* ICE_VLAN_IN 16 */ + 0x86, 0xDD, /* ICE_ETYPE_OL 20 */ - 0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 22 */ - 0x00, 0x01, 0x00, 0x00, - 0x00, 0x11, 0x00, 0x00, + 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, 0x00, 0x00, + 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 42 */ + 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_qinq_ipv6_packet_offsets[] = { +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv6_tcp_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { 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_qinq_ipv6_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, - 0x91, 0x00, - 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ - 0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_OFOS 18 */ + 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, 0x10, 0x11, 0x00, /* Next header UDP */ + 0x00, 0x14, 0x06, 0x00, /* Next header TCP */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1259,10 +1850,10 @@ static const u8 dummy_qinq_ipv6_pkt[] = { 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, /* 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 byte alignment */ @@ -1270,8 +1861,9 @@ static const u8 dummy_qinq_ipv6_pkt[] = { static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_EX, 12 }, + { ICE_VLAN_IN, 16 }, + { ICE_ETYPE_OL, 20 }, { ICE_PPPOE, 22 }, { ICE_PROTOCOL_LAST, 0 }, }; @@ -1279,8 +1871,9 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = { static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_ipv4_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_EX, 12 }, + { ICE_VLAN_IN, 16 }, + { ICE_ETYPE_OL, 20 }, { ICE_PPPOE, 22 }, { ICE_IPV4_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 }, @@ -1290,17 +1883,17 @@ 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, - 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ - 0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 18 */ + 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_IL 30 */ + 0x45, 0x00, 0x00, 0x14, /* ICE_IPV4_OFOS 30 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1312,9 +1905,9 @@ static const u8 dummy_qinq_pppoe_ipv4_pkt[] = { static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_ipv6_offsets[] = { { ICE_MAC_OFOS, 0 }, - { ICE_ETYPE_OL, 12 }, - { ICE_VLAN_EX, 14}, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_EX, 12 }, + { ICE_VLAN_IN, 16 }, + { ICE_ETYPE_OL, 20 }, { ICE_PPPOE, 22 }, { ICE_IPV6_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 }, @@ -1325,10 +1918,9 @@ static const u8 dummy_qinq_pppoe_ipv6_packet[] = { 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_OFOS 18 */ + 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, @@ -1372,6 +1964,33 @@ 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 @@ -1383,7 +2002,7 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) 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, profile_num = 0; + u16 i, j, k, profile_num = 0; bool non_tun_valid = false; bool pppoe_valid = false; bool vxlan_valid = false; @@ -1457,18 +2076,12 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) } 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)) { @@ -1885,7 +2498,7 @@ ice_alloc_global_lut_exit: } /** - * ice_free_global_lut - free a RSS global LUT + * 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 */ @@ -2761,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 @@ -2936,6 +3606,10 @@ 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) { @@ -3034,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; @@ -3106,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; @@ -3149,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 */ @@ -3683,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 */ @@ -4138,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 @@ -4181,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); @@ -4500,7 +5182,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 @@ -4881,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... @@ -5016,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)))); } @@ -5090,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; } @@ -5193,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 @@ -5600,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: @@ -5628,6 +6309,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); @@ -6028,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, @@ -6043,7 +6725,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 } }, @@ -6051,7 +6733,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_EX, { 2, 0 } }, + { ICE_VLAN_IN, { 2, 0 } }, }; /* The following table describes preferred grouping of recipes. @@ -6060,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 }, @@ -6086,6 +6769,7 @@ static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { 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 }, }; /** @@ -6096,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; @@ -6158,13 +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 && 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 @@ -6185,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 * @@ -6204,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; @@ -6784,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 */ @@ -6963,38 +7665,100 @@ 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: @@ -7155,7 +7919,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; @@ -7248,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++) { @@ -7260,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 && @@ -7272,28 +8042,55 @@ 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_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; 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_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; @@ -7310,6 +8107,11 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, *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; @@ -7324,30 +8126,10 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, *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) { @@ -7413,6 +8195,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); @@ -7573,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); @@ -7637,6 +8519,7 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, break; case ICE_VLAN_OFOS: case ICE_VLAN_EX: + case ICE_VLAN_IN: len = sizeof(struct ice_vlan_hdr); break; case ICE_IPV4_OFOS: @@ -8278,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; @@ -8375,7 +9258,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. @@ -8657,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 *