common/mlx5: fix queue doorbell record size
[dpdk.git] / drivers / common / mlx5 / mlx5_common.c
index 7b367e8..06f0a64 100644 (file)
 #include "mlx5_common_os.h"
 #include "mlx5_common_utils.h"
 #include "mlx5_malloc.h"
+#include "mlx5_common_pci.h"
 
 int mlx5_common_logtype;
 
 uint8_t haswell_broadwell_cpu;
 
-static int
-mlx5_class_check_handler(__rte_unused const char *key, const char *value,
-                        void *opaque)
-{
-       enum mlx5_class *ret = opaque;
-
-       if (strcmp(value, "vdpa") == 0) {
-               *ret = MLX5_CLASS_VDPA;
-       } else if (strcmp(value, "net") == 0) {
-               *ret = MLX5_CLASS_NET;
-       } else {
-               DRV_LOG(ERR, "Invalid mlx5 class %s. Maybe typo in device"
-                       " class argument setting?", value);
-               *ret = MLX5_CLASS_INVALID;
-       }
-       return 0;
-}
-
-enum mlx5_class
-mlx5_class_get(struct rte_devargs *devargs)
-{
-       struct rte_kvargs *kvlist;
-       const char *key = MLX5_CLASS_ARG_NAME;
-       enum mlx5_class ret = MLX5_CLASS_NET;
-
-       if (devargs == NULL)
-               return ret;
-       kvlist = rte_kvargs_parse(devargs->args, NULL);
-       if (kvlist == NULL)
-               return ret;
-       if (rte_kvargs_count(kvlist, key))
-               rte_kvargs_process(kvlist, key, mlx5_class_check_handler, &ret);
-       rte_kvargs_free(kvlist);
-       return ret;
-}
-
-
 /* In case this is an x86_64 intel processor to check if
  * we should use relaxed ordering.
  */
@@ -100,6 +64,7 @@ mlx5_common_init(void)
                return;
 
        mlx5_glue_constructor();
+       mlx5_common_pci_init();
        mlx5_common_initialized = true;
 }
 
@@ -233,7 +198,7 @@ mlx5_get_dbr(void *ctx,  struct mlx5_dbr_page_list *head,
        page->dbr_bitmap[i] |= (UINT64_C(1) << j);
        page->dbr_count++;
        *dbr_page = page;
-       return (((i * 64) + j) * sizeof(uint64_t));
+       return (i * CHAR_BIT * sizeof(uint64_t) + j) * MLX5_DBR_SIZE;
 }
 
 /**