net/txgbe: support ntuple filter add and delete
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.h
index a249c29..ee85c9d 100644 (file)
@@ -437,6 +437,7 @@ struct mlx5_flow_dv_tag_resource {
        /**< Tag action object. */
        uint32_t refcnt; /**< Reference counter. */
        uint32_t idx; /**< Index for the index memory pool. */
+       uint32_t tag_id; /**< Tag ID. */
 };
 
 /*
@@ -509,6 +510,7 @@ struct mlx5_flow_mreg_copy_resource {
        /* List entry for device flows. */
        uint32_t idx;
        uint32_t rix_flow; /* Built flow for copy. */
+       uint32_t mark_id;
 };
 
 /* Table tunnel parameter. */
@@ -532,9 +534,13 @@ struct mlx5_flow_tbl_data_entry {
        /**< tunnel offload */
        const struct mlx5_flow_tunnel *tunnel;
        uint32_t group_id;
-       bool external;
-       bool tunnel_offload; /* Tunnel offlod table or not. */
-       bool is_egress; /**< Egress table. */
+       uint32_t external:1;
+       uint32_t tunnel_offload:1; /* Tunnel offlod table or not. */
+       uint32_t is_egress:1; /**< Egress table. */
+       uint32_t is_transfer:1; /**< Transfer table. */
+       uint32_t dummy:1; /**<  DR table. */
+       uint32_t reserve:27; /**< Reserved to future using. */
+       uint32_t table_id; /**< Table ID. */
 };
 
 /* Sub rdma-core actions list. */
@@ -594,12 +600,6 @@ struct mlx5_flow_dv_dest_array_resource {
        /**< Action resources. */
 };
 
-/* Verbs specification header. */
-struct ibv_spec_header {
-       enum ibv_flow_spec_type type;
-       uint16_t size;
-};
-
 /* PMD flow priority for tunnel */
 #define MLX5_TUNNEL_PRIO_GET(rss_desc) \
        ((rss_desc)->level >= 2 ? MLX5_PRIORITY_MAP_L2 : MLX5_PRIORITY_MAP_L4)
@@ -646,7 +646,7 @@ struct mlx5_flow_handle {
                uint32_t rix_srss;
                /**< Indicates shared RSS fate action. */
        };
-#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
        struct mlx5_flow_handle_dv dvh;
 #endif
 } __rte_packed;
@@ -656,7 +656,7 @@ struct mlx5_flow_handle {
  * structure in Verbs. No DV flows attributes will be accessed.
  * Macro offsetof() could also be used here.
  */
-#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
 #define MLX5_FLOW_HANDLE_VERBS_SIZE \
        (sizeof(struct mlx5_flow_handle) - sizeof(struct mlx5_flow_handle_dv))
 #else
@@ -694,6 +694,7 @@ struct mlx5_flow_dv_workspace {
        /**< Pointer to the destination array resource. */
 };
 
+#ifdef HAVE_INFINIBAND_VERBS_H
 /*
  * Maximal Verbs flow specifications & actions size.
  * Some elements are mutually exclusive, but enough space should be allocated.
@@ -750,6 +751,7 @@ struct mlx5_flow_verbs_workspace {
        uint8_t specs[MLX5_VERBS_MAX_SPEC_ACT_SIZE];
        /**< Specifications & actions buffer of verbs flow. */
 };
+#endif /* HAVE_INFINIBAND_VERBS_H */
 
 /** Maximal number of device sub-flows supported. */
 #define MLX5_NUM_MAX_DEV_FLOWS 32
@@ -767,10 +769,12 @@ struct mlx5_flow {
        uint8_t skip_scale:1;
        /**< 1 if skip the scale the table with factor. */
        union {
-#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
                struct mlx5_flow_dv_workspace dv;
 #endif
+#ifdef HAVE_INFINIBAND_VERBS_H
                struct mlx5_flow_verbs_workspace verbs;
+#endif
        };
        struct mlx5_flow_handle *handle;
        uint32_t handle_idx; /* Index of the mlx5 flow handle memory. */
@@ -954,6 +958,8 @@ struct mlx5_flow_tunnel_hub {
 struct tunnel_tbl_entry {
        struct mlx5_hlist_entry hash;
        uint32_t flow_table;
+       uint32_t tunnel_id;
+       uint32_t group;
 };
 
 static inline uint32_t
@@ -1416,6 +1422,9 @@ int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh);
 /* Hash list callbacks for flow tables: */
 struct mlx5_hlist_entry *flow_dv_tbl_create_cb(struct mlx5_hlist *list,
                                               uint64_t key, void *entry_ctx);
+int flow_dv_tbl_match_cb(struct mlx5_hlist *list,
+                        struct mlx5_hlist_entry *entry, uint64_t key,
+                        void *cb_ctx);
 void flow_dv_tbl_remove_cb(struct mlx5_hlist *list,
                           struct mlx5_hlist_entry *entry);
 struct mlx5_flow_tbl_resource *flow_dv_tbl_resource_get(struct rte_eth_dev *dev,
@@ -1425,6 +1434,9 @@ struct mlx5_flow_tbl_resource *flow_dv_tbl_resource_get(struct rte_eth_dev *dev,
 
 struct mlx5_hlist_entry *flow_dv_tag_create_cb(struct mlx5_hlist *list,
                                               uint64_t key, void *cb_ctx);
+int flow_dv_tag_match_cb(struct mlx5_hlist *list,
+                        struct mlx5_hlist_entry *entry, uint64_t key,
+                        void *cb_ctx);
 void flow_dv_tag_remove_cb(struct mlx5_hlist *list,
                           struct mlx5_hlist_entry *entry);
 
@@ -1438,6 +1450,9 @@ void flow_dv_modify_remove_cb(struct mlx5_hlist *list,
 
 struct mlx5_hlist_entry *flow_dv_mreg_create_cb(struct mlx5_hlist *list,
                                                uint64_t key, void *ctx);
+int flow_dv_mreg_match_cb(struct mlx5_hlist *list,
+                         struct mlx5_hlist_entry *entry, uint64_t key,
+                         void *cb_ctx);
 void flow_dv_mreg_remove_cb(struct mlx5_hlist *list,
                            struct mlx5_hlist_entry *entry);