common/mlx5: fix name for ConnectX VF device ID
[dpdk.git] / drivers / net / mlx5 / mlx5_rxtx.h
index 2ca0a47..2988554 100644 (file)
@@ -14,7 +14,6 @@
 #include <rte_mempool.h>
 #include <rte_common.h>
 #include <rte_hexdump.h>
-#include <rte_atomic.h>
 #include <rte_spinlock.h>
 #include <rte_io.h>
 #include <rte_bus_pci.h>
@@ -101,6 +100,13 @@ enum mlx5_rqx_code {
        MLX5_RXQ_CODE_DROPPED,
 };
 
+struct mlx5_eth_rxseg {
+       struct rte_mempool *mp; /**< Memory pool to allocate segment from. */
+       uint16_t length; /**< Segment data length, configures split point. */
+       uint16_t offset; /**< Data offset from beginning of mbuf data buffer. */
+       uint32_t reserved; /**< Reserved field. */
+};
+
 /* RX queue descriptor. */
 struct mlx5_rxq_data {
        unsigned int csum:1; /* Enable checksum offloading. */
@@ -120,6 +126,7 @@ struct mlx5_rxq_data {
        unsigned int strd_scatter_en:1; /* Scattered packets from a stride. */
        unsigned int lro:1; /* Enable LRO. */
        unsigned int dynf_meta:1; /* Dynamic metadata is configured. */
+       unsigned int mcqe_format:3; /* Dynamic metadata is configured. */
        volatile uint32_t *rq_db;
        volatile uint32_t *cq_db;
        uint16_t port_id;
@@ -129,6 +136,7 @@ struct mlx5_rxq_data {
        uint32_t rq_pi;
        uint32_t cq_ci;
        uint16_t rq_repl_thresh; /* Threshold for buffer replenishment. */
+       uint32_t byte_mask;
        union {
                struct rxq_zip zip; /* Compressed context. */
                uint16_t decompressed;
@@ -160,6 +168,9 @@ struct mlx5_rxq_data {
        uint64_t timestamp_rx_flag; /* Dynamic mbuf flag for timestamp. */
        uint64_t flow_meta_mask;
        int32_t flow_meta_offset;
+       uint32_t rxseg_n; /* Number of split segment descriptions. */
+       struct mlx5_eth_rxseg rxseg[MLX5_MAX_RXQ_NSEG];
+       /* Buffer split segment descriptions - sizes, offsets, pools. */
 } __rte_cache_aligned;
 
 enum mlx5_rxq_type {
@@ -191,6 +202,7 @@ struct mlx5_rxq_ctrl {
        void *wq_umem; /* WQ buffer registration info. */
        void *cq_umem; /* CQ buffer registration info. */
        struct rte_eth_hairpin_conf hairpin_conf; /* Hairpin configuration. */
+       uint32_t hairpin_status; /* Hairpin binding status. */
 };
 
 /* TX queue send local data. */
@@ -287,6 +299,7 @@ struct mlx5_txq_ctrl {
        void *bf_reg; /* BlueFlame register from Verbs. */
        uint16_t dump_file_n; /* Number of dump files. */
        struct rte_eth_hairpin_conf hairpin_conf; /* Hairpin configuration. */
+       uint32_t hairpin_status; /* Hairpin binding status. */
        struct mlx5_txq_data txq; /* Data path structure. */
        /* Must be the last field in the structure, contains elts[]. */
 };
@@ -323,7 +336,8 @@ int mlx5_rxq_obj_verify(struct rte_eth_dev *dev);
 struct mlx5_rxq_ctrl *mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx,
                                   uint16_t desc, unsigned int socket,
                                   const struct rte_eth_rxconf *conf,
-                                  struct rte_mempool *mp);
+                                  const struct rte_eth_rxseg_split *rx_seg,
+                                  uint16_t n_seg);
 struct mlx5_rxq_ctrl *mlx5_rxq_hairpin_new
        (struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
         const struct rte_eth_hairpin_conf *hairpin_conf);
@@ -336,19 +350,24 @@ struct mlx5_ind_table_obj *mlx5_ind_table_obj_get(struct rte_eth_dev *dev,
                                                  const uint16_t *queues,
                                                  uint32_t queues_n);
 int mlx5_ind_table_obj_release(struct rte_eth_dev *dev,
-                              struct mlx5_ind_table_obj *ind_tbl);
-uint32_t mlx5_hrxq_new(struct rte_eth_dev *dev,
-                      const uint8_t *rss_key, uint32_t rss_key_len,
-                      uint64_t hash_fields,
-                      const uint16_t *queues, uint32_t queues_n,
-                      int tunnel, bool shared);
+                              struct mlx5_ind_table_obj *ind_tbl,
+                              bool standalone);
+struct mlx5_cache_entry *mlx5_hrxq_create_cb(struct mlx5_cache_list *list,
+               struct mlx5_cache_entry *entry __rte_unused, void *cb_ctx);
+int mlx5_hrxq_match_cb(struct mlx5_cache_list *list,
+                      struct mlx5_cache_entry *entry,
+                      void *cb_ctx);
+void mlx5_hrxq_remove_cb(struct mlx5_cache_list *list,
+                        struct mlx5_cache_entry *entry);
 uint32_t mlx5_hrxq_get(struct rte_eth_dev *dev,
-                      const uint8_t *rss_key, uint32_t rss_key_len,
-                      uint64_t hash_fields,
-                      const uint16_t *queues, uint32_t queues_n);
+                      struct mlx5_flow_rss_desc *rss_desc);
 int mlx5_hrxq_release(struct rte_eth_dev *dev, uint32_t hxrq_idx);
-int mlx5_hrxq_verify(struct rte_eth_dev *dev);
+uint32_t mlx5_hrxq_verify(struct rte_eth_dev *dev);
+
+
 enum mlx5_rxq_type mlx5_rxq_get_type(struct rte_eth_dev *dev, uint16_t idx);
+const struct rte_eth_hairpin_conf *mlx5_rxq_get_hairpin_conf
+       (struct rte_eth_dev *dev, uint16_t idx);
 struct mlx5_hrxq *mlx5_drop_action_create(struct rte_eth_dev *dev);
 void mlx5_drop_action_destroy(struct rte_eth_dev *dev);
 uint64_t mlx5_get_rx_port_offloads(void);
@@ -664,8 +683,8 @@ mlx5_txpp_convert_tx_ts(struct mlx5_dev_ctx_shared *sh, uint64_t mts)
                 * the service thread, data should be re-read.
                 */
                rte_compiler_barrier();
-               ci = rte_atomic64_read(&sh->txpp.ts.ci_ts);
-               ts = rte_atomic64_read(&sh->txpp.ts.ts);
+               ci = __atomic_load_n(&sh->txpp.ts.ci_ts, __ATOMIC_RELAXED);
+               ts = __atomic_load_n(&sh->txpp.ts.ts, __ATOMIC_RELAXED);
                rte_compiler_barrier();
                if (!((ts ^ ci) << (64 - MLX5_CQ_INDEX_WIDTH)))
                        break;
@@ -675,7 +694,8 @@ mlx5_txpp_convert_tx_ts(struct mlx5_dev_ctx_shared *sh, uint64_t mts)
        mts -= ts;
        if (unlikely(mts >= UINT64_MAX / 2)) {
                /* We have negative integer, mts is in the past. */
-               rte_atomic32_inc(&sh->txpp.err_ts_past);
+               __atomic_fetch_add(&sh->txpp.err_ts_past,
+                                  1, __ATOMIC_RELAXED);
                return -1;
        }
        tick = sh->txpp.tick;
@@ -684,7 +704,8 @@ mlx5_txpp_convert_tx_ts(struct mlx5_dev_ctx_shared *sh, uint64_t mts)
        mts = (mts + tick - 1) / tick;
        if (unlikely(mts >= (1 << MLX5_CQ_INDEX_WIDTH) / 2 - 1)) {
                /* We have mts is too distant future. */
-               rte_atomic32_inc(&sh->txpp.err_ts_future);
+               __atomic_fetch_add(&sh->txpp.err_ts_future,
+                                  1, __ATOMIC_RELAXED);
                return -1;
        }
        mts <<= 64 - MLX5_CQ_INDEX_WIDTH;