net/i40e: fix parsing packet type for NEON
[dpdk.git] / drivers / net / ice / base / ice_switch.c
index 4568242..3dc7642 100644 (file)
@@ -912,39 +912,7 @@ static const u8 dummy_ipv6_gtpu_ipv6_udp_packet[] = {
        0x00, 0x00, /* 2 bytes for 4 byte alignment */
 };
 
-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_gtpu_ipv4_packet_offsets[] = {
+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 },
@@ -1126,8 +1094,38 @@ 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 },
@@ -6080,7 +6078,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:
@@ -6108,6 +6106,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);
@@ -7808,26 +7807,6 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_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) {
@@ -7976,6 +7955,32 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                return;
        }
 
+       /* Support GTP tunnel + L3 */
+       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;
+       }
+       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;
+       }
+       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;
+       }
+       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_ALL_TUNNELS) {
                *pkt = dummy_gre_udp_packet;
                *pkt_len = sizeof(dummy_gre_udp_packet);