net/mlx5: fix Tx queue doorbell record field offset
[dpdk.git] / drivers / net / mlx5 / mlx5.h
index 0ff7b8c..7eca6a6 100644 (file)
@@ -493,6 +493,10 @@ struct mlx5_aso_sq_elem {
                        uint16_t burst_size;
                };
                struct mlx5_aso_mtr *mtr;
+               struct {
+                       struct mlx5_aso_ct_action *ct;
+                       char *query_data;
+               };
        };
 };
 
@@ -991,6 +995,10 @@ struct mlx5_bond_info {
 /* Number of connection tracking objects per pool: must be a power of 2. */
 #define MLX5_ASO_CT_ACTIONS_PER_POOL 64
 
+/* Generate incremental and unique CT index from pool and offset. */
+#define MLX5_MAKE_CT_IDX(pool, offset) \
+       ((pool) * MLX5_ASO_CT_ACTIONS_PER_POOL + (offset) + 1)
+
 /* ASO Conntrack state. */
 enum mlx5_aso_ct_state {
        ASO_CONNTRACK_FREE, /* Inactive, in the free list. */
@@ -1012,6 +1020,10 @@ struct mlx5_aso_ct_action {
        bool is_original; /* The direction of the DR action to be used. */
 };
 
+/* CT action object state update. */
+#define MLX5_ASO_CT_UPDATE_STATE(c, s) \
+       __atomic_store_n(&((c)->state), (s), __ATOMIC_RELAXED)
+
 /* ASO connection tracking software pool definition. */
 struct mlx5_aso_ct_pool {
        uint16_t index; /* Pool index in pools array. */
@@ -1604,6 +1616,10 @@ int mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow,
 void mlx5_flow_rxq_dynf_metadata_set(struct rte_eth_dev *dev);
 int mlx5_flow_get_aged_flows(struct rte_eth_dev *dev, void **contexts,
                        uint32_t nb_contexts, struct rte_flow_error *error);
+int mlx5_validate_action_ct(struct rte_eth_dev *dev,
+                           const struct rte_flow_action_conntrack *conntrack,
+                           struct rte_flow_error *error);
+
 
 /* mlx5_mp_os.c */
 
@@ -1695,5 +1711,15 @@ int mlx5_aso_meter_update_by_wqe(struct mlx5_dev_ctx_shared *sh,
                struct mlx5_aso_mtr *mtr);
 int mlx5_aso_mtr_wait(struct mlx5_dev_ctx_shared *sh,
                struct mlx5_aso_mtr *mtr);
+int mlx5_aso_ct_update_by_wqe(struct mlx5_dev_ctx_shared *sh,
+                             struct mlx5_aso_ct_action *ct,
+                             const struct rte_flow_action_conntrack *profile);
+int mlx5_aso_ct_wait_ready(struct mlx5_dev_ctx_shared *sh,
+                          struct mlx5_aso_ct_action *ct);
+int mlx5_aso_ct_query_by_wqe(struct mlx5_dev_ctx_shared *sh,
+                            struct mlx5_aso_ct_action *ct,
+                            struct rte_flow_action_conntrack *profile);
+int mlx5_aso_ct_available(struct mlx5_dev_ctx_shared *sh,
+                         struct mlx5_aso_ct_action *ct);
 
 #endif /* RTE_PMD_MLX5_H_ */