From: Qi Zhang Date: Thu, 29 Apr 2021 00:41:38 +0000 (+0800) Subject: net/ice/base: add IP fragment flags X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=937fa68010317dde8bc2f63117e82315c2176b5c;p=dpdk.git net/ice/base: add IP fragment flags Add the IPv6 fragment flags and the IPv4 fragment field shift. Signed-off-by: Ting Xu Signed-off-by: Jeff Guo Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index 8f9c0d346b..f6a6ff3831 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -1505,7 +1505,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); if (frag) - loc[20] = ICE_FDIR_IPV4_PKT_FLAG_DF; + loc[20] = ICE_FDIR_IPV4_PKT_FLAG_MF; break; case ICE_FLTR_PTYPE_NONF_IPV4_UDP: ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index 6573f96bc1..b679a8a1bd 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -83,12 +83,20 @@ #define ICE_FDIR_MAX_FLTRS 16384 -/* IP v4 has 2 flag bits that enable fragment processing: DF and MF. DF +/* IPv4 has 2 flag bits that enable fragment processing: DF and MF. DF * requests that the packet not be fragmented. MF indicates that a packet has - * been fragmented. + * been fragmented, except that for the last fragment has a non-zero + * Fragment Offset field with zero MF. */ -#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x20 -#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x40 +#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x20 +#define ICE_FDIR_IPV4_PKT_FLAG_MF_SHIFT 8 +#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x40 + +/* For IPv6 fragmented packets, all fragments except the last have + * the MF flag set. + */ +#define ICE_FDIR_IPV6_PKT_FLAG_MF 0x100 +#define ICE_FDIR_IPV6_PKT_FLAG_MF_SHIFT 8 enum ice_fltr_prgm_desc_dest { ICE_FLTR_PRGM_DESC_DEST_DROP_PKT,