[ofa-general] [PATCH ] mlx4_core: Distinguish multiple IB cards in /proc/interrupts

Arputham Benjamin abenjamin at sgi.com
Wed Jul 1 20:04:57 PDT 2009


When the mlx4_core driver calls request_irq() to allocate interrupt resources, it uses
the fixed device name string "mlx4_core". When multiple IB cards are present in the system,
every instance of the resource is named "mlx4_core" in /proc/interrupts.
This can make it very confusing trying to work out exactly where IB interrupts are going and why.

The mlx4_core driver has been modified to use the PCI name of the IB card
for the purpose of allocating interrupt resources.

Signed-off-by: Arputham Benjamin <abenjamin at sgi.com>
---
diff -rup a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
--- a/drivers/net/mlx4/eq.c     2009-06-24 16:28:12.273861234 -0700
+++ b/drivers/net/mlx4/eq.c     2009-06-30 16:38:58.200069975 -0700
@@ -609,14 +609,21 @@ int mlx4_init_eq_table(struct mlx4_dev *
                for (i = 0; i < MLX4_EQ_COMP_CPU0 +
                      dev->caps.num_comp_vectors; ++i) {
                        if (i == 0)
-                               snprintf(eq_name[0], 20, DRV_NAME "(async)");
+                               snprintf(&priv->irq_name[i][0],
+                                        DEVICE_NAME_SIZE,
+                                        DRV_NAME "(async)" "@pci:%s",
+                                        pci_name(dev->pdev));
                        else
-                               snprintf(eq_name[i], 20, "eth-mlx4-%d",
-                                        i - 1);
+                               snprintf(&priv->irq_name[i][0],
+                                        DEVICE_NAME_SIZE,
+                                        "eth-mlx4-%d" "@pci:%s",
+                                        i - 1,
+                                        pci_name(dev->pdev));

                        err = request_irq(priv->eq_table.eq[i].irq,
                                          mlx4_msi_x_interrupt,
-                                         0, eq_name[i], priv->eq_table.eq + i);
+                                         0, &priv->irq_name[i][0],
+                                         priv->eq_table.eq + i);
                        if (err)
                                goto err_out_async;

@@ -624,8 +631,10 @@ int mlx4_init_eq_table(struct mlx4_dev *
                }

        } else {
+               snprintf(&priv->irq_name, DEVICE_NAME_SIZE,
+                        DRV_NAME "@pci:%s", pci_name(dev->pdev));
                err = request_irq(dev->pdev->irq, mlx4_interrupt,
-                                 IRQF_SHARED, DRV_NAME, dev);
+                                 IRQF_SHARED, &priv->irq_name, dev);
                if (err)
                        goto err_out_async;

diff -rup a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
--- a/drivers/net/mlx4/mlx4.h   2009-06-24 16:22:33.600623178 -0700
+++ b/drivers/net/mlx4/mlx4.h   2009-06-30 16:16:54.532981963 -0700
@@ -334,6 +334,7 @@ struct mlx4_priv {
        int                     changed_ports;
        struct mlx4_sense       sense;
        struct mutex            port_mutex;
+       char                    irq_name[MLX4_NUM_EQ][DEVICE_NAME_SIZE];
 };

 static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev)





More information about the general mailing list