From: Qi Zhang Date: Tue, 2 Mar 2021 07:23:49 +0000 (+0800) Subject: net/ice/base: enable more GTPU inner L3 fields for FDIR X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2fcb1dc9547b398c6d3348fa7b6e00fedde8a525;p=dpdk.git net/ice/base: enable more GTPU inner L3 fields for FDIR Add support for FDIR filter by GTPU inner L3 fields (i.e., tos, ttl, proto). Signed-off-by: Junfeng 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 2c479dfbd4..3df3de1bdb 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -1528,6 +1528,10 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v4.src_ip); ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, input->ip.v4.dst_ip); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_PROTO_OFFSET, + input->ip.v4.proto); break; case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW: @@ -1553,6 +1557,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v4.dst_ip); ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_SRC_PORT_OFFSET, input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); break; case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_TCP: @@ -1566,6 +1572,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v4.dst_ip); ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_SRC_PORT_OFFSET, input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); break; case ICE_FLTR_PTYPE_NONF_IPV6_GTPU: case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index e8af2bb0e5..e236f13f05 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -47,6 +47,9 @@ #define ICE_IPV6_HLIM_OFFSET 21 #define ICE_IPV6_PROTO_OFFSET 20 /* For TUN inner (without inner MAC) */ +#define ICE_IPV4_NO_MAC_TOS_OFFSET 1 +#define ICE_IPV4_NO_MAC_TTL_OFFSET 8 +#define ICE_IPV4_NO_MAC_PROTO_OFFSET 9 #define ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET 12 #define ICE_IPV4_NO_MAC_DST_ADDR_OFFSET 16 #define ICE_TCP4_NO_MAC_SRC_PORT_OFFSET 20