net/ice: fix fast mbuf freeing
[dpdk.git] / drivers / net / mlx5 / mlx5.h
index 2e93dda..c9bc45c 100644 (file)
@@ -491,12 +491,18 @@ struct mlx5_aso_devx_mr {
 };
 
 struct mlx5_aso_sq_elem {
-       struct mlx5_aso_age_pool *pool;
-       uint16_t burst_size;
+       union {
+               struct {
+                       struct mlx5_aso_age_pool *pool;
+                       uint16_t burst_size;
+               };
+               struct mlx5_aso_mtr *mtr;
+       };
 };
 
 struct mlx5_aso_sq {
        uint16_t log_desc_n;
+       rte_spinlock_t sqsl;
        struct mlx5_aso_cq cq;
        struct mlx5_devx_sq sq_obj;
        volatile uint64_t *uar_addr;
@@ -587,14 +593,6 @@ struct mlx5_dev_shared_port {
 /* Modify this value if enum rte_mtr_color changes. */
 #define RTE_MTR_DROPPED RTE_COLORS
 
-/* Meter policer statistics */
-struct mlx5_flow_policer_stats {
-       uint32_t pass_cnt;
-       /**< Color counter for pass. */
-       uint32_t drop_cnt;
-       /**< Color counter for drop. */
-};
-
 /* Meter table structure. */
 struct mlx5_meter_domain_info {
        struct mlx5_flow_tbl_resource *tbl;
@@ -629,30 +627,16 @@ struct mlx5_meter_domains_infos {
        /**< Counters for green rule. */
        void *drop_count;
        /**< Counters for green rule. */
-       void *meter_action;
-       /**< Flow meter action. */
 };
 
 /* Meter parameter structure. */
 struct mlx5_flow_meter_info {
-       uint32_t meter_id;
-       /**< Meter id. */
        struct mlx5_flow_meter_profile *profile;
        /**< Meter profile parameters. */
        rte_spinlock_t sl; /**< Meter action spinlock. */
-       /** Policer actions (per meter output color). */
-       enum rte_mtr_policer_action action[RTE_COLORS];
        /** Set of stats counters to be enabled.
         * @see enum rte_mtr_stats_type
         */
-       uint32_t green_bytes:1;
-       /** Set green bytes stats to be enabled. */
-       uint32_t green_pkts:1;
-       /** Set green packets stats to be enabled. */
-       uint32_t red_bytes:1;
-       /** Set red bytes stats to be enabled. */
-       uint32_t red_pkts:1;
-       /** Set red packets stats to be enabled. */
        uint32_t bytes_dropped:1;
        /** Set bytes dropped stats to be enabled. */
        uint32_t pkts_dropped:1;
@@ -687,12 +671,14 @@ struct mlx5_flow_meter_info {
        uint32_t transfer:1;
        struct mlx5_meter_domains_infos *mfts;
        /**< Flow table created for this meter. */
-       struct mlx5_flow_policer_stats policer_stats;
-       /**< Meter policer statistics. */
+       uint32_t drop_cnt;
+       /**< Color counter for drop. */
        uint32_t ref_cnt;
        /**< Use count. */
        struct mlx5_indexed_pool *flow_ipool;
        /**< Index pool for flow id. */
+       void *meter_action;
+       /**< Flow meter action. */
 };
 
 /* RFC2697 parameter structure. */
@@ -764,7 +750,6 @@ struct mlx5_aso_mtr_pools_mng {
        volatile uint16_t n_valid; /* Number of valid pools. */
        uint16_t n; /* Number of pools. */
        rte_spinlock_t mtrsl; /* The ASO flow meter free list lock. */
-       struct mlx5_l3t_tbl *mtr_idx_tbl; /* Meter index lookup table. */
        struct aso_meter_list meters; /* Free ASO flow meter list. */
        struct mlx5_aso_sq sq; /*SQ using by ASO flow meter. */
        struct mlx5_aso_mtr_pool **pools; /* ASO flow meter pool array. */
@@ -774,10 +759,12 @@ struct mlx5_aso_mtr_pools_mng {
 union mlx5_flow_tbl_key {
        struct {
                /* Table ID should be at the lowest address. */
-               uint32_t table_id;      /**< ID of the table. */
-               uint16_t dummy;         /**< Dummy table for DV API. */
-               uint8_t domain;         /**< 1 - FDB, 0 - NIC TX/RX. */
-               uint8_t direction;      /**< 1 - egress, 0 - ingress. */
+               uint32_t level; /**< Level of the table. */
+               uint32_t id:22; /**< ID of the table. */
+               uint32_t dummy:1;       /**< Dummy table for DV API. */
+               uint32_t is_fdb:1;      /**< 1 - FDB, 0 - NIC TX/RX. */
+               uint32_t is_egress:1;   /**< 1 - egress, 0 - ingress. */
+               uint32_t reserved:7;    /**< must be zero for comparison. */
        };
        uint64_t v64;                   /**< full 64bits value of key */
 };
@@ -1195,6 +1182,7 @@ struct mlx5_priv {
        uint8_t mtr_color_reg; /* Meter color match REG_C. */
        struct mlx5_mtr_profiles flow_meter_profiles; /* MTR profile list. */
        struct mlx5_legacy_flow_meters flow_meters; /* MTR list. */
+       struct mlx5_l3t_tbl *mtr_idx_tbl; /* Meter index lookup table. */
        uint8_t skip_default_rss_reta; /* Skip configuration of default reta. */
        uint8_t fdb_def_rule; /* Whether fdb jump to table 1 is configured. */
        struct mlx5_mp_id mp_id; /* ID of a multi-process process */
@@ -1258,6 +1246,7 @@ int mlx5_hairpin_cap_get(struct rte_eth_dev *dev,
 bool mlx5_flex_parser_ecpri_exist(struct rte_eth_dev *dev);
 int mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev);
 int mlx5_flow_aso_age_mng_init(struct mlx5_dev_ctx_shared *sh);
+int mlx5_aso_flow_mtrs_mng_init(struct mlx5_priv *priv);
 
 /* mlx5_ethdev.c */
 
@@ -1481,7 +1470,8 @@ int mlx5_flow_meter_attach(struct mlx5_priv *priv,
                           struct mlx5_flow_meter_info *fm,
                           const struct rte_flow_attr *attr,
                           struct rte_flow_error *error);
-void mlx5_flow_meter_detach(struct mlx5_flow_meter_info *fm);
+void mlx5_flow_meter_detach(struct mlx5_priv *priv,
+                           struct mlx5_flow_meter_info *fm);
 
 /* mlx5_os.c */
 struct rte_pci_driver;
@@ -1528,9 +1518,15 @@ eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev);
 
 /* mlx5_flow_aso.c */
 
-int mlx5_aso_queue_init(struct mlx5_dev_ctx_shared *sh);
-int mlx5_aso_queue_start(struct mlx5_dev_ctx_shared *sh);
-int mlx5_aso_queue_stop(struct mlx5_dev_ctx_shared *sh);
-void mlx5_aso_queue_uninit(struct mlx5_dev_ctx_shared *sh);
+int mlx5_aso_queue_init(struct mlx5_dev_ctx_shared *sh,
+               enum mlx5_access_aso_opc_mod aso_opc_mod);
+int mlx5_aso_flow_hit_queue_poll_start(struct mlx5_dev_ctx_shared *sh);
+int mlx5_aso_flow_hit_queue_poll_stop(struct mlx5_dev_ctx_shared *sh);
+void mlx5_aso_queue_uninit(struct mlx5_dev_ctx_shared *sh,
+               enum mlx5_access_aso_opc_mod aso_opc_mod);
+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);
 
 #endif /* RTE_PMD_MLX5_H_ */