net/ice/base: support RSS for IPv4/L4 checksum
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 10 Aug 2021 02:51:35 +0000 (10:51 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 11 Aug 2021 02:25:13 +0000 (04:25 +0200)
The IPv4/TCP/UDP/SCTP header checksum fields are defined in this
patch and can be used as RSS input sets.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
drivers/net/ice/base/ice_flow.c
drivers/net/ice/base/ice_flow.h

index 0b7d087..4705483 100644 (file)
 #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_CHKSUM      2
+#define ICE_FLOW_FLD_SZ_TCP_CHKSUM     2
+#define ICE_FLOW_FLD_SZ_UDP_CHKSUM     2
+#define ICE_FLOW_FLD_SZ_SCTP_CHKSUM    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
@@ -98,6 +102,8 @@ 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_CHKSUM */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV4, 10, ICE_FLOW_FLD_SZ_IP_CHKSUM),
        /* ICE_FLOW_FIELD_IDX_IPV4_FRAG */
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4,
                          ICE_FLOW_FLD_SZ_IPV4_ID),
@@ -137,6 +143,13 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = {
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 2, ICE_FLOW_FLD_SZ_PORT),
        /* ICE_FLOW_FIELD_IDX_TCP_FLAGS */
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 13, ICE_FLOW_FLD_SZ_TCP_FLAGS),
+       /* ICE_FLOW_FIELD_IDX_TCP_CHKSUM */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 16, ICE_FLOW_FLD_SZ_TCP_CHKSUM),
+       /* ICE_FLOW_FIELD_IDX_UDP_CHKSUM */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_UDP, 6, ICE_FLOW_FLD_SZ_UDP_CHKSUM),
+       /* ICE_FLOW_FIELD_IDX_SCTP_CHKSUM */
+       ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 8,
+                         ICE_FLOW_FLD_SZ_SCTP_CHKSUM),
        /* ARP */
        /* ICE_FLOW_FIELD_IDX_ARP_SIP */
        ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_ARP, 14, ICE_FLOW_FLD_SZ_IPV4_ADDR),
@@ -1410,6 +1423,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
                break;
        case ICE_FLOW_FIELD_IDX_IPV4_SA:
        case ICE_FLOW_FIELD_IDX_IPV4_DA:
+       case ICE_FLOW_FIELD_IDX_IPV4_CHKSUM:
                prot_id = seg == 0 ? ICE_PROT_IPV4_OF_OR_S : ICE_PROT_IPV4_IL;
                if (params->prof->segs[0].hdrs & ICE_FLOW_SEG_HDR_GRE &&
                    params->prof->segs[1].hdrs & ICE_FLOW_SEG_HDR_GTPU &&
@@ -1439,14 +1453,17 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        case ICE_FLOW_FIELD_IDX_TCP_SRC_PORT:
        case ICE_FLOW_FIELD_IDX_TCP_DST_PORT:
        case ICE_FLOW_FIELD_IDX_TCP_FLAGS:
+       case ICE_FLOW_FIELD_IDX_TCP_CHKSUM:
                prot_id = ICE_PROT_TCP_IL;
                break;
        case ICE_FLOW_FIELD_IDX_UDP_SRC_PORT:
        case ICE_FLOW_FIELD_IDX_UDP_DST_PORT:
+       case ICE_FLOW_FIELD_IDX_UDP_CHKSUM:
                prot_id = ICE_PROT_UDP_IL_OR_S;
                break;
        case ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT:
        case ICE_FLOW_FIELD_IDX_SCTP_DST_PORT:
+       case ICE_FLOW_FIELD_IDX_SCTP_CHKSUM:
                prot_id = ICE_PROT_SCTP_IL;
                break;
        case ICE_FLOW_FIELD_IDX_VXLAN_VNI:
index 39408c5..92beb75 100644 (file)
@@ -228,6 +228,7 @@ enum ice_flow_field {
        ICE_FLOW_FIELD_IDX_IPV4_DA,
        ICE_FLOW_FIELD_IDX_IPV6_SA,
        ICE_FLOW_FIELD_IDX_IPV6_DA,
+       ICE_FLOW_FIELD_IDX_IPV4_CHKSUM,
        ICE_FLOW_FIELD_IDX_IPV4_ID,
        ICE_FLOW_FIELD_IDX_IPV6_ID,
        ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA,
@@ -244,6 +245,9 @@ enum ice_flow_field {
        ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT,
        ICE_FLOW_FIELD_IDX_SCTP_DST_PORT,
        ICE_FLOW_FIELD_IDX_TCP_FLAGS,
+       ICE_FLOW_FIELD_IDX_TCP_CHKSUM,
+       ICE_FLOW_FIELD_IDX_UDP_CHKSUM,
+       ICE_FLOW_FIELD_IDX_SCTP_CHKSUM,
        /* ARP */
        ICE_FLOW_FIELD_IDX_ARP_SIP,
        ICE_FLOW_FIELD_IDX_ARP_DIP,