* create the CQ object. * * @param priv * Pointer to the priv object. * @param cp * Pointer to the CQ to be created. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */
| 74 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 75 | */ |
| 76 | static int |
| 77 | regex_ctrl_create_cq(struct mlx5_regex_priv *priv, struct mlx5_regex_cq *cq) |
| 78 | { |
| 79 | struct mlx5_devx_cq_attr attr = { |
| 80 | .uar_page_id = mlx5_os_get_devx_uar_page_id(priv->uar.obj), |
| 81 | }; |
| 82 | int ret; |
| 83 | |
| 84 | cq->ci = 0; |
| 85 | ret = mlx5_devx_cq_create(priv->cdev->ctx, &cq->cq_obj, cq->log_nb_desc, |
| 86 | &attr, SOCKET_ID_ANY); |
| 87 | if (ret) { |
| 88 | DRV_LOG(ERR, "Can't create CQ object."); |
| 89 | memset(cq, 0, sizeof(*cq)); |
| 90 | rte_errno = ENOMEM; |
| 91 | return -rte_errno; |
| 92 | } |
| 93 | return 0; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Destroy the SQ object. |
no test coverage detected