net/ice/base: enable more GTPU inner L3 fields for FDIR
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 2 Mar 2021 07:23:49 +0000 (15:23 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 5 Mar 2021 08:27:34 +0000 (09:27 +0100)
Add support for FDIR filter by GTPU inner L3 fields
(i.e., tos, ttl, proto).

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_fdir.c
drivers/net/ice/base/ice_fdir.h

index 2c479df..3df3de1 100644 (file)
@@ -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:
index e8af2bb..e236f13 100644 (file)
@@ -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