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

Arputham Benjamin abenjamin at sgi.com
Mon Aug 3 19:49:23 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-08-03 15:44:44.408580749 -0700
+++ b/drivers/infiniband/hw/mthca/mthca_dev.h	2009-08-03 15:45:25.451110249 -0700
@@ -357,6 +357,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-08-03 15:44:44.416581242 -0700
+++ b/drivers/infiniband/hw/mthca/mthca_eq.c	2009-08-03 15:45:11.098225651 -0700
@@ -835,21 +835,27 @@ int mthca_init_eq_table(struct mthca_dev
 		};
 
 		for (i = 0; i < MTHCA_NUM_EQ; ++i) {
+			snprintf(dev->irq_name[i], 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],
+					  dev->eq_table.eq + i);
 			if (err)
 				goto err_out_cmd;
 			dev->eq_table.eq[i].have_irq = 1;
 		}
 	} else {
+		snprintf(dev->irq_name[0], 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[0], dev);
 		if (err)
 			goto err_out_cmd;
 		dev->eq_table.have_irq = 1;



More information about the general mailing list