net/ice/base: add new AQ description
[dpdk.git] / drivers / net / ice / base / ice_flow.c
index 6dba9e7..b336275 100644 (file)
@@ -13,6 +13,8 @@
 #define ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR        4
 #define ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR        6
 #define ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR        8
+#define ICE_FLOW_FLD_SZ_IPV4_ID                2
+#define ICE_FLOW_FLD_SZ_IPV6_ID                4
 #define ICE_FLOW_FLD_SZ_IP_DSCP                1
 #define ICE_FLOW_FLD_SZ_IP_TTL         1
 #define ICE_FLOW_FLD_SZ_IP_PROT                1
@@ -96,6 +98,12 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = {
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, ICE_FLOW_FLD_SZ_IPV6_ADDR),
        /* ICE_FLOW_FIELD_IDX_IPV6_DA */
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, ICE_FLOW_FLD_SZ_IPV6_ADDR),
+       /* ICE_FLOW_FIELD_IDX_IPV4_FRAG */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4,
+                         ICE_FLOW_FLD_SZ_IPV4_ID),
+       /* ICE_FLOW_FIELD_IDX_IPV6_FRAG */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4,
+                         ICE_FLOW_FLD_SZ_IPV6_ID),
        /* ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA */
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8,
                          ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR),
@@ -231,11 +239,11 @@ static const u32 ice_ptypes_macvlan_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv4 header, does NOT
- * include IPV4 other PTYPEs
+/* Packet types for packets with an Outer/First/Single non-frag IPv4 header,
+ * does NOT include IPV4 other PTYPEs
  */
 static const u32 ice_ptypes_ipv4_ofos[] = {
-       0x1DC00000, 0x24000800, 0x00000000, 0x00000000,
+       0x1D800000, 0x24000800, 0x00000000, 0x00000000,
        0x00000000, 0x00000155, 0x00000000, 0x00000000,
        0x00000000, 0x000FC000, 0x000002A0, 0x00100000,
        0x00001500, 0x00000000, 0x00000000, 0x00000000,
@@ -245,11 +253,11 @@ static const u32 ice_ptypes_ipv4_ofos[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv4 header, includes
- * IPV4 other PTYPEs
+/* Packet types for packets with an Outer/First/Single non-frag IPv4 header,
+ * includes IPV4 other PTYPEs
  */
 static const u32 ice_ptypes_ipv4_ofos_all[] = {
-       0x1DC00000, 0x24000800, 0x00000000, 0x00000000,
+       0x1D800000, 0x24000800, 0x00000000, 0x00000000,
        0x00000000, 0x00000155, 0x00000000, 0x00000000,
        0x00000000, 0x000FC000, 0x83E0FAA0, 0x00000101,
        0x03FFD500, 0x00000000, 0x00000000, 0x00000000,
@@ -271,11 +279,11 @@ static const u32 ice_ptypes_ipv4_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv6 header, does NOT
- * include IVP6 other PTYPEs
+/* Packet types for packets with an Outer/First/Single non-frag IPv6 header,
+ * does NOT include IVP6 other PTYPEs
  */
 static const u32 ice_ptypes_ipv6_ofos[] = {
-       0x00000000, 0x00000000, 0x77000000, 0x10002000,
+       0x00000000, 0x00000000, 0x76000000, 0x10002000,
        0x00000000, 0x000002AA, 0x00000000, 0x00000000,
        0x00000000, 0x03F00000, 0x00000540, 0x00000000,
        0x00002A00, 0x00000000, 0x00000000, 0x00000000,
@@ -285,11 +293,11 @@ static const u32 ice_ptypes_ipv6_ofos[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv6 header, includes
- * IPV6 other PTYPEs
+/* Packet types for packets with an Outer/First/Single non-frag IPv6 header,
+ * includes IPV6 other PTYPEs
  */
 static const u32 ice_ptypes_ipv6_ofos_all[] = {
-       0x00000000, 0x00000000, 0x77000000, 0x10002000,
+       0x00000000, 0x00000000, 0x76000000, 0x10002000,
        0x00000000, 0x000002AA, 0x00000000, 0x00000000,
        0x00000000, 0x03F00000, 0x7C1F0540, 0x00000206,
        0xFC002A00, 0x0000003F, 0x00000000, 0x00000000,
@@ -311,9 +319,11 @@ static const u32 ice_ptypes_ipv6_il[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv4 header - no L4 */
+/* Packet types for packets with an Outer/First/Single
+ * non-frag IPv4 header - no L4
+ */
 static const u32 ice_ptypes_ipv4_ofos_no_l4[] = {
-       0x10C00000, 0x04000800, 0x00000000, 0x00000000,
+       0x10800000, 0x04000800, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x000cc000, 0x000002A0, 0x00000000,
        0x00001500, 0x00000000, 0x00000000, 0x00000000,
@@ -335,9 +345,11 @@ static const u32 ice_ptypes_ipv4_il_no_l4[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
-/* Packet types for packets with an Outer/First/Single IPv6 header - no L4 */
+/* Packet types for packets with an Outer/First/Single
+ * non-frag IPv6 header - no L4
+ */
 static const u32 ice_ptypes_ipv6_ofos_no_l4[] = {
-       0x00000000, 0x00000000, 0x43000000, 0x10002000,
+       0x00000000, 0x00000000, 0x42000000, 0x10002000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x02300000, 0x00000540, 0x00000000,
        0x00002A00, 0x00000000, 0x00000000, 0x00000000,
@@ -747,6 +759,28 @@ static const u32 ice_ptypes_ppp[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
+static const u32 ice_ptypes_ipv4_frag[] = {
+       0x00400000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
+static const u32 ice_ptypes_ipv6_frag[] = {
+       0x00000000, 0x00000000, 0x01000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
 /* Manage parameters and info. used during the creation of a flow profile */
 struct ice_flow_prof_params {
        enum ice_block blk;
@@ -922,6 +956,16 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
                                (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_HDR_IPV_FRAG)) {
+                       src = (const ice_bitmap_t *)ice_ptypes_ipv4_frag;
+                       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_FRAG)) {
+                       src = (const ice_bitmap_t *)ice_ptypes_ipv6_frag;
+                       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_ptypes_ipv4_ofos_no_l4 :
@@ -1210,6 +1254,9 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        case ICE_FLOW_FIELD_IDX_IPV4_DA:
                prot_id = seg == 0 ? ICE_PROT_IPV4_OF_OR_S : ICE_PROT_IPV4_IL;
                break;
+       case ICE_FLOW_FIELD_IDX_IPV4_ID:
+               prot_id = ICE_PROT_IPV4_OF_OR_S;
+               break;
        case ICE_FLOW_FIELD_IDX_IPV6_SA:
        case ICE_FLOW_FIELD_IDX_IPV6_DA:
        case ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA:
@@ -1220,6 +1267,9 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        case ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA:
                prot_id = seg == 0 ? ICE_PROT_IPV6_OF_OR_S : ICE_PROT_IPV6_IL;
                break;
+       case ICE_FLOW_FIELD_IDX_IPV6_ID:
+               prot_id = ICE_PROT_IPV6_FRAG;
+               break;
        case ICE_FLOW_FIELD_IDX_TCP_SRC_PORT:
        case ICE_FLOW_FIELD_IDX_TCP_DST_PORT:
        case ICE_FLOW_FIELD_IDX_TCP_FLAGS:
@@ -3384,7 +3434,7 @@ enum ice_status ice_flow_rem_vsi_prof(struct ice_hw *hw, enum ice_block blk, u16
 }
 
 #define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \
-(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
+(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_ETH_NON_IP | ICE_FLOW_SEG_HDR_VLAN)
 
 #define ICE_FLOW_RSS_SEG_HDR_L3_MASKS \
        (ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6)
@@ -3429,13 +3479,16 @@ ice_flow_set_rss_seg_info(struct ice_flow_seg_info *segs, u8 seg_cnt,
        /* set outer most header */
        if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV4)
                segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV4 |
+                                                  ICE_FLOW_SEG_HDR_IPV_FRAG |
                                                   ICE_FLOW_SEG_HDR_IPV_OTHER;
        else if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV6)
                segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV6 |
+                                                  ICE_FLOW_SEG_HDR_IPV_FRAG |
                                                   ICE_FLOW_SEG_HDR_IPV_OTHER;
 
        if (seg->hdrs & ~ICE_FLOW_RSS_SEG_HDR_VAL_MASKS &
-           ~ICE_FLOW_RSS_HDRS_INNER_MASK & ~ICE_FLOW_SEG_HDR_IPV_OTHER)
+           ~ICE_FLOW_RSS_HDRS_INNER_MASK & ~ICE_FLOW_SEG_HDR_IPV_OTHER &
+           ~ICE_FLOW_SEG_HDR_IPV_FRAG)
                return ICE_ERR_PARAM;
 
        val = (u64)(seg->hdrs & ICE_FLOW_RSS_SEG_HDR_L3_MASKS);