* Create Receive Memory Pool using DevX API. * * @param[in] ctx * Context returned from mlx5 open_device() glue function. * @param[in/out] rq_obj * Pointer to RQ to create. * @param[in] wqe_size * Size of WQE structure. * @param[in] log_wqbb_n * Log of number of WQBBs in queue. * @param[in] attr * Pointer to RQ attributes structure. * @param[in] socket * Socket to use for
| 581 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 582 | */ |
| 583 | static int |
| 584 | mlx5_devx_rmp_create(void *ctx, struct mlx5_devx_rmp *rmp_obj, |
| 585 | uint32_t wqe_size, uint16_t log_wqbb_n, |
| 586 | struct mlx5_devx_wq_attr *wq_attr, int socket) |
| 587 | { |
| 588 | struct mlx5_devx_create_rmp_attr rmp_attr = { 0 }; |
| 589 | int ret; |
| 590 | |
| 591 | if (rmp_obj->rmp != NULL) |
| 592 | return 0; |
| 593 | rmp_attr.wq_attr = *wq_attr; |
| 594 | ret = mlx5_devx_wq_init(ctx, wqe_size, log_wqbb_n, socket, |
| 595 | &rmp_attr.wq_attr, &rmp_obj->wq); |
| 596 | if (ret != 0) |
| 597 | return ret; |
| 598 | rmp_attr.state = MLX5_RMPC_STATE_RDY; |
| 599 | rmp_attr.basic_cyclic_rcv_wqe = |
| 600 | wq_attr->wq_type != MLX5_WQ_TYPE_CYCLIC_STRIDING_RQ; |
| 601 | /* Create receive memory pool object with DevX. */ |
| 602 | rmp_obj->rmp = mlx5_devx_cmd_create_rmp(ctx, &rmp_attr, socket); |
| 603 | if (rmp_obj->rmp == NULL) { |
| 604 | DRV_LOG(ERR, "Can't create DevX RMP object."); |
| 605 | rte_errno = ENOMEM; |
| 606 | goto error; |
| 607 | } |
| 608 | return 0; |
| 609 | error: |
| 610 | ret = rte_errno; |
| 611 | mlx5_devx_wq_res_destroy(&rmp_obj->wq); |
| 612 | rte_errno = ret; |
| 613 | return -rte_errno; |
| 614 | } |
| 615 | |
| 616 | /** |
| 617 | * Create Shared Receive Queue based on RMP using DevX API. |
no test coverage detected