net/mlx5: add queue and RSS HW steering action
[dpdk.git] / drivers / net / mlx5 / linux / mlx5_verbs.c
index 4779b37..b6ba21c 100644 (file)
@@ -16,6 +16,7 @@
 #include <rte_malloc.h>
 #include <ethdev_driver.h>
 #include <rte_common.h>
+#include <rte_eal_paging.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_common.h>
 /**
  * Modify Rx WQ vlan stripping offload
  *
- * @param rxq_obj
- *   Rx queue object.
+ * @param rxq
+ *   Rx queue.
  *
  * @return 0 on success, non-0 otherwise
  */
 static int
-mlx5_rxq_obj_modify_wq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)
+mlx5_rxq_obj_modify_wq_vlan_strip(struct mlx5_rxq_priv *rxq, int on)
 {
        uint16_t vlan_offloads =
                (on ? IBV_WQ_FLAGS_CVLAN_STRIPPING : 0) |
@@ -47,14 +48,14 @@ mlx5_rxq_obj_modify_wq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)
                .flags = vlan_offloads,
        };
 
-       return mlx5_glue->modify_wq(rxq_obj->wq, &mod);
+       return mlx5_glue->modify_wq(rxq->ctrl->obj->wq, &mod);
 }
 
 /**
  * Modifies the attributes for the specified WQ.
  *
- * @param rxq_obj
- *   Verbs Rx queue object.
+ * @param rxq
+ *   Verbs Rx queue.
  * @param type
  *   Type of change queue state.
  *
@@ -62,14 +63,14 @@ mlx5_rxq_obj_modify_wq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 static int
-mlx5_ibv_modify_wq(struct mlx5_rxq_obj *rxq_obj, uint8_t type)
+mlx5_ibv_modify_wq(struct mlx5_rxq_priv *rxq, uint8_t type)
 {
        struct ibv_wq_attr mod = {
                .attr_mask = IBV_WQ_ATTR_STATE,
                .wq_state = (enum ibv_wq_state)type,
        };
 
-       return mlx5_glue->modify_wq(rxq_obj->wq, &mod);
+       return mlx5_glue->modify_wq(rxq->ctrl->obj->wq, &mod);
 }
 
 /**
@@ -139,21 +140,18 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type,
 /**
  * Create a CQ Verbs object.
  *
- * @param dev
- *   Pointer to Ethernet device.
- * @param idx
- *   Queue index in DPDK Rx queue array.
+ * @param rxq
+ *   Pointer to Rx queue.
  *
  * @return
  *   The Verbs CQ object initialized, NULL otherwise and rte_errno is set.
  */
 static struct ibv_cq *
-mlx5_rxq_ibv_cq_create(struct rte_eth_dev *dev, uint16_t idx)
+mlx5_rxq_ibv_cq_create(struct mlx5_rxq_priv *rxq)
 {
-       struct mlx5_priv *priv = dev->data->dev_private;
-       struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];
-       struct mlx5_rxq_ctrl *rxq_ctrl =
-               container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
+       struct mlx5_priv *priv = rxq->priv;
+       struct mlx5_rxq_ctrl *rxq_ctrl = rxq->ctrl;
+       struct mlx5_rxq_data *rxq_data = &rxq_ctrl->rxq;
        struct mlx5_rxq_obj *rxq_obj = rxq_ctrl->obj;
        unsigned int cqe_n = mlx5_rxq_cqe_num(rxq_data);
        struct {
@@ -199,7 +197,7 @@ mlx5_rxq_ibv_cq_create(struct rte_eth_dev *dev, uint16_t idx)
                DRV_LOG(DEBUG,
                        "Port %u Rx CQE compression is disabled for HW"
                        " timestamp.",
-                       dev->data->port_id);
+                       priv->dev_data->port_id);
        }
 #ifdef HAVE_IBV_MLX5_MOD_CQE_128B_PAD
        if (RTE_CACHE_LINE_SIZE == 128) {
@@ -216,21 +214,18 @@ mlx5_rxq_ibv_cq_create(struct rte_eth_dev *dev, uint16_t idx)
 /**
  * Create a WQ Verbs object.
  *
- * @param dev
- *   Pointer to Ethernet device.
- * @param idx
- *   Queue index in DPDK Rx queue array.
+ * @param rxq
+ *   Pointer to Rx queue.
  *
  * @return
  *   The Verbs WQ object initialized, NULL otherwise and rte_errno is set.
  */
 static struct ibv_wq *
-mlx5_rxq_ibv_wq_create(struct rte_eth_dev *dev, uint16_t idx)
+mlx5_rxq_ibv_wq_create(struct mlx5_rxq_priv *rxq)
 {
-       struct mlx5_priv *priv = dev->data->dev_private;
-       struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];
-       struct mlx5_rxq_ctrl *rxq_ctrl =
-               container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
+       struct mlx5_priv *priv = rxq->priv;
+       struct mlx5_rxq_ctrl *rxq_ctrl = rxq->ctrl;
+       struct mlx5_rxq_data *rxq_data = &rxq_ctrl->rxq;
        struct mlx5_rxq_obj *rxq_obj = rxq_ctrl->obj;
        unsigned int wqe_n = 1 << rxq_data->elts_n;
        struct {
@@ -277,8 +272,8 @@ mlx5_rxq_ibv_wq_create(struct rte_eth_dev *dev, uint16_t idx)
 
                wq_attr.mlx5.comp_mask |= MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ;
                *mprq_attr = (struct mlx5dv_striding_rq_init_attr){
-                       .single_stride_log_num_of_bytes = rxq_data->strd_sz_n,
-                       .single_wqe_log_num_of_strides = rxq_data->strd_num_n,
+                       .single_stride_log_num_of_bytes = rxq_data->log_strd_sz,
+                       .single_wqe_log_num_of_strides = rxq_data->log_strd_num,
                        .two_byte_shift_en = MLX5_MPRQ_TWO_BYTE_SHIFT,
                };
        }
@@ -297,7 +292,7 @@ mlx5_rxq_ibv_wq_create(struct rte_eth_dev *dev, uint16_t idx)
                        DRV_LOG(ERR,
                                "Port %u Rx queue %u requested %u*%u but got"
                                " %u*%u WRs*SGEs.",
-                               dev->data->port_id, idx,
+                               priv->dev_data->port_id, rxq->idx,
                                wqe_n >> rxq_data->sges_n,
                                (1 << rxq_data->sges_n),
                                wq_attr.ibv.max_wr, wq_attr.ibv.max_sge);
@@ -312,21 +307,20 @@ mlx5_rxq_ibv_wq_create(struct rte_eth_dev *dev, uint16_t idx)
 /**
  * Create the Rx queue Verbs object.
  *
- * @param dev
- *   Pointer to Ethernet device.
- * @param idx
- *   Queue index in DPDK Rx queue array.
+ * @param rxq
+ *   Pointer to Rx queue.
  *
  * @return
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 static int
-mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
+mlx5_rxq_ibv_obj_new(struct mlx5_rxq_priv *rxq)
 {
-       struct mlx5_priv *priv = dev->data->dev_private;
-       struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];
-       struct mlx5_rxq_ctrl *rxq_ctrl =
-               container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
+       uint16_t idx = rxq->idx;
+       struct mlx5_priv *priv = rxq->priv;
+       uint16_t port_id = priv->dev_data->port_id;
+       struct mlx5_rxq_ctrl *rxq_ctrl = rxq->ctrl;
+       struct mlx5_rxq_data *rxq_data = &rxq_ctrl->rxq;
        struct mlx5_rxq_obj *tmpl = rxq_ctrl->obj;
        struct mlx5dv_cq cq_info;
        struct mlx5dv_rwq rwq;
@@ -341,17 +335,17 @@ mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
                        mlx5_glue->create_comp_channel(priv->sh->cdev->ctx);
                if (!tmpl->ibv_channel) {
                        DRV_LOG(ERR, "Port %u: comp channel creation failure.",
-                               dev->data->port_id);
+                               port_id);
                        rte_errno = ENOMEM;
                        goto error;
                }
                tmpl->fd = ((struct ibv_comp_channel *)(tmpl->ibv_channel))->fd;
        }
        /* Create CQ using Verbs API. */
-       tmpl->ibv_cq = mlx5_rxq_ibv_cq_create(dev, idx);
+       tmpl->ibv_cq = mlx5_rxq_ibv_cq_create(rxq);
        if (!tmpl->ibv_cq) {
                DRV_LOG(ERR, "Port %u Rx queue %u CQ creation failure.",
-                       dev->data->port_id, idx);
+                       port_id, idx);
                rte_errno = ENOMEM;
                goto error;
        }
@@ -366,7 +360,7 @@ mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
                DRV_LOG(ERR,
                        "Port %u wrong MLX5_CQE_SIZE environment "
                        "variable value: it should be set to %u.",
-                       dev->data->port_id, RTE_CACHE_LINE_SIZE);
+                       port_id, RTE_CACHE_LINE_SIZE);
                rte_errno = EINVAL;
                goto error;
        }
@@ -374,22 +368,25 @@ mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
        rxq_data->cqe_n = log2above(cq_info.cqe_cnt);
        rxq_data->cq_db = cq_info.dbrec;
        rxq_data->cqes = (volatile struct mlx5_cqe (*)[])(uintptr_t)cq_info.buf;
-       rxq_data->cq_uar = cq_info.cq_uar;
+       rxq_data->uar_data.db = RTE_PTR_ADD(cq_info.cq_uar, MLX5_CQ_DOORBELL);
+#ifndef RTE_ARCH_64
+       rxq_data->uar_data.sl_p = &priv->sh->uar_lock_cq;
+#endif
        rxq_data->cqn = cq_info.cqn;
        /* Create WQ (RQ) using Verbs API. */
-       tmpl->wq = mlx5_rxq_ibv_wq_create(dev, idx);
+       tmpl->wq = mlx5_rxq_ibv_wq_create(rxq);
        if (!tmpl->wq) {
                DRV_LOG(ERR, "Port %u Rx queue %u WQ creation failure.",
-                       dev->data->port_id, idx);
+                       port_id, idx);
                rte_errno = ENOMEM;
                goto error;
        }
        /* Change queue state to ready. */
-       ret = mlx5_ibv_modify_wq(tmpl, IBV_WQS_RDY);
+       ret = mlx5_ibv_modify_wq(rxq, IBV_WQS_RDY);
        if (ret) {
                DRV_LOG(ERR,
                        "Port %u Rx queue %u WQ state to IBV_WQS_RDY failed.",
-                       dev->data->port_id, idx);
+                       port_id, idx);
                rte_errno = ret;
                goto error;
        }
@@ -405,7 +402,7 @@ mlx5_rxq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
        rxq_data->cq_arm_sn = 0;
        mlx5_rxq_initialize(rxq_data);
        rxq_data->cq_ci = 0;
-       dev->data->rx_queue_state[idx] = RTE_ETH_QUEUE_STATE_STARTED;
+       priv->dev_data->rx_queue_state[idx] = RTE_ETH_QUEUE_STATE_STARTED;
        rxq_ctrl->wqn = ((struct ibv_wq *)(tmpl->wq))->wq_num;
        return 0;
 error:
@@ -423,20 +420,24 @@ error:
 /**
  * Release an Rx verbs queue object.
  *
- * @param rxq_obj
- *   Verbs Rx queue object.
+ * @param rxq
+ *   Pointer to Rx queue.
  */
 static void
-mlx5_rxq_ibv_obj_release(struct mlx5_rxq_obj *rxq_obj)
+mlx5_rxq_ibv_obj_release(struct mlx5_rxq_priv *rxq)
 {
-       MLX5_ASSERT(rxq_obj);
-       MLX5_ASSERT(rxq_obj->wq);
-       MLX5_ASSERT(rxq_obj->ibv_cq);
+       struct mlx5_rxq_obj *rxq_obj = rxq->ctrl->obj;
+
+       if (rxq_obj == NULL || rxq_obj->wq == NULL)
+               return;
        claim_zero(mlx5_glue->destroy_wq(rxq_obj->wq));
+       rxq_obj->wq = NULL;
+       MLX5_ASSERT(rxq_obj->ibv_cq);
        claim_zero(mlx5_glue->destroy_cq(rxq_obj->ibv_cq));
        if (rxq_obj->ibv_channel)
                claim_zero(mlx5_glue->destroy_comp_channel
                                                        (rxq_obj->ibv_channel));
+       rxq->ctrl->started = false;
 }
 
 /**
@@ -491,11 +492,10 @@ mlx5_ibv_ind_table_new(struct rte_eth_dev *dev, const unsigned int log_n,
 
        MLX5_ASSERT(ind_tbl);
        for (i = 0; i != ind_tbl->queues_n; ++i) {
-               struct mlx5_rxq_data *rxq = (*priv->rxqs)[ind_tbl->queues[i]];
-               struct mlx5_rxq_ctrl *rxq_ctrl =
-                               container_of(rxq, struct mlx5_rxq_ctrl, rxq);
+               struct mlx5_rxq_priv *rxq = mlx5_rxq_get(dev,
+                                                        ind_tbl->queues[i]);
 
-               wq[i] = rxq_ctrl->obj->wq;
+               wq[i] = rxq->ctrl->obj->wq;
        }
        MLX5_ASSERT(i > 0);
        /* Finalise indirection table. */
@@ -652,12 +652,24 @@ static void
 mlx5_rxq_ibv_obj_drop_release(struct rte_eth_dev *dev)
 {
        struct mlx5_priv *priv = dev->data->dev_private;
-       struct mlx5_rxq_obj *rxq = priv->drop_queue.rxq;
+       struct mlx5_rxq_priv *rxq = priv->drop_queue.rxq;
+       struct mlx5_rxq_obj *rxq_obj;
 
-       if (rxq->wq)
-               claim_zero(mlx5_glue->destroy_wq(rxq->wq));
-       if (rxq->ibv_cq)
-               claim_zero(mlx5_glue->destroy_cq(rxq->ibv_cq));
+       if (rxq == NULL)
+               return;
+       if (rxq->ctrl == NULL)
+               goto free_priv;
+       rxq_obj = rxq->ctrl->obj;
+       if (rxq_obj == NULL)
+               goto free_ctrl;
+       if (rxq_obj->wq)
+               claim_zero(mlx5_glue->destroy_wq(rxq_obj->wq));
+       if (rxq_obj->ibv_cq)
+               claim_zero(mlx5_glue->destroy_cq(rxq_obj->ibv_cq));
+       mlx5_free(rxq_obj);
+free_ctrl:
+       mlx5_free(rxq->ctrl);
+free_priv:
        mlx5_free(rxq);
        priv->drop_queue.rxq = NULL;
 }
@@ -676,39 +688,58 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
 {
        struct mlx5_priv *priv = dev->data->dev_private;
        struct ibv_context *ctx = priv->sh->cdev->ctx;
-       struct mlx5_rxq_obj *rxq = priv->drop_queue.rxq;
+       struct mlx5_rxq_priv *rxq = priv->drop_queue.rxq;
+       struct mlx5_rxq_ctrl *rxq_ctrl = NULL;
+       struct mlx5_rxq_obj *rxq_obj = NULL;
 
-       if (rxq)
+       if (rxq != NULL)
                return 0;
        rxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq), 0, SOCKET_ID_ANY);
-       if (!rxq) {
+       if (rxq == NULL) {
                DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue memory.",
                      dev->data->port_id);
                rte_errno = ENOMEM;
                return -rte_errno;
        }
        priv->drop_queue.rxq = rxq;
-       rxq->ibv_cq = mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0);
-       if (!rxq->ibv_cq) {
+       rxq_ctrl = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq_ctrl), 0,
+                              SOCKET_ID_ANY);
+       if (rxq_ctrl == NULL) {
+               DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue control memory.",
+                     dev->data->port_id);
+               rte_errno = ENOMEM;
+               goto error;
+       }
+       rxq->ctrl = rxq_ctrl;
+       rxq_obj = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq_obj), 0,
+                             SOCKET_ID_ANY);
+       if (rxq_obj == NULL) {
+               DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue memory.",
+                     dev->data->port_id);
+               rte_errno = ENOMEM;
+               goto error;
+       }
+       rxq_ctrl->obj = rxq_obj;
+       rxq_obj->ibv_cq = mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0);
+       if (!rxq_obj->ibv_cq) {
                DRV_LOG(DEBUG, "Port %u cannot allocate CQ for drop queue.",
                      dev->data->port_id);
                rte_errno = errno;
                goto error;
        }
-       rxq->wq = mlx5_glue->create_wq(ctx, &(struct ibv_wq_init_attr){
+       rxq_obj->wq = mlx5_glue->create_wq(ctx, &(struct ibv_wq_init_attr){
                                                    .wq_type = IBV_WQT_RQ,
                                                    .max_wr = 1,
                                                    .max_sge = 1,
                                                    .pd = priv->sh->cdev->pd,
-                                                   .cq = rxq->ibv_cq,
+                                                   .cq = rxq_obj->ibv_cq,
                                              });
-       if (!rxq->wq) {
+       if (!rxq_obj->wq) {
                DRV_LOG(DEBUG, "Port %u cannot allocate WQ for drop queue.",
                      dev->data->port_id);
                rte_errno = errno;
                goto error;
        }
-       priv->drop_queue.rxq = rxq;
        return 0;
 error:
        mlx5_rxq_ibv_obj_drop_release(dev);
@@ -737,7 +768,7 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
        ret = mlx5_rxq_ibv_obj_drop_create(dev);
        if (ret < 0)
                goto error;
-       rxq = priv->drop_queue.rxq;
+       rxq = priv->drop_queue.rxq->ctrl->obj;
        ind_tbl = mlx5_glue->create_rwq_ind_table
                                (priv->sh->cdev->ctx,
                                 &(struct ibv_rwq_ind_table_init_attr){
@@ -841,13 +872,12 @@ mlx5_txq_ibv_qp_create(struct rte_eth_dev *dev, uint16_t idx)
        /* CQ to be associated with the receive queue. */
        qp_attr.recv_cq = txq_ctrl->obj->cq;
        /* Max number of outstanding WRs. */
-       qp_attr.cap.max_send_wr = ((priv->sh->device_attr.max_qp_wr < desc) ?
-                                  priv->sh->device_attr.max_qp_wr : desc);
+       qp_attr.cap.max_send_wr = RTE_MIN(priv->sh->dev_cap.max_qp_wr, desc);
        /*
         * Max number of scatter/gather elements in a WR, must be 1 to prevent
         * libmlx5 from trying to affect must be 1 to prevent libmlx5 from
         * trying to affect too much memory. TX gather is not impacted by the
-        * device_attr.max_sge limit and will still work properly.
+        * dev_cap.max_sge limit and will still work properly.
         */
        qp_attr.cap.max_send_sge = 1;
        qp_attr.qp_type = IBV_QPT_RAW_PACKET,
@@ -870,6 +900,42 @@ mlx5_txq_ibv_qp_create(struct rte_eth_dev *dev, uint16_t idx)
        return qp_obj;
 }
 
+/**
+ * Initialize Tx UAR registers for primary process.
+ *
+ * @param txq_ctrl
+ *   Pointer to Tx queue control structure.
+ * @param bf_reg
+ *   BlueFlame register from Verbs UAR.
+ */
+static void
+mlx5_txq_ibv_uar_init(struct mlx5_txq_ctrl *txq_ctrl, void *bf_reg)
+{
+       struct mlx5_priv *priv = txq_ctrl->priv;
+       struct mlx5_proc_priv *ppriv = MLX5_PROC_PRIV(PORT_ID(priv));
+       const size_t page_size = rte_mem_page_size();
+       struct mlx5_txq_data *txq = &txq_ctrl->txq;
+       off_t uar_mmap_offset = txq_ctrl->uar_mmap_offset;
+#ifndef RTE_ARCH_64
+       unsigned int lock_idx;
+#endif
+
+       MLX5_ASSERT(rte_eal_process_type() == RTE_PROC_PRIMARY);
+       MLX5_ASSERT(ppriv);
+       if (page_size == (size_t)-1) {
+               DRV_LOG(ERR, "Failed to get mem page size");
+               rte_errno = ENOMEM;
+       }
+       txq->db_heu = priv->sh->cdev->config.dbnc == MLX5_SQ_DB_HEURISTIC;
+       txq->db_nc = mlx5_db_map_type_get(uar_mmap_offset, page_size);
+       ppriv->uar_table[txq->idx].db = bf_reg;
+#ifndef RTE_ARCH_64
+       /* Assign an UAR lock according to UAR page number. */
+       lock_idx = (uar_mmap_offset / page_size) & MLX5_UAR_PAGE_NUM_MASK;
+       ppriv->uar_table[txq->idx].sl_p = &priv->sh->uar_lock[lock_idx];
+#endif
+}
+
 /**
  * Create the Tx queue Verbs object.
  *
@@ -931,7 +997,7 @@ mlx5_txq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
        qp.comp_mask = MLX5DV_QP_MASK_UAR_MMAP_OFFSET;
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
        /* If using DevX, need additional mask to read tisn value. */
-       if (priv->sh->devx && !priv->sh->tdn)
+       if (priv->sh->cdev->config.devx && !priv->sh->tdn)
                qp.comp_mask |= MLX5DV_QP_MASK_RAW_QP_HANDLES;
 #endif
        obj.cq.in = txq_obj->cq;
@@ -969,13 +1035,17 @@ mlx5_txq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
        txq_data->wqe_pi = 0;
        txq_data->wqe_comp = 0;
        txq_data->wqe_thres = txq_data->wqe_s / MLX5_TX_COMP_THRESH_INLINE_DIV;
+       txq_data->wait_on_time = !!(!priv->sh->config.tx_pp &&
+                                priv->sh->cdev->config.hca_attr.wait_on_time &&
+                                txq_data->offloads &
+                                RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP);
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
        /*
         * If using DevX need to query and store TIS transport domain value.
         * This is done once per port.
         * Will use this value on Rx, when creating matching TIR.
         */
-       if (priv->sh->devx && !priv->sh->tdn) {
+       if (priv->sh->cdev->config.devx && !priv->sh->tdn) {
                ret = mlx5_devx_cmd_qp_query_tis_td(txq_obj->qp, qp.tisn,
                                                    &priv->sh->tdn);
                if (ret) {
@@ -990,20 +1060,18 @@ mlx5_txq_ibv_obj_new(struct rte_eth_dev *dev, uint16_t idx)
                }
        }
 #endif
-       txq_ctrl->bf_reg = qp.bf.reg;
        if (qp.comp_mask & MLX5DV_QP_MASK_UAR_MMAP_OFFSET) {
                txq_ctrl->uar_mmap_offset = qp.uar_mmap_offset;
                DRV_LOG(DEBUG, "Port %u: uar_mmap_offset 0x%" PRIx64 ".",
                        dev->data->port_id, txq_ctrl->uar_mmap_offset);
        } else {
                DRV_LOG(ERR,
-                       "Port %u failed to retrieve UAR info, invalid"
-                       " libmlx5.so",
+                       "Port %u failed to retrieve UAR info, invalid libmlx5.so",
                        dev->data->port_id);
                rte_errno = EINVAL;
                goto error;
        }
-       txq_uar_init(txq_ctrl);
+       mlx5_txq_ibv_uar_init(txq_ctrl, qp.bf.reg);
        dev->data->tx_queue_state[idx] = RTE_ETH_QUEUE_STATE_STARTED;
        return 0;
 error: