common/mlx5: remove class check from class drivers
authorParav Pandit <parav@mellanox.com>
Mon, 27 Jul 2020 17:47:15 +0000 (20:47 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 28 Jul 2020 17:01:30 +0000 (19:01 +0200)
Now that mlx5_pci PMD checks for enabled classes and performs
probe(), remove() of associated classes, individual class driver
does not need to check if other driver is enabled.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/common/mlx5/mlx5_common.c
drivers/common/mlx5/mlx5_common.h
drivers/common/mlx5/rte_common_mlx5_version.map
drivers/net/mlx5/linux/mlx5_os.c
drivers/vdpa/mlx5/mlx5_vdpa.c

index 692c1c1..79357e2 100644 (file)
@@ -20,43 +20,6 @@ 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.
  */
index 712e212..9154cbc 100644 (file)
@@ -245,8 +245,6 @@ struct mlx5_klm {
 
 LIST_HEAD(mlx5_dbr_page_list, mlx5_devx_dbr_page);
 
-__rte_internal
-enum mlx5_class mlx5_class_get(struct rte_devargs *devargs);
 __rte_internal
 void mlx5_translate_port_name(const char *port_name_in,
                              struct mlx5_switch_info *port_info_out);
index 73cf725..7729d0d 100644 (file)
@@ -1,9 +1,8 @@
 INTERNAL {
        global:
 
-       mlx5_class_get;
-
        mlx5_common_init;
+
        mlx5_common_verbs_reg_mr;
        mlx5_common_verbs_dereg_mr;
 
index fd2e631..3c172bf 100644 (file)
@@ -1522,11 +1522,6 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
        struct mlx5_dev_config dev_config;
        int ret;
 
-       if (mlx5_class_get(pci_dev->device.devargs) != MLX5_CLASS_NET) {
-               DRV_LOG(DEBUG, "Skip probing - should be probed by other mlx5"
-                       " driver.");
-               return 1;
-       }
        if (rte_eal_process_type() == RTE_PROC_PRIMARY)
                mlx5_pmd_socket_init();
        ret = mlx5_init_once();
index ffe2f00..c0b87bc 100644 (file)
@@ -680,11 +680,6 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
        struct mlx5_hca_attr attr;
        int ret;
 
-       if (mlx5_class_get(pci_dev->device.devargs) != MLX5_CLASS_VDPA) {
-               DRV_LOG(DEBUG, "Skip probing - should be probed by other mlx5"
-                       " driver.");
-               return 1;
-       }
        ibv = mlx5_vdpa_get_ib_device_match(&pci_dev->addr);
        if (!ibv) {
                DRV_LOG(ERR, "No matching IB device for PCI slot "