net/ice/base: add non-word aligned IPv4 field support
[dpdk.git] / drivers / net / ice / base / ice_fdir.h
index 2ecb147..e817057 100644 (file)
@@ -58,7 +58,8 @@ enum ice_status ice_clear_pf_fd_table(struct ice_hw *hw);
 #define ICE_IP_PROTO_IP                        0
 #define ICE_IP_PROTO_ESP               50
 
-#define ICE_FDIR_MAX_RAW_PKT_SIZE      512
+#define ICE_FDIR_TUN_PKT_OFF           50
+#define ICE_FDIR_MAX_RAW_PKT_SIZE      (512 + ICE_FDIR_TUN_PKT_OFF)
 #define ICE_FDIR_BUF_FULL_MARGIN       10
 #define ICE_FDIR_BUF_HEAD_ROOM         32
 
@@ -81,6 +82,9 @@ enum ice_status ice_clear_pf_fd_table(struct ice_hw *hw);
 #define ICE_IPV6_SCTP_SRC_PORT_OFFSET  54
 #define ICE_IPV6_SCTP_DST_PORT_OFFSET  56
 
+#define ICE_IPV4_TOS_OFFSET            15
+#define ICE_IPV4_TTL_OFFSET            22
+
 #define ICE_FDIR_MAX_FLTRS             16384
 
 /* IP v4 has 2 flag bits that enable fragment processing: DF and MF. DF
@@ -122,6 +126,7 @@ struct ice_fdir_v4 {
        u8 tos;
        u8 ip_ver;
        u8 proto;
+       u8 ttl;
 };
 
 #define ICE_IPV6_ADDR_LEN_AS_U32               4
@@ -163,9 +168,6 @@ struct ice_fdir_fltr {
 
        /* filter control */
        u16 q_index;
-#ifdef ADQ_SUPPORT
-       u16 orig_q_index;
-#endif /* ADQ_SUPPORT */
        u16 dest_vsi;
        u8 dest_ctl;
        u8 fltr_status;
@@ -173,18 +175,22 @@ struct ice_fdir_fltr {
        u32 fltr_id;
 };
 
-
 /* Dummy packet filter definition structure. */
 struct ice_fdir_base_pkt {
        enum ice_fltr_ptype flow;
        u16 pkt_len;
        const u8 *pkt;
+       u16 tun_pkt_len;
+       const u8 *tun_pkt;
 };
 
 void
 ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
                       struct ice_fltr_desc *fdesc, bool add);
 enum ice_status
+ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
+                         u8 *pkt, bool frag, bool tun);
+enum ice_status
 ice_fdir_get_prgm_pkt(struct ice_fdir_fltr *input, u8 *pkt, bool frag);
 enum ice_status
 ice_add_del_fdir(struct ice_hw *hw, struct ice_fdir_fltr *input, bool add);