net/txgbe: fix queue statistics mapping
[dpdk.git] / drivers / regex / mlx5 / mlx5_regex.c
index 5116fa9..9f79c69 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "mlx5_regex.h"
 #include "mlx5_regex_utils.h"
-#include "mlx5_rxp_csrs.h"
 
 #define MLX5_REGEX_DRIVER_NAME regex_mlx5
 
@@ -68,11 +67,13 @@ mlx5_regex_get_name(char *name, struct rte_device *dev)
 }
 
 static int
-mlx5_regex_dev_probe(struct mlx5_common_device *cdev)
+mlx5_regex_dev_probe(struct mlx5_common_device *cdev,
+                    struct mlx5_kvargs_ctrl *mkvlist __rte_unused)
 {
        struct mlx5_regex_priv *priv = NULL;
        struct mlx5_hca_attr *attr = &cdev->config.hca_attr;
        char name[RTE_REGEXDEV_NAME_MAX_LEN];
+       int ret;
 
        if ((!attr->regexp_params && !attr->mmo_regex_sq_en && !attr->mmo_regex_qp_en)
            || attr->regexp_num_of_engines == 0) {
@@ -103,17 +104,9 @@ mlx5_regex_dev_probe(struct mlx5_common_device *cdev)
                rte_errno = rte_errno ? rte_errno : EINVAL;
                goto dev_error;
        }
-       /*
-        * This PMD always claims the write memory barrier on UAR
-        * registers writings, it is safe to allocate UAR with any
-        * memory mapping type.
-        */
-       priv->uar = mlx5_devx_alloc_uar(priv->cdev->ctx, -1);
-       if (!priv->uar) {
-               DRV_LOG(ERR, "can't allocate uar.");
-               rte_errno = ENOMEM;
+       ret = mlx5_devx_uar_prepare(cdev, &priv->uar);
+       if (ret)
                goto error;
-       }
        priv->regexdev->dev_ops = &mlx5_regexdev_ops;
        priv->regexdev->enqueue = mlx5_regexdev_enqueue;
 #ifdef HAVE_MLX5_UMR_IMKEY
@@ -132,13 +125,10 @@ mlx5_regex_dev_probe(struct mlx5_common_device *cdev)
        return 0;
 
 error:
-       if (priv->uar)
-               mlx5_glue->devx_free_uar(priv->uar);
        if (priv->regexdev)
                rte_regexdev_unregister(priv->regexdev);
 dev_error:
-       if (priv)
-               rte_free(priv);
+       rte_free(priv);
        return -rte_errno;
 }
 
@@ -155,8 +145,7 @@ mlx5_regex_dev_remove(struct mlx5_common_device *cdev)
                return 0;
        priv = dev->data->dev_private;
        if (priv) {
-               if (priv->uar)
-                       mlx5_glue->devx_free_uar(priv->uar);
+               mlx5_devx_uar_release(&priv->uar);
                if (priv->regexdev)
                        rte_regexdev_unregister(priv->regexdev);
                rte_free(priv);