net/ice/base: allow GTP-U filter using only inner protocols
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 13 Apr 2021 05:06:40 +0000 (13:06 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 13 Apr 2021 14:25:27 +0000 (16:25 +0200)
Adds a support for switch filter: GTP-U using just inner fields.
If user doesn't specify outer protocol and its fields but wants to
add switch filter for GTP-U using inner protocols and related fields
such as inner L3 and/or inner L4, this patch enables such filtering.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_protocol_type.h
drivers/net/ice/base/ice_switch.c

index d078061..8c9d098 100644 (file)
@@ -110,6 +110,8 @@ enum ice_sw_tunnel_type {
        ICE_SW_TUN_IPV4_GTPU_IPV6,
        ICE_SW_TUN_IPV6_GTPU_IPV4,
        ICE_SW_TUN_IPV6_GTPU_IPV6,
+       ICE_SW_TUN_GTP_IPV4,
+       ICE_SW_TUN_GTP_IPV6,
        ICE_ALL_TUNNELS /* All tunnel types including NVGRE */
 };
 
index a567b6d..45f83cd 100644 (file)
@@ -7980,13 +7980,15 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
        }
 
        /* Support GTP tunnel + L3 */
-       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4) {
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4 ||
+           tun_type == ICE_SW_TUN_GTP_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) {
+       if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6 ||
+           tun_type == ICE_SW_TUN_GTP_IPV6) {
                *pkt = dummy_ipv4_gtpu_ipv6_packet;
                *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
                *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;