- sq->log_nb_desc = log_nb_desc;
- sq_size = 1 << sq->log_nb_desc;
- sq->dbr_offset = mlx5_get_dbr(priv->ctx, &priv->dbrpgs, &dbr_page);
- if (sq->dbr_offset < 0) {
- DRV_LOG(ERR, "Can't allocate sq door bell record.");
- rte_errno = ENOMEM;
- goto error;
- }
- sq->dbr_umem = mlx5_os_get_umem_id(dbr_page->umem);
- sq->dbr = (uint32_t *)((uintptr_t)dbr_page->dbrs +
- (uintptr_t)sq->dbr_offset);
-
- buf = rte_calloc(NULL, 1, 64 * sq_size, 4096);
- if (!buf) {
- DRV_LOG(ERR, "Can't allocate wqe buffer.");
- rte_errno = ENOMEM;
- goto error;
- }
- sq->wqe = buf;
- sq->wqe_umem = mlx5_glue->devx_umem_reg(priv->ctx, buf, 64 * sq_size,
- 7);
- sq->ci = 0;
- sq->pi = 0;
- if (!sq->wqe_umem) {
- DRV_LOG(ERR, "Can't register wqe mem.");
- rte_errno = ENOMEM;
- goto error;
- }
- attr.state = MLX5_SQC_STATE_RST;
- attr.tis_lst_sz = 0;
- attr.tis_num = 0;
- attr.user_index = q_ind;
- attr.cqn = qp->cq.cq_obj.cq->id;
- wq_attr->uar_page = priv->uar->page_id;
- regex_get_pdn(priv->pd, &pd_num);
- wq_attr->pd = pd_num;
- wq_attr->wq_type = MLX5_WQ_TYPE_CYCLIC;
- wq_attr->dbr_umem_id = sq->dbr_umem;
- wq_attr->dbr_addr = sq->dbr_offset;
- wq_attr->dbr_umem_valid = 1;
- wq_attr->wq_umem_id = mlx5_os_get_umem_id(sq->wqe_umem);
- wq_attr->wq_umem_offset = 0;
- wq_attr->wq_umem_valid = 1;
- wq_attr->log_wq_stride = 6;
- wq_attr->log_wq_sz = sq->log_nb_desc;
- sq->obj = mlx5_devx_cmd_create_sq(priv->ctx, &attr);
- if (!sq->obj) {
- DRV_LOG(ERR, "Can't create sq object.");
- rte_errno = ENOMEM;
- goto error;
+ qp_obj->log_nb_desc = log_nb_desc;
+ qp_obj->qpn = q_ind;
+ qp_obj->ci = 0;
+ qp_obj->pi = 0;
+ attr.rq_size = 0;
+ attr.sq_size = RTE_BIT32(MLX5_REGEX_WQE_LOG_NUM(priv->has_umr,
+ log_nb_desc));
+ attr.mmo = priv->mmo_regex_qp_cap;
+ ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp_obj->qp_obj,
+ MLX5_REGEX_WQE_LOG_NUM(priv->has_umr, log_nb_desc),
+ &attr, SOCKET_ID_ANY);
+ if (ret) {
+ DRV_LOG(ERR, "Can't create QP object.");
+ rte_errno = ENOMEM;
+ return -rte_errno;