[v10,10/10] common/mlx5: remove class check from class drivers
Checks
Commit Message
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(-)
@@ -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.
*/
@@ -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);
@@ -1,9 +1,8 @@
INTERNAL {
global:
- mlx5_class_get;
-
mlx5_common_init;
+
mlx5_common_verbs_reg_mr;
mlx5_common_verbs_dereg_mr;
@@ -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();
@@ -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 "