regex/mlx5: prevent double setup of queue pair

When mlx5_regex_qp_setup() is called, make sure
the provided QP is not already setup.

Signed-off-by: Ady Agbarih <adypodoman@gmail.com>
Acked-by: Ori Kam <orika@nvidia.com>
This commit is contained in:
Ady Agbarih 2021-10-22 15:45:59 +00:00 committed by Thomas Monjalon
parent 02179f82b9
commit b5832a0d15

View File

@ -204,6 +204,12 @@ mlx5_regex_qp_setup(struct rte_regexdev *dev, uint16_t qp_ind,
uint16_t log_desc;
qp = &priv->qps[qp_ind];
if (qp->jobs) {
DRV_LOG(ERR, "Attempting to setup QP a second time.");
rte_errno = EINVAL;
return -rte_errno;
}
qp->flags = cfg->qp_conf_flags;
log_desc = rte_log2_u32(cfg->nb_desc);
/*