[dpdk-dev] [PATCH v4 11/16] vdpa/mlx5: define driver name as macro

Xueming Li xuemingl at nvidia.com
Wed Jul 21 16:37:38 CEST 2021


From: Thomas Monjalon <thomas at monjalon.net>

Uses macro for pmd driver name.

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 8b5bfd8c3d..5ab7c525c2 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -24,6 +24,7 @@
 #include "mlx5_vdpa_utils.h"
 #include "mlx5_vdpa.h"
 
+#define MLX5_VDPA_DRIVER_NAME vdpa_mlx5
 
 #define MLX5_VDPA_DEFAULT_FEATURES ((1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \
 			    (1ULL << VIRTIO_F_ANY_LAYOUT) | \
@@ -834,7 +835,7 @@ static struct mlx5_pci_driver mlx5_vdpa_driver = {
 	.driver_class = MLX5_CLASS_VDPA,
 	.pci_driver = {
 		.driver = {
-			.name = "mlx5_vdpa",
+			.name = RTE_STR(MLX5_VDPA_DRIVER_NAME),
 		},
 		.id_table = mlx5_vdpa_pci_id_map,
 		.probe = mlx5_vdpa_pci_probe,
@@ -855,6 +856,6 @@ RTE_INIT(rte_mlx5_vdpa_init)
 		mlx5_pci_driver_register(&mlx5_vdpa_driver);
 }
 
-RTE_PMD_EXPORT_NAME(net_mlx5_vdpa, __COUNTER__);
-RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_vdpa, mlx5_vdpa_pci_id_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_vdpa, "* ib_uverbs & mlx5_core & mlx5_ib");
+RTE_PMD_EXPORT_NAME(MLX5_VDPA_DRIVER_NAME, __COUNTER__);
+RTE_PMD_REGISTER_PCI_TABLE(MLX5_VDPA_DRIVER_NAME, mlx5_vdpa_pci_id_map);
+RTE_PMD_REGISTER_KMOD_DEP(MLX5_VDPA_DRIVER_NAME, "* ib_uverbs & mlx5_core & mlx5_ib");
-- 
2.25.1



More information about the dev mailing list