MCPcopy Create free account
hub / github.com/F-Stack/f-stack / regex_ctrl_create_cq

Function regex_ctrl_create_cq

dpdk/drivers/regex/mlx5/mlx5_regex_control.c:76–94  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

74 * 0 on success, a negative errno value otherwise and rte_errno is set.
75 */
76static int
77regex_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.

Callers 1

mlx5_regex_qp_setupFunction · 0.85

Calls 3

mlx5_devx_cq_createFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected