* Context returned from mlx5 open_device() glue function.
* @param[in/out] qp_obj
* Pointer to QP to create.
- * @param[in] log_wqbb_n
- * Log of number of WQBBs in queue.
+ * @param[in] queue_size
+ * Size of queue to create.
* @param[in] attr
* Pointer to QP attributes structure.
* @param[in] socket
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
int
-mlx5_devx_qp_create(void *ctx, struct mlx5_devx_qp *qp_obj, uint32_t log_wqbb_n,
+mlx5_devx_qp_create(void *ctx, struct mlx5_devx_qp *qp_obj, uint32_t queue_size,
struct mlx5_devx_qp_attr *attr, int socket)
{
struct mlx5_devx_obj *qp = NULL;
void *umem_buf = NULL;
size_t alignment = MLX5_WQE_BUF_ALIGNMENT;
uint32_t umem_size, umem_dbrec;
- uint32_t num_of_wqbbs = RTE_BIT32(log_wqbb_n);
int ret;
if (alignment == (size_t)-1) {
return -rte_errno;
}
/* Allocate memory buffer for WQEs and doorbell record. */
- umem_size = MLX5_WQE_SIZE * num_of_wqbbs;
+ umem_size = queue_size;
umem_dbrec = RTE_ALIGN(umem_size, MLX5_DBR_SIZE);
umem_size += MLX5_DBR_SIZE;
umem_buf = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, umem_size,
__rte_internal
int mlx5_devx_qp_create(void *ctx, struct mlx5_devx_qp *qp_obj,
- uint32_t log_wqbb_n,
+ uint32_t queue_size,
struct mlx5_devx_qp_attr *attr, int socket);
__rte_internal
qp_attr.num_of_send_wqbbs = RTE_BIT32(log_ops_n);
qp_attr.mmo = priv->mmo_decomp_qp && priv->mmo_comp_qp
&& priv->mmo_dma_qp;
- ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp, log_ops_n, &qp_attr,
- socket_id);
+ ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp,
+ qp_attr.num_of_send_wqbbs *
+ MLX5_WQE_SIZE, &qp_attr, socket_id);
if (ret != 0) {
DRV_LOG(ERR, "Failed to create QP.");
goto err;
attr.num_of_send_wqbbs = RTE_BIT32(log_wqbb_n);
attr.ts_format =
mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format);
- ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp_obj, log_wqbb_n,
- &attr, socket_id);
+ ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp_obj,
+ attr.num_of_send_wqbbs * MLX5_WQE_SIZE,
+ &attr, socket_id);
if (ret) {
DRV_LOG(ERR, "Failed to create QP.");
goto error;
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);
+ attr.num_of_send_wqbbs * MLX5_WQE_SIZE, &attr,
+ SOCKET_ID_ANY);
if (ret) {
DRV_LOG(ERR, "Can't create QP object.");
rte_errno = ENOMEM;
attr.num_of_send_wqbbs = 0; /* No need SQ. */
attr.ts_format =
mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format);
- ret = mlx5_devx_qp_create(priv->cdev->ctx, &(eqp->sw_qp), log_desc_n,
- &attr, SOCKET_ID_ANY);
+ ret = mlx5_devx_qp_create(priv->cdev->ctx, &(eqp->sw_qp),
+ attr.num_of_receive_wqes *
+ MLX5_WSEG_SIZE, &attr, SOCKET_ID_ANY);
if (ret) {
DRV_LOG(ERR, "Failed to create SW QP(%u).", rte_errno);
goto error;