Skip to contentSkip to conversation

common/mlx5: align driver name logs across pmds

PATCH In review Michael Baum 3 participants 5 messages Mar 15, 2021 – Apr 1, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 common/mlx5: align driver name logs across pmds

From: Asaf Penso <[email protected]>

Some mlx5 pmds define the log prefix as "mlx5_pmd" while others as "pmd_mlx5".
The patch aligns all pmds to use the "mlx5_pmd" format.

---
 drivers/common/mlx5/mlx5_common.h       | 4 ----
 drivers/common/mlx5/mlx5_common_utils.h | 2 +-
 drivers/net/mlx5/mlx5_utils.h           | 4 +++-
 drivers/regex/mlx5/mlx5_regex_utils.h   | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)
drivers/common/mlx5/mlx5_common.h +0 -4
index 3855582..fc1ac75 100644
@@ -65,10 +65,6 @@
 			RTE_FMT_HEAD(__VA_ARGS__,), \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
 
-/*
- * When debugging is enabled (MLX5_DEBUG not defined), file, line and function
- * information replace the driver name (MLX5_DRIVER_NAME) in log messages.
- */
 #ifdef RTE_LIBRTE_MLX5_DEBUG
 
 #define PMD_DRV_LOG__(level, type, name, ...) \
drivers/common/mlx5/mlx5_common_utils.h +1 -1
index 32c3adf..6cba39c 100644
@@ -10,7 +10,7 @@
 
 extern int mlx5_common_logtype;
 
-#define MLX5_COMMON_LOG_PREFIX "common_mlx5"
+#define MLX5_COMMON_LOG_PREFIX "mlx5_common"
 /* Generic printf()-like logging macro with automatic line feed. */
 #define DRV_LOG(level, ...) \
 	PMD_DRV_LOG_(level, mlx5_common_logtype, MLX5_COMMON_LOG_PREFIX, \
drivers/net/mlx5/mlx5_utils.h +3 -1
index 7a62187..5088c95 100644
@@ -29,9 +29,11 @@
 
 extern int mlx5_logtype;
 
+#define MLX5_NET_LOG_PREFIX "mlx5_net"
+
 /* Generic printf()-like logging macro with automatic line feed. */
 #define DRV_LOG(level, ...) \
-	PMD_DRV_LOG_(level, mlx5_logtype, MLX5_DRIVER_NAME, \
+	PMD_DRV_LOG_(level, mlx5_logtype, MLX5_NET_LOG_PREFIX, \
 		__VA_ARGS__ PMD_DRV_LOG_STRIP PMD_DRV_LOG_OPAREN, \
 		PMD_DRV_LOG_CPAREN)
 
drivers/regex/mlx5/mlx5_regex_utils.h +1 -1
index adca846..104e794 100644
@@ -9,7 +9,7 @@
 
 extern int mlx5_regex_logtype;
 
-#define MLX5_REGEX_LOG_PREFIX "regex_mlx5"
+#define MLX5_REGEX_LOG_PREFIX "mlx5_regex"
 /* Generic printf()-like logging macro with automatic line feed. */
 #define DRV_LOG(level, ...) \
 	PMD_DRV_LOG_(level, mlx5_regex_logtype, MLX5_REGEX_LOG_PREFIX, \
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/2 common/mlx5: rename driver name to include PCI notation

From: Asaf Penso <[email protected]>

The current define for MLX5_DRIVER_NAME refers specially for the PCI driver.

The define itself does not mention PCI and this is confusing.

Rename from MLX5_DRIVER_NAME to MLX5_PCI_DRIVER_NAME.

---
 drivers/common/mlx5/mlx5_common.h     | 2 +-
 drivers/common/mlx5/mlx5_common_pci.c | 2 +-
 drivers/net/mlx5/mlx5.c               | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/common/mlx5/mlx5_common.h +1 -1
index fc1ac75..84c3960 100644
@@ -19,7 +19,7 @@
 #include "mlx5_devx_cmds.h"
 
 /* Reported driver name. */
-#define MLX5_DRIVER_NAME "mlx5_pci"
+#define MLX5_PCI_DRIVER_NAME "mlx5_pci"
 
 /* Bit-field manipulation. */
 #define BITFIELD_DECLARE(bf, type, size) \
drivers/common/mlx5/mlx5_common_pci.c +1 -1
index 2b65768..3783b0e 100644
@@ -415,7 +415,7 @@ class_name_to_value(const char *class_name)
 
 static struct rte_pci_driver mlx5_pci_driver = {
 	.driver = {
-		.name = MLX5_DRIVER_NAME,
+		.name = MLX5_PCI_DRIVER_NAME,
 	},
 	.probe = mlx5_common_pci_probe,
 	.remove = mlx5_common_pci_remove,
drivers/net/mlx5/mlx5.c +2 -2
index abd7ff70..a22bbc9 100644
@@ -2094,7 +2094,7 @@ struct mlx5_dev_ctx_shared *
 		    (dev->device == &pci_dev->device ||
 		     (dev->device->driver &&
 		     dev->device->driver->name &&
-		     !strcmp(dev->device->driver->name, MLX5_DRIVER_NAME))))
+		     !strcmp(dev->device->driver->name, MLX5_PCI_DRIVER_NAME))))
 			break;
 		port_id++;
 	}
@@ -2215,7 +2215,7 @@ struct mlx5_dev_ctx_shared *
 	.driver_class = MLX5_CLASS_NET,
 	.pci_driver = {
 		.driver = {
-			.name = MLX5_DRIVER_NAME,
+			.name = MLX5_PCI_DRIVER_NAME,
 		},
 		.id_table = mlx5_pci_id_map,
 		.probe = mlx5_os_pci_probe,
Signature · 1 line
1.8.3.1
Acked-by on v1 2/2
#2 lore raw

Re: [dpdk-dev] [PATCH 2/2] common/mlx5: rename driver name to include PCI notation

Quoted 12 lines

-----Original Message-----
From: Michael Baum <[email protected]>
Sent: Monday, March 15, 2021 23:06
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>
Subject: [PATCH 2/2] common/mlx5: rename driver name to include PCI notation

From: Asaf Penso <[email protected]>

Quoted 8 lines

The current define for MLX5_DRIVER_NAME refers specially for the PCI driver.

The define itself does not mention PCI and this is confusing.

Rename from MLX5_DRIVER_NAME to MLX5_PCI_DRIVER_NAME.

Acked-by on v1 1/2
#3 lore raw
In reply to Michael Baum
Quoted 9 lines

-----Original Message-----
From: Michael Baum <[email protected]>
Sent: Monday, March 15, 2021 23:06
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>
Subject: [PATCH 1/2] common/mlx5: align driver name logs across pmds

Quoted 7 lines

From: Asaf Penso <[email protected]>

Some mlx5 pmds define the log prefix as "mlx5_pmd" while others as "pmd_mlx5".
The patch aligns all pmds to use the "mlx5_pmd" format.

#4 lore raw
In reply to Michael Baum

Hi,

Quoted 9 lines

-----Original Message-----
From: Michael Baum <[email protected]>
Sent: Monday, March 15, 2021 11:06 PM
To: [email protected]
Cc: NBU-Contact-Thomas Monjalon <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Asaf Penso <[email protected]>
Subject: [PATCH 1/2] common/mlx5: align driver name logs across pmds

Quoted 8 lines

From: Asaf Penso <[email protected]>

Some mlx5 pmds define the log prefix as "mlx5_pmd" while others as "pmd_mlx5".
The patch aligns all pmds to use the "mlx5_pmd" format.

---

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh