[v4,01/16] common/mlx5: rename eth device class name

Message ID 20210721143743.24626-2-xuemingl@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series net/mlx5: support Sub-Function |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Xueming Li July 21, 2021, 2:37 p.m. UTC
  To align with EAL class driver, rename internal class name from "net" to
"eth"

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/mlx5_common.h     |  2 +-
 drivers/common/mlx5/mlx5_common_pci.c | 22 ++++++++++++----------
 drivers/net/mlx5/mlx5.c               |  2 +-
 3 files changed, 14 insertions(+), 12 deletions(-)
  

Patch

diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 962179a5a5..05008983ea 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -212,7 +212,7 @@  int mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname);
 
 enum mlx5_class {
 	MLX5_CLASS_INVALID,
-	MLX5_CLASS_NET = RTE_BIT64(0),
+	MLX5_CLASS_ETH = RTE_BIT64(0),
 	MLX5_CLASS_VDPA = RTE_BIT64(1),
 	MLX5_CLASS_REGEX = RTE_BIT64(2),
 	MLX5_CLASS_COMPRESS = RTE_BIT64(3),
diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
index 5547e62d6b..591054468d 100644
--- a/drivers/common/mlx5/mlx5_common_pci.c
+++ b/drivers/common/mlx5/mlx5_common_pci.c
@@ -28,34 +28,36 @@  static const struct {
 	unsigned int driver_class;
 } mlx5_classes[] = {
 	{ .name = "vdpa", .driver_class = MLX5_CLASS_VDPA },
-	{ .name = "net", .driver_class = MLX5_CLASS_NET },
+	{ .name = "eth", .driver_class = MLX5_CLASS_ETH },
+	/* Keep name "net" for backward compatibility. */
+	{ .name = "net", .driver_class = MLX5_CLASS_ETH },
 	{ .name = "regex", .driver_class = MLX5_CLASS_REGEX },
 	{ .name = "compress", .driver_class = MLX5_CLASS_COMPRESS },
 	{ .name = "crypto", .driver_class = MLX5_CLASS_CRYPTO },
 };
 
 static const unsigned int mlx5_class_combinations[] = {
-	MLX5_CLASS_NET,
+	MLX5_CLASS_ETH,
 	MLX5_CLASS_VDPA,
 	MLX5_CLASS_REGEX,
 	MLX5_CLASS_COMPRESS,
 	MLX5_CLASS_CRYPTO,
-	MLX5_CLASS_NET | MLX5_CLASS_REGEX,
+	MLX5_CLASS_ETH | MLX5_CLASS_REGEX,
 	MLX5_CLASS_VDPA | MLX5_CLASS_REGEX,
-	MLX5_CLASS_NET | MLX5_CLASS_COMPRESS,
+	MLX5_CLASS_ETH | MLX5_CLASS_COMPRESS,
 	MLX5_CLASS_VDPA | MLX5_CLASS_COMPRESS,
 	MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
-	MLX5_CLASS_NET | MLX5_CLASS_CRYPTO,
+	MLX5_CLASS_ETH | MLX5_CLASS_CRYPTO,
+	MLX5_CLASS_ETH | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
 	MLX5_CLASS_VDPA | MLX5_CLASS_CRYPTO,
 	MLX5_CLASS_REGEX | MLX5_CLASS_CRYPTO,
 	MLX5_CLASS_COMPRESS | MLX5_CLASS_CRYPTO,
-	MLX5_CLASS_NET | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
 	MLX5_CLASS_VDPA | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
-	MLX5_CLASS_NET | MLX5_CLASS_REGEX | MLX5_CLASS_CRYPTO,
+	MLX5_CLASS_ETH | MLX5_CLASS_REGEX | MLX5_CLASS_CRYPTO,
 	MLX5_CLASS_VDPA | MLX5_CLASS_REGEX | MLX5_CLASS_CRYPTO,
-	MLX5_CLASS_NET | MLX5_CLASS_COMPRESS | MLX5_CLASS_CRYPTO,
+	MLX5_CLASS_ETH | MLX5_CLASS_COMPRESS | MLX5_CLASS_CRYPTO,
 	MLX5_CLASS_VDPA | MLX5_CLASS_COMPRESS | MLX5_CLASS_CRYPTO,
-	MLX5_CLASS_NET | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS |
+	MLX5_CLASS_ETH | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS |
 	MLX5_CLASS_CRYPTO,
 	MLX5_CLASS_VDPA | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS |
 	MLX5_CLASS_CRYPTO,
@@ -317,7 +319,7 @@  mlx5_common_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		}
 	} else {
 		/* Default to net class. */
-		user_classes = MLX5_CLASS_NET;
+		user_classes = MLX5_CLASS_ETH;
 	}
 	dev = pci_to_mlx5_device(pci_dev);
 	if (!dev) {
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 021a34dd4d..d9c90d5ef9 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2446,7 +2446,7 @@  static const struct rte_pci_id mlx5_pci_id_map[] = {
 };
 
 static struct mlx5_pci_driver mlx5_driver = {
-	.driver_class = MLX5_CLASS_NET,
+	.driver_class = MLX5_CLASS_ETH,
 	.pci_driver = {
 		.driver = {
 			.name = MLX5_PCI_DRIVER_NAME,