net/ice/base: add profile validation on switch filter
[dpdk.git] / drivers / net / ice / base / ice_flow.h
index 40a75f5..f941ce4 100644 (file)
 #define ICE_FLOW_HASH_NAT_T_ESP_IPV6_SPI \
        (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_NAT_T_ESP_SPI)
 
+#define ICE_FLOW_FIELD_IPV4_SRC_OFFSET 12
+#define ICE_FLOW_FIELD_IPV4_DST_OFFSET 16
+#define ICE_FLOW_FIELD_IPV6_SRC_OFFSET 8
+#define ICE_FLOW_FIELD_IPV6_DST_OFFSET 24
+#define ICE_FLOW_FIELD_SRC_PORT_OFFSET 0
+#define ICE_FLOW_FIELD_DST_PORT_OFFSET 2
+
 /* Protocol header fields within a packet segment. A segment consists of one or
  * more protocol headers that make up a logical group of protocol headers. Each
  * logical group of protocol headers encapsulates or is encapsulated using/by
@@ -185,10 +192,13 @@ enum ice_flow_seg_hdr {
        ICE_FLOW_SEG_HDR_VXLAN          = 0x02000000,
        ICE_FLOW_SEG_HDR_ECPRI_TP0      = 0x04000000,
        ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0  = 0x08000000,
+       ICE_FLOW_SEG_HDR_L2TPV2         = 0x10000000,
+       ICE_FLOW_SEG_HDR_PPP            = 0x20000000,
        /* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and
-        * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs
+        * ICE_FLOW_SEG_HDR_IPV6.
         */
-       ICE_FLOW_SEG_HDR_IPV_OTHER      = 0x20000000,
+       ICE_FLOW_SEG_HDR_IPV_FRAG       = 0x40000000,
+       ICE_FLOW_SEG_HDR_IPV_OTHER      = 0x80000000,
 };
 
 /* These segements all have the same PTYPES, but are otherwise distinguished by
@@ -225,6 +235,9 @@ enum ice_flow_field {
        ICE_FLOW_FIELD_IDX_IPV4_DA,
        ICE_FLOW_FIELD_IDX_IPV6_SA,
        ICE_FLOW_FIELD_IDX_IPV6_DA,
+       ICE_FLOW_FIELD_IDX_IPV4_CHKSUM,
+       ICE_FLOW_FIELD_IDX_IPV4_ID,
+       ICE_FLOW_FIELD_IDX_IPV6_ID,
        ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA,
        ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA,
        ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA,
@@ -239,6 +252,9 @@ enum ice_flow_field {
        ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT,
        ICE_FLOW_FIELD_IDX_SCTP_DST_PORT,
        ICE_FLOW_FIELD_IDX_TCP_FLAGS,
+       ICE_FLOW_FIELD_IDX_TCP_CHKSUM,
+       ICE_FLOW_FIELD_IDX_UDP_CHKSUM,
+       ICE_FLOW_FIELD_IDX_SCTP_CHKSUM,
        /* ARP */
        ICE_FLOW_FIELD_IDX_ARP_SIP,
        ICE_FLOW_FIELD_IDX_ARP_DIP,
@@ -259,8 +275,10 @@ enum ice_flow_field {
        ICE_FLOW_FIELD_IDX_GTPU_EH_QFI,
        /* GTPU_UP */
        ICE_FLOW_FIELD_IDX_GTPU_UP_TEID,
+       ICE_FLOW_FIELD_IDX_GTPU_UP_QFI,
        /* GTPU_DWN */
        ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID,
+       ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI,
        /* PPPOE */
        ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID,
        /* PFCP */
@@ -343,6 +361,10 @@ enum ice_rss_cfg_hdr_type {
        /* take inner headers as inputset for packet with outer ipv6. */
        ICE_RSS_INNER_HEADERS_W_OUTER_IPV6,
        /* take outer headers first then inner headers as inputset */
+       /* take inner as inputset for GTPoGRE with outer ipv4 + gre. */
+       ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE,
+       /* take inner as inputset for GTPoGRE with outer ipv6 + gre. */
+       ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE,
        ICE_RSS_ANY_HEADERS
 };
 
@@ -478,11 +500,18 @@ struct ice_flow_prof {
        struct ice_flow_action *acts;
 };
 
+struct ice_rss_raw_cfg {
+       struct ice_parser_profile prof;
+       bool raw_ena;
+       bool symm;
+};
+
 struct ice_rss_cfg {
        struct LIST_ENTRY_TYPE l_entry;
        /* bitmap of VSIs added to the RSS entry */
        ice_declare_bitmap(vsis, ICE_MAX_VSI);
        struct ice_rss_hash_cfg hash;
+       struct ice_rss_raw_cfg raw;
 };
 
 enum ice_flow_action_type {
@@ -533,6 +562,10 @@ enum ice_status
 ice_flow_assoc_vsig_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle,
                        u16 vsig);
 enum ice_status
+ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle,
+                    u16 fdir_vsi_handle, struct ice_parser_profile *prof,
+                    enum ice_block blk);
+enum ice_status
 ice_flow_get_hw_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id,
                     u8 *hw_prof);
 
@@ -566,5 +599,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle,
 enum ice_status
 ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle,
                const struct ice_rss_hash_cfg *cfg);
+void ice_rss_update_raw_symm(struct ice_hw *hw,
+                            struct ice_rss_raw_cfg *cfg, u64 id);
 u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs);
 #endif /* _ICE_FLOW_H_ */