aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorArputham Benjamin <abenjamin@sgi.com>2009-09-05 23:24:50 -0400
committerRoland Dreier <rolandd@cisco.com>2009-09-05 23:24:50 -0400
commitf5f5951c7494b6ae89ec53ca7ca6b0177ebd1308 (patch)
treeb887609a24906ceb27ce3e0fe1f1704892965730 /drivers/net/mlx4
parent1af92e2a211b0d46ef60ea9f30f989fd7b5725fa (diff)
mlx4_core: Distinguish multiple devices in /proc/interrupts
When the mlx4 driver uses the same name for interrupts for every device in the system. This can make it very confusing trying to work out exactly which device MSI-X interrupts are for. Change the driver to add the PCI name of the device to the interrupt name. Signed-off-by: Arputham Benjamin <abenjamin@sgi.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/eq.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index d7974a60b961..bffb7995cb70 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -41,6 +41,10 @@
41#include "fw.h" 41#include "fw.h"
42 42
43enum { 43enum {
44 MLX4_IRQNAME_SIZE = 64
45};
46
47enum {
44 MLX4_NUM_ASYNC_EQE = 0x100, 48 MLX4_NUM_ASYNC_EQE = 0x100,
45 MLX4_NUM_SPARE_EQE = 0x80, 49 MLX4_NUM_SPARE_EQE = 0x80,
46 MLX4_EQ_ENTRY_SIZE = 0x20 50 MLX4_EQ_ENTRY_SIZE = 0x20
@@ -572,7 +576,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
572 priv->eq_table.clr_int = priv->clr_base + 576 priv->eq_table.clr_int = priv->clr_base +
573 (priv->eq_table.inta_pin < 32 ? 4 : 0); 577 (priv->eq_table.inta_pin < 32 ? 4 : 0);
574 578
575 priv->eq_table.irq_names = kmalloc(16 * dev->caps.num_comp_vectors, GFP_KERNEL); 579 priv->eq_table.irq_names =
580 kmalloc(MLX4_IRQNAME_SIZE * (dev->caps.num_comp_vectors + 1),
581 GFP_KERNEL);
576 if (!priv->eq_table.irq_names) { 582 if (!priv->eq_table.irq_names) {
577 err = -ENOMEM; 583 err = -ENOMEM;
578 goto err_out_bitmap; 584 goto err_out_bitmap;
@@ -595,17 +601,25 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
595 goto err_out_comp; 601 goto err_out_comp;
596 602
597 if (dev->flags & MLX4_FLAG_MSI_X) { 603 if (dev->flags & MLX4_FLAG_MSI_X) {
598 static const char async_eq_name[] = "mlx4-async";
599 const char *eq_name; 604 const char *eq_name;
600 605
601 for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) { 606 for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) {
602 if (i < dev->caps.num_comp_vectors) { 607 if (i < dev->caps.num_comp_vectors) {
603 snprintf(priv->eq_table.irq_names + i * 16, 16, 608 snprintf(priv->eq_table.irq_names +
604 "mlx4-comp-%d", i); 609 i * MLX4_IRQNAME_SIZE,
605 eq_name = priv->eq_table.irq_names + i * 16; 610 MLX4_IRQNAME_SIZE,
606 } else 611 "mlx4-comp-%d@pci:%s", i,
607 eq_name = async_eq_name; 612 pci_name(dev->pdev));
613 } else {
614 snprintf(priv->eq_table.irq_names +
615 i * MLX4_IRQNAME_SIZE,
616 MLX4_IRQNAME_SIZE,
617 "mlx4-async@pci:%s",
618 pci_name(dev->pdev));
619 }
608 620
621 eq_name = priv->eq_table.irq_names +
622 i * MLX4_IRQNAME_SIZE;
609 err = request_irq(priv->eq_table.eq[i].irq, 623 err = request_irq(priv->eq_table.eq[i].irq,
610 mlx4_msi_x_interrupt, 0, eq_name, 624 mlx4_msi_x_interrupt, 0, eq_name,
611 priv->eq_table.eq + i); 625 priv->eq_table.eq + i);
@@ -615,8 +629,12 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
615 priv->eq_table.eq[i].have_irq = 1; 629 priv->eq_table.eq[i].have_irq = 1;
616 } 630 }
617 } else { 631 } else {
632 snprintf(priv->eq_table.irq_names,
633 MLX4_IRQNAME_SIZE,
634 DRV_NAME "@pci:%s",
635 pci_name(dev->pdev));
618 err = request_irq(dev->pdev->irq, mlx4_interrupt, 636 err = request_irq(dev->pdev->irq, mlx4_interrupt,
619 IRQF_SHARED, DRV_NAME, dev); 637 IRQF_SHARED, priv->eq_table.irq_names, dev);
620 if (err) 638 if (err)
621 goto err_out_async; 639 goto err_out_async;
622 640