net/bnxt: modify VXLAN decap for multichannel mode
[dpdk.git] / drivers / net / mlx5 / mlx5.h
index 0f2a26e..32b2817 100644 (file)
@@ -287,6 +287,13 @@ struct mlx5_drop {
        struct mlx5_rxq_obj *rxq; /* Rx queue object. */
 };
 
+/* Loopback dummy queue resources required due to Verbs API. */
+struct mlx5_lb_ctx {
+       struct ibv_qp *qp; /* QP object. */
+       void *ibv_cq; /* Completion queue. */
+       uint16_t refcnt; /* Reference count for representors. */
+};
+
 #define MLX5_COUNTERS_PER_POOL 512
 #define MLX5_MAX_PENDING_QUERIES 4
 #define MLX5_CNT_CONTAINER_RESIZE 64
@@ -493,7 +500,10 @@ struct mlx5_aso_sq_elem {
                        uint16_t burst_size;
                };
                struct mlx5_aso_mtr *mtr;
-               struct mlx5_aso_ct_action *ct;
+               struct {
+                       struct mlx5_aso_ct_action *ct;
+                       char *query_data;
+               };
        };
 };
 
@@ -665,6 +675,8 @@ struct mlx5_meter_policy_action_container {
                /* Index to port ID action resource. */
                void *dr_jump_action[MLX5_MTR_DOMAIN_MAX];
                /* Jump/drop action per color. */
+               uint16_t queue;
+               /* Queue action configuration. */
        };
 };
 
@@ -678,6 +690,8 @@ struct mlx5_flow_meter_policy {
        /* Rule applies to egress domain. */
        uint32_t transfer:1;
        /* Rule applies to transfer domain. */
+       uint32_t is_queue:1;
+       /* Is queue action in policy table. */
        rte_spinlock_t sl;
        uint32_t ref_cnt;
        /* Use count. */
@@ -1121,6 +1135,7 @@ struct mlx5_dev_ctx_shared {
        /* Meter management structure. */
        struct mlx5_aso_ct_pools_mng *ct_mng;
        /* Management data for ASO connection tracking. */
+       struct mlx5_lb_ctx self_lb; /* QP to enable self loopback for Devx. */
        struct mlx5_dev_shared_port port[]; /* per device port data array. */
 };
 
@@ -1280,6 +1295,8 @@ struct mlx5_obj_ops {
        int (*txq_obj_modify)(struct mlx5_txq_obj *obj,
                              enum mlx5_txq_modify_type type, uint8_t dev_port);
        void (*txq_obj_release)(struct mlx5_txq_obj *txq_obj);
+       int (*lb_dummy_queue_create)(struct rte_eth_dev *dev);
+       void (*lb_dummy_queue_release)(struct rte_eth_dev *dev);
 };
 
 #define MLX5_RSS_HASH_FIELDS_LEN RTE_DIM(mlx5_rss_hash_fields)
@@ -1309,6 +1326,7 @@ struct mlx5_priv {
        unsigned int sampler_en:1; /* Whether support sampler. */
        unsigned int mtr_en:1; /* Whether support meter. */
        unsigned int mtr_reg_share:1; /* Whether support meter REG_C share. */
+       unsigned int lb_used:1; /* Loopback queue is referred to. */
        uint16_t domain_id; /* Switch domain identifier. */
        uint16_t vport_id; /* Associated VF vport index (if any). */
        uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */
@@ -1613,6 +1631,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 */
 
@@ -1648,6 +1670,7 @@ struct mlx5_flow_meter_policy *mlx5_flow_meter_policy_find
                uint32_t *policy_idx);
 int mlx5_flow_meter_flush(struct rte_eth_dev *dev,
                          struct rte_mtr_error *error);
+void mlx5_flow_meter_rxq_flush(struct rte_eth_dev *dev);
 
 /* mlx5_os.c */
 struct rte_pci_driver;
@@ -1707,5 +1730,12 @@ int mlx5_aso_mtr_wait(struct mlx5_dev_ctx_shared *sh,
 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_ */