net/ice/base: fix memory leak on GTPU RSS
[dpdk.git] / drivers / net / ice / base / ice_flow.c
index 030a55b..6035bdf 100644 (file)
@@ -198,7 +198,7 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = {
 static const u32 ice_ptypes_mac_ofos[] = {
        0xFDC00846, 0xBFBF7F7E, 0xF70001DF, 0xFEFDFDFB,
        0x0000077E, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x03FFF000, 0x7FFFFFE0, 0x00000000,
+       0x00400000, 0x03FFF000, 0x7FFFFFE0, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -218,11 +218,27 @@ static const u32 ice_ptypes_macvlan_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv4 header */
+/* Packet types for packets with an Outer/First/Single IPv4 header, does NOT
+ * include IPV4 other PTYPEs
+ */
 static const u32 ice_ptypes_ipv4_ofos[] = {
        0x1DC00000, 0x04000800, 0x00000000, 0x00000000,
        0x00000000, 0x00000155, 0x00000000, 0x00000000,
-       0x0003000F, 0x000FC000, 0x83E0F800, 0x00000101,
+       0x00000000, 0x000FC000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+/* Packet types for packets with an Outer/First/Single IPv4 header, includes
+ * IPV4 other PTYPEs
+ */
+static const u32 ice_ptypes_ipv4_ofos_all[] = {
+       0x1DC00000, 0x04000800, 0x00000000, 0x00000000,
+       0x00000000, 0x00000155, 0x00000000, 0x00000000,
+       0x00000000, 0x000FC000, 0x83E0F800, 0x00000101,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -242,8 +258,24 @@ static const u32 ice_ptypes_ipv4_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv6 header */
+/* Packet types for packets with an Outer/First/Single IPv6 header, does NOT
+ * include IVP6 other PTYPEs
+ */
 static const u32 ice_ptypes_ipv6_ofos[] = {
+       0x00000000, 0x00000000, 0x77000000, 0x10002000,
+       0x00000000, 0x000002AA, 0x00000000, 0x00000000,
+       0x00000000, 0x03F00000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+/* Packet types for packets with an Outer/First/Single IPv6 header, includes
+ * IPV6 other PTYPEs
+ */
+static const u32 ice_ptypes_ipv6_ofos_all[] = {
        0x00000000, 0x00000000, 0x77000000, 0x10002000,
        0x00000000, 0x000002AA, 0x00000000, 0x00000000,
        0x00080F00, 0x03F00000, 0x7C1F0000, 0x00000206,
@@ -266,6 +298,54 @@ static const u32 ice_ptypes_ipv6_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
+/* Packet types for packets with an Outer/First/Single IPv4 header - no L4 */
+static const u32 ice_ipv4_ofos_no_l4[] = {
+       0x10C00000, 0x04000800, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x000cc000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+/* Packet types for packets with an Innermost/Last IPv4 header - no L4 */
+static const u32 ice_ipv4_il_no_l4[] = {
+       0x60000000, 0x18043008, 0x80000002, 0x6010c021,
+       0x00000008, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00139800, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+/* Packet types for packets with an Outer/First/Single IPv6 header - no L4 */
+static const u32 ice_ipv6_ofos_no_l4[] = {
+       0x00000000, 0x00000000, 0x43000000, 0x10002000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x02300000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+/* Packet types for packets with an Innermost/Last IPv6 header - no L4 */
+static const u32 ice_ipv6_il_no_l4[] = {
+       0x00000000, 0x02180430, 0x0000010c, 0x086010c0,
+       0x00000430, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x4e600000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
 /* Packet types for packets with an Outermost/First ARP header */
 static const u32 ice_ptypes_arp_of[] = {
        0x00000800, 0x00000000, 0x00000000, 0x00000000,
@@ -389,6 +469,29 @@ static const u32 ice_ptypes_gtpc_tid[] = {
 };
 
 /* Packet types for GTPU */
+static const struct ice_ptype_attributes ice_attr_gtpu_session[] = {
+       { ICE_MAC_IPV4_GTPU_IPV4_FRAG,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV4_PAY,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV4_TCP,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV4_ICMP,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV4_FRAG,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV4_PAY,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV4_TCP,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV4_ICMP,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV6_FRAG,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV6_PAY,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV6_TCP,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV4_GTPU_IPV6_ICMPV6,  ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV6_FRAG,    ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV6_PAY,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV6_TCP,     ICE_PTYPE_ATTR_GTP_SESSION },
+       { ICE_MAC_IPV6_GTPU_IPV6_ICMPV6,  ICE_PTYPE_ATTR_GTP_SESSION },
+};
+
 static const struct ice_ptype_attributes ice_attr_gtpu_eh[] = {
        { ICE_MAC_IPV4_GTPU_IPV4_FRAG,    ICE_PTYPE_ATTR_GTP_PDU_EH },
        { ICE_MAC_IPV4_GTPU_IPV4_PAY,     ICE_PTYPE_ATTR_GTP_PDU_EH },
@@ -473,7 +576,7 @@ static const u32 ice_ptypes_gtpu[] = {
 static const u32 ice_ptypes_pppoe[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x03FFF000, 0x00000000, 0x00000000,
+       0x00000000, 0x03ffe000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -598,6 +701,9 @@ struct ice_flow_prof_params {
 #define ICE_FLOW_SEG_HDRS_L4_MASK      \
        (ICE_FLOW_SEG_HDR_ICMP | ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | \
         ICE_FLOW_SEG_HDR_SCTP)
+/* mask for L4 protocols that are NOT part of IPV4/6 OTHER PTYPE groups */
+#define ICE_FLOW_SEG_HDRS_L4_MASK_NO_OTHER     \
+       (ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_SCTP)
 
 /**
  * ice_flow_val_hdrs - validates packet segments for valid protocol headers
@@ -715,46 +821,47 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
                                       ICE_FLOW_PTYPE_MAX);
                }
 
-               if (hdrs & ICE_FLOW_SEG_HDR_IPV4) {
+               if (hdrs & ICE_FLOW_SEG_HDR_PPPOE) {
+                       src = (const ice_bitmap_t *)ice_ptypes_pppoe;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               }
+               if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) &&
+                   (hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER)) {
+                       src = i ?
+                               (const ice_bitmap_t *)ice_ptypes_ipv4_il :
+                               (const ice_bitmap_t *)ice_ptypes_ipv4_ofos_all;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV6) &&
+                          (hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER)) {
+                       src = i ?
+                               (const ice_bitmap_t *)ice_ptypes_ipv6_il :
+                               (const ice_bitmap_t *)ice_ptypes_ipv6_ofos_all;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) &&
+                          !(hdrs & ICE_FLOW_SEG_HDRS_L4_MASK_NO_OTHER)) {
+                       src = !i ? (const ice_bitmap_t *)ice_ipv4_ofos_no_l4 :
+                               (const ice_bitmap_t *)ice_ipv4_il_no_l4;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               } else if (hdrs & ICE_FLOW_SEG_HDR_IPV4) {
                        src = !i ? (const ice_bitmap_t *)ice_ptypes_ipv4_ofos :
                                (const ice_bitmap_t *)ice_ptypes_ipv4_il;
                        ice_and_bitmap(params->ptypes, params->ptypes, src,
                                       ICE_FLOW_PTYPE_MAX);
-                       if (hdrs & ICE_FLOW_SEG_HDR_UDP) {
-                               src = (const ice_bitmap_t *)ice_ptypes_udp_il;
-                               ice_and_bitmap(params->ptypes,
-                                               params->ptypes, src,
-                                              ICE_FLOW_PTYPE_MAX);
-                       } else if (hdrs & ICE_FLOW_SEG_HDR_TCP) {
-                               ice_and_bitmap(params->ptypes, params->ptypes,
-                                              (const ice_bitmap_t *)
-                                              ice_ptypes_tcp_il,
-                                              ICE_FLOW_PTYPE_MAX);
-                       } else if (hdrs & ICE_FLOW_SEG_HDR_SCTP) {
-                               src = (const ice_bitmap_t *)ice_ptypes_sctp_il;
-                               ice_and_bitmap(params->ptypes, params->ptypes,
-                                              src, ICE_FLOW_PTYPE_MAX);
-                       }
+               } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV6) &&
+                          !(hdrs & ICE_FLOW_SEG_HDRS_L4_MASK_NO_OTHER)) {
+                       src = !i ? (const ice_bitmap_t *)ice_ipv6_ofos_no_l4 :
+                               (const ice_bitmap_t *)ice_ipv6_il_no_l4;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
                } else if (hdrs & ICE_FLOW_SEG_HDR_IPV6) {
                        src = !i ? (const ice_bitmap_t *)ice_ptypes_ipv6_ofos :
                                (const ice_bitmap_t *)ice_ptypes_ipv6_il;
                        ice_and_bitmap(params->ptypes, params->ptypes, src,
                                       ICE_FLOW_PTYPE_MAX);
-                       if (hdrs & ICE_FLOW_SEG_HDR_UDP) {
-                               src = (const ice_bitmap_t *)ice_ptypes_udp_il;
-                               ice_and_bitmap(params->ptypes,
-                                               params->ptypes, src,
-                                              ICE_FLOW_PTYPE_MAX);
-                       } else if (hdrs & ICE_FLOW_SEG_HDR_TCP) {
-                               ice_and_bitmap(params->ptypes, params->ptypes,
-                                              (const ice_bitmap_t *)
-                                              ice_ptypes_tcp_il,
-                                              ICE_FLOW_PTYPE_MAX);
-                       } else if (hdrs & ICE_FLOW_SEG_HDR_SCTP) {
-                               src = (const ice_bitmap_t *)ice_ptypes_sctp_il;
-                               ice_and_bitmap(params->ptypes, params->ptypes,
-                                              src, ICE_FLOW_PTYPE_MAX);
-                       }
                }
 
                if (hdrs & ICE_FLOW_SEG_HDR_ETH_NON_IP) {
@@ -765,6 +872,24 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
                        src = (const ice_bitmap_t *)ice_ptypes_pppoe;
                        ice_and_bitmap(params->ptypes, params->ptypes, src,
                                       ICE_FLOW_PTYPE_MAX);
+               } else {
+                       src = (const ice_bitmap_t *)ice_ptypes_pppoe;
+                       ice_andnot_bitmap(params->ptypes, params->ptypes, src,
+                                         ICE_FLOW_PTYPE_MAX);
+               }
+
+               if (hdrs & ICE_FLOW_SEG_HDR_UDP) {
+                       src = (const ice_bitmap_t *)ice_ptypes_udp_il;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               } else if (hdrs & ICE_FLOW_SEG_HDR_TCP) {
+                       ice_and_bitmap(params->ptypes, params->ptypes,
+                                      (const ice_bitmap_t *)ice_ptypes_tcp_il,
+                                      ICE_FLOW_PTYPE_MAX);
+               } else if (hdrs & ICE_FLOW_SEG_HDR_SCTP) {
+                       src = (const ice_bitmap_t *)ice_ptypes_sctp_il;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
                }
 
                if (hdrs & ICE_FLOW_SEG_HDR_ICMP) {
@@ -814,6 +939,10 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
                        src = (const ice_bitmap_t *)ice_ptypes_gtpu;
                        ice_and_bitmap(params->ptypes, params->ptypes,
                                       src, ICE_FLOW_PTYPE_MAX);
+
+                       /* Attributes for GTP packet without Extension Header */
+                       params->attr = ice_attr_gtpu_session;
+                       params->attr_cnt = ARRAY_SIZE(ice_attr_gtpu_session);
                } else if (hdrs & ICE_FLOW_SEG_HDR_L2TPV3) {
                        src = (const ice_bitmap_t *)ice_ptypes_l2tpv3;
                        ice_and_bitmap(params->ptypes, params->ptypes,
@@ -914,7 +1043,6 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        struct ice_flow_fld_info *flds;
        u16 cnt, ese_bits, i;
        u16 sib_mask = 0;
-       s16 adj = 0;
        u16 mask;
        u16 off;
 
@@ -1060,7 +1188,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        flds[fld].xtrct.prot_id = prot_id;
        flds[fld].xtrct.off = (ice_flds_info[fld].off / ese_bits) *
                ICE_FLOW_FV_EXTRACT_SZ;
-       flds[fld].xtrct.disp = (u8)((ice_flds_info[fld].off + adj) % ese_bits);
+       flds[fld].xtrct.disp = (u8)(ice_flds_info[fld].off % ese_bits);
        flds[fld].xtrct.idx = params->es_cnt;
        flds[fld].xtrct.mask = ice_flds_info[fld].mask;
 
@@ -1384,7 +1512,6 @@ ice_flow_proc_segs(struct ice_hw *hw, struct ice_flow_prof_params *params)
                if (status)
                        return status;
                break;
-       case ICE_BLK_SW:
        default:
                return ICE_ERR_NOT_IMPL;
        }
@@ -2115,15 +2242,17 @@ enum ice_status
 ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
                     u8 *hw_prof_id)
 {
+       enum ice_status status = ICE_ERR_DOES_NOT_EXIST;
        struct ice_prof_map *map;
 
+       ice_acquire_lock(&hw->blk[blk].es.prof_map_lock);
        map = ice_search_prof_id(hw, blk, prof_id);
        if (map) {
                *hw_prof_id = map->prof_id;
-               return ICE_SUCCESS;
+               status = ICE_SUCCESS;
        }
-
-       return ICE_ERR_DOES_NOT_EXIST;
+       ice_release_lock(&hw->blk[blk].es.prof_map_lock);
+       return status;
 }
 
 /**
@@ -2915,8 +3044,6 @@ ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
                        goto out;
 
                break;
-       case ICE_BLK_SW:
-       case ICE_BLK_PE:
        default:
                status = ICE_ERR_NOT_IMPL;
                goto out;
@@ -3154,7 +3281,7 @@ ice_flow_set_rss_seg_info(struct ice_flow_seg_info *segs, u64 hash_fields,
        ICE_FLOW_SET_HDRS(segs, flow_hdr);
 
        if (segs->hdrs & ~ICE_FLOW_RSS_SEG_HDR_VAL_MASKS &
-           ~ICE_FLOW_RSS_HDRS_INNER_MASK)
+           ~ICE_FLOW_RSS_HDRS_INNER_MASK & ~ICE_FLOW_SEG_HDR_IPV_OTHER)
                return ICE_ERR_PARAM;
 
        val = (u64)(segs->hdrs & ICE_FLOW_RSS_SEG_HDR_L3_MASKS);
@@ -3214,7 +3341,7 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle)
        if (LIST_EMPTY(&hw->fl_profs[blk]))
                return ICE_SUCCESS;
 
-       ice_acquire_lock(&hw->fl_profs_locks[blk]);
+       ice_acquire_lock(&hw->rss_locks);
        LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof,
                                 l_entry)
                if (ice_is_bit_set(p->vsis, vsi_handle)) {
@@ -3223,12 +3350,12 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle)
                                break;
 
                        if (!ice_is_any_bit_set(p->vsis, ICE_MAX_VSI)) {
-                               status = ice_flow_rem_prof_sync(hw, blk, p);
+                               status = ice_flow_rem_prof(hw, blk, p->id);
                                if (status)
                                        break;
                        }
                }
-       ice_release_lock(&hw->fl_profs_locks[blk]);
+       ice_release_lock(&hw->rss_locks);
 
        return status;
 }
@@ -3358,9 +3485,13 @@ ice_rss_update_symm(struct ice_hw *hw,
        struct ice_prof_map *map;
        u8 prof_id, m;
 
+       ice_acquire_lock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock);
        map = ice_search_prof_id(hw, ICE_BLK_RSS, prof->id);
-       prof_id = map->prof_id;
-
+       if (map)
+               prof_id = map->prof_id;
+       ice_release_lock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock);
+       if (!map)
+               return;
        /* clear to default */
        for (m = 0; m < 6; m++)
                wr32(hw, GLQF_HSYMM(prof_id, m), 0);
@@ -3453,6 +3584,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
        if (status)
                goto exit;
 
+       /* don't do RSS for GTPU outer */
+       if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+           segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU) {
+               status = ICE_SUCCESS;
+               goto exit;
+       }
+
        /* Search for a flow profile that has matching headers, hash fields
         * and has the input VSI associated to it. If found, no further
         * operations required and exit.
@@ -3569,6 +3707,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
        ice_acquire_lock(&hw->rss_locks);
        status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,
                                      ICE_RSS_OUTER_HEADERS, symm);
+
        if (!status)
                status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds,
                                              addl_hdrs, ICE_RSS_INNER_HEADERS,
@@ -3608,6 +3747,12 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
        if (status)
                goto out;
 
+       if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+           segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU) {
+               status = ICE_SUCCESS;
+               goto out;
+       }
+
        prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,
                                        vsi_handle,
                                        ICE_FLOW_FIND_PROF_CHK_FLDS);
@@ -3716,7 +3861,8 @@ enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle)
  */
 u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs)
 {
-       struct ice_rss_cfg *r, *rss_cfg = NULL;
+       u64 rss_hash = ICE_HASH_INVALID;
+       struct ice_rss_cfg *r;
 
        /* verify if the protocol header is non zero and VSI is valid */
        if (hdrs == ICE_FLOW_SEG_HDR_NONE || !ice_is_vsi_valid(hw, vsi_handle))
@@ -3727,10 +3873,10 @@ u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs)
                            ice_rss_cfg, l_entry)
                if (ice_is_bit_set(r->vsis, vsi_handle) &&
                    r->packet_hdr == hdrs) {
-                       rss_cfg = r;
+                       rss_hash = r->hashed_flds;
                        break;
                }
        ice_release_lock(&hw->rss_locks);
 
-       return rss_cfg ? rss_cfg->hashed_flds : ICE_HASH_INVALID;
+       return rss_hash;
 }