net/mlx5: Use dev->priv.name instead of dev_name
authorHuy Nguyen <huyn@mellanox.com>
Fri, 29 Mar 2019 22:37:59 +0000 (15:37 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 2 Apr 2019 19:49:38 +0000 (12:49 -0700)
Use mlx5_core mdev private name in message instead of using pci dev_name
to provide a better report/debug of different mlx5 device types.

This patch does not change any functionality.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Vu Pham <vuhuong@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer_tracepoint.h
drivers/net/ethernet/mellanox/mlx5/core/health.c

index 46d70eb..4d0e489 100644 (file)
@@ -1347,7 +1347,7 @@ static void set_wqname(struct mlx5_core_dev *dev)
        struct mlx5_cmd *cmd = &dev->cmd;
 
        snprintf(cmd->wq_name, sizeof(cmd->wq_name), "mlx5_cmd_%s",
-                dev_name(&dev->pdev->dev));
+                dev->priv.name);
 }
 
 static void clean_debug_files(struct mlx5_core_dev *dev)
index 83f90e9..7b5901d 100644 (file)
@@ -47,7 +47,7 @@ TRACE_EVENT(mlx5_fw,
        TP_ARGS(tracer, trace_timestamp, lost, event_id, msg),
 
        TP_STRUCT__entry(
-               __string(dev_name, dev_name(&tracer->dev->pdev->dev))
+               __string(dev_name, tracer->dev->priv.name)
                __field(u64, trace_timestamp)
                __field(bool, lost)
                __field(u8, event_id)
@@ -55,7 +55,7 @@ TRACE_EVENT(mlx5_fw,
        ),
 
        TP_fast_assign(
-               __assign_str(dev_name, dev_name(&tracer->dev->pdev->dev));
+               __assign_str(dev_name, tracer->dev->priv.name);
                __entry->trace_timestamp = trace_timestamp;
                __entry->lost = lost;
                __entry->event_id = event_id;
index 1ab694b..c337c1c 100644 (file)
@@ -377,7 +377,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev)
                return -ENOMEM;
 
        strcpy(name, "mlx5_health");
-       strcat(name, dev_name(&dev->pdev->dev));
+       strcat(name, dev->priv.name);
        health->wq = create_singlethread_workqueue(name);
        kfree(name);
        if (!health->wq)