Added support for the Flags and Fragment Offset fields of ipv4 fragments. Field definitions are the same as in rte_ipv4_hdr.
Signed-off-by: Mingjin Ye <mingjinx...@intel.com> --- drivers/net/ice/base/ice_fdir.h | 2 ++ drivers/net/ice/base/ice_flow.c | 5 +++++ drivers/net/ice/base/ice_flow.h | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index 1bb8a14a5d..3461f8dfba 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -56,6 +56,7 @@ #define ICE_IPV4_TOS_OFFSET 15 #define ICE_IPV4_ID_OFFSET 18 #define ICE_IPV4_TTL_OFFSET 22 +#define ICE_IPV4_FRAGMENT_OFFSET 20 #define ICE_IPV6_TC_OFFSET 14 #define ICE_IPV6_HLIM_OFFSET 21 #define ICE_IPV6_PROTO_OFFSET 20 @@ -181,6 +182,7 @@ struct ice_fdir_v4 { u8 proto; u8 ttl; __be16 packet_id; + __be16 fragment_offset; }; #define ICE_IPV6_ADDR_LEN_AS_U32 4 diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 0d64a5bb1e..60d640a26f 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -21,6 +21,7 @@ #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_FLAGS 2 #define ICE_FLOW_FLD_SZ_IP_PROT 1 #define ICE_FLOW_FLD_SZ_PORT 2 #define ICE_FLOW_FLD_SZ_TCP_FLAGS 1 @@ -87,6 +88,9 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { /* ICE_FLOW_FIELD_IDX_IPV4_TTL */ ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_NONE, 8, ICE_FLOW_FLD_SZ_IP_TTL, 0xff00), + /* ICE_FLOW_FIELD_IDX_IPV4_OFFSET */ + ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_IPV_FRAG, 6, + ICE_FLOW_FLD_SZ_IP_FLAGS, 0x3fff), /* ICE_FLOW_FIELD_IDX_IPV4_PROT */ ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_NONE, 8, ICE_FLOW_FLD_SZ_IP_PROT, 0x00ff), @@ -1459,6 +1463,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, prot_id = ICE_PROT_IPV4_IL_IL; break; case ICE_FLOW_FIELD_IDX_IPV4_ID: + case ICE_FLOW_FIELD_IDX_IPV4_OFFSET: prot_id = ICE_PROT_IPV4_OF_OR_S; break; case ICE_FLOW_FIELD_IDX_IPV6_SA: diff --git a/drivers/net/ice/base/ice_flow.h b/drivers/net/ice/base/ice_flow.h index 65b261beca..a87c0e4567 100644 --- a/drivers/net/ice/base/ice_flow.h +++ b/drivers/net/ice/base/ice_flow.h @@ -239,6 +239,7 @@ enum ice_flow_field { ICE_FLOW_FIELD_IDX_IPV4_DSCP, ICE_FLOW_FIELD_IDX_IPV6_DSCP, ICE_FLOW_FIELD_IDX_IPV4_TTL, + ICE_FLOW_FIELD_IDX_IPV4_OFFSET, ICE_FLOW_FIELD_IDX_IPV4_PROT, ICE_FLOW_FIELD_IDX_IPV6_TTL, ICE_FLOW_FIELD_IDX_IPV6_PROT, -- 2.25.1