#include <rte_regexdev.h>
#include <rte_regexdev_core.h>
#include <rte_regexdev_driver.h>
+#include <rte_dev.h>
#include <mlx5_common.h>
#include <mlx5_glue.h>
cq->cqe_umem = mlx5_glue->devx_umem_reg(priv->ctx, buf,
sizeof(struct mlx5_cqe) *
cq_size, 7);
+ cq->ci = 0;
if (!cq->cqe_umem) {
DRV_LOG(ERR, "Can't register cqe mem.");
rte_errno = ENOMEM;
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;
qp->nb_obj * sizeof(struct mlx5_regex_sq), 64);
if (!qp->sqs) {
DRV_LOG(ERR, "Can't allocate sq array memory.");
- rte_errno = ENOMEM;
+ rte_errno = ENOMEM;
return -rte_errno;
}
log_desc = rte_log2_u32(qp->nb_desc / qp->nb_obj);
ret = regex_ctrl_create_cq(priv, &qp->cq);
if (ret) {
DRV_LOG(ERR, "Can't create cq.");
- goto error;
+ goto err_cq;
}
for (i = 0; i < qp->nb_obj; i++) {
ret = regex_ctrl_create_sq(priv, qp, i, log_desc);
if (ret) {
DRV_LOG(ERR, "Can't create sq.");
- goto error;
+ goto err_sq;
}
}
+
+ ret = mlx5_mr_btree_init(&qp->mr_ctrl.cache_bh, MLX5_MR_BTREE_CACHE_N,
+ rte_socket_id());
+ if (ret) {
+ DRV_LOG(ERR, "Error setting up mr btree");
+ goto err_btree;
+ }
+
+ ret = mlx5_regexdev_setup_fastpath(priv, qp_ind);
+ if (ret) {
+ DRV_LOG(ERR, "Error setting up fastpath");
+ goto err_fp;
+ }
return 0;
-error:
- regex_ctrl_destroy_cq(priv, &qp->cq);
+err_fp:
+ mlx5_mr_btree_free(&qp->mr_ctrl.cache_bh);
+err_btree:
for (i = 0; i < qp->nb_obj; i++)
- ret = regex_ctrl_destroy_sq(priv, qp, i);
- return -rte_errno;
-
+ regex_ctrl_destroy_sq(priv, qp, i);
+err_sq:
+ regex_ctrl_destroy_cq(priv, &qp->cq);
+err_cq:
+ rte_free(qp->sqs);
+ return ret;
}