[v8,10/10] common/mlx5: remove class check from class drivers
diff mbox series

Message ID 20200723200910.376581-11-parav@mellanox.com
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers show
Series
  • Improve mlx5 PMD driver framework for multiple classes
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Parav Pandit July 23, 2020, 8:09 p.m. UTC
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             | 37 -------------------
 drivers/common/mlx5/mlx5_common.h             |  2 -
 .../common/mlx5/rte_common_mlx5_version.map   |  3 +-
 drivers/net/mlx5/linux/mlx5_os.c              |  5 ---
 drivers/vdpa/mlx5/mlx5_vdpa.c                 |  5 ---
 5 files changed, 1 insertion(+), 51 deletions(-)

Patch
diff mbox series

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index fd818ef24..06f0a6400 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -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.
  */
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 864e82ff0..2cdb226f3 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -247,8 +247,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);
diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map
index 73cf72548..7729d0dd0 100644
--- a/drivers/common/mlx5/rte_common_mlx5_version.map
+++ b/drivers/common/mlx5/rte_common_mlx5_version.map
@@ -1,9 +1,8 @@ 
 INTERNAL {
 	global:
 
-	mlx5_class_get;
-
 	mlx5_common_init;
+
 	mlx5_common_verbs_reg_mr;
 	mlx5_common_verbs_dereg_mr;
 
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 97d7b0e7b..fc339affa 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1524,11 +1524,6 @@  mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	unsigned int dev_config_vf;
 	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();
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index ffe2f00ac..c0b87bcc0 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -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 "