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

Arputham Benjamin abenjamin at sgi.com
Wed Jul 1 19:46:21 PDT 2009


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

The mthca 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/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h
--- a/drivers/infiniband/hw/mthca/mthca_dev.h   2009-06-29 18:03:30.640012711 -0700
+++ b/drivers/infiniband/hw/mthca/mthca_dev.h   2009-06-29 18:05:45.871951427 -0700
@@ -356,6 +356,7 @@ struct mthca_dev {
        struct ib_ah         *sm_ah[MTHCA_MAX_PORTS];
        spinlock_t            sm_lock;
        u8                    rate[MTHCA_MAX_PORTS];
+       char                  irq_name[MTHCA_NUM_EQ][IB_DEVICE_NAME_MAX];
 };

 #ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
diff -rup a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c
--- a/drivers/infiniband/hw/mthca/mthca_eq.c    2009-06-29 18:06:20.016944802 -0700
+++ b/drivers/infiniband/hw/mthca/mthca_eq.c    2009-06-30 17:05:17.953297035 -0700
@@ -864,21 +864,27 @@ int mthca_init_eq_table(struct mthca_dev
                };

                for (i = 0; i < MTHCA_NUM_EQ; ++i) {
+                       snprintf(&dev->irq_name[i][0], IB_DEVICE_NAME_MAX,
+                                "%s at pci:%s", eq_name[i],
+                                pci_name(dev->pdev));
                        err = request_irq(dev->eq_table.eq[i].msi_x_vector,
                                          mthca_is_memfree(dev) ?
                                          mthca_arbel_msi_x_interrupt :
                                          mthca_tavor_msi_x_interrupt,
-                                         0, eq_name[i], dev->eq_table.eq + i);
+                                         0, &dev->irq_name[i][0],
+                                         dev->eq_table.eq + i);
                        if (err)
                                goto err_out_cmd;
                        dev->eq_table.eq[i].have_irq = 1;
                }
        } else {
+               snprintf(&dev->irq_name, IB_DEVICE_NAME_MAX,
+                        DRV_NAME "@pci:%s", pci_name(dev->pdev));
                err = request_irq(dev->pdev->irq,
                                  mthca_is_memfree(dev) ?
                                  mthca_arbel_interrupt :
                                  mthca_tavor_interrupt,
-                                 IRQF_SHARED, DRV_NAME, dev);
+                                 IRQF_SHARED, &dev->irq_name, dev);
                if (err)
                        goto err_out_cmd;
                dev->eq_table.have_irq = 1;





More information about the general mailing list