diff options
author | Amir Vadai <amirv@mellanox.com> | 2012-07-18 18:33:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-19 11:34:37 -0400 |
commit | d9236c3f10490cd0b3fd4516af12ba62dcbae0b0 (patch) | |
tree | 9fbfa70657455d1e22eecc2ef71f5e1dfa58c5be /drivers/net/ethernet | |
parent | 122733a189d687087364d6dc3ecc7c682554f6a0 (diff) |
{NET,IB}/mlx4: Add rmap support to mlx4_assign_eq
Enable callers of mlx4_assign_eq to supply a pointer to cpu_rmap.
If supplied, the assigned IRQ is tracked using rmap infrastructure.
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_cq.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/eq.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c index 908a460d8db6..0ef615684021 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c | |||
@@ -91,7 +91,8 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, | |||
91 | sprintf(name, "%s-%d", priv->dev->name, | 91 | sprintf(name, "%s-%d", priv->dev->name, |
92 | cq->ring); | 92 | cq->ring); |
93 | /* Set IRQ for specific name (per ring) */ | 93 | /* Set IRQ for specific name (per ring) */ |
94 | if (mlx4_assign_eq(mdev->dev, name, &cq->vector)) { | 94 | if (mlx4_assign_eq(mdev->dev, name, NULL, |
95 | &cq->vector)) { | ||
95 | cq->vector = (cq->ring + 1 + priv->port) | 96 | cq->vector = (cq->ring + 1 + priv->port) |
96 | % mdev->dev->caps.num_comp_vectors; | 97 | % mdev->dev->caps.num_comp_vectors; |
97 | mlx4_warn(mdev, "Failed Assigning an EQ to " | 98 | mlx4_warn(mdev, "Failed Assigning an EQ to " |
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index bce98d9c0039..cd48337cbfc0 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/dma-mapping.h> | 39 | #include <linux/dma-mapping.h> |
40 | 40 | ||
41 | #include <linux/mlx4/cmd.h> | 41 | #include <linux/mlx4/cmd.h> |
42 | #include <linux/cpu_rmap.h> | ||
42 | 43 | ||
43 | #include "mlx4.h" | 44 | #include "mlx4.h" |
44 | #include "fw.h" | 45 | #include "fw.h" |
@@ -1060,7 +1061,8 @@ int mlx4_test_interrupts(struct mlx4_dev *dev) | |||
1060 | } | 1061 | } |
1061 | EXPORT_SYMBOL(mlx4_test_interrupts); | 1062 | EXPORT_SYMBOL(mlx4_test_interrupts); |
1062 | 1063 | ||
1063 | int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | 1064 | int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, |
1065 | int *vector) | ||
1064 | { | 1066 | { |
1065 | 1067 | ||
1066 | struct mlx4_priv *priv = mlx4_priv(dev); | 1068 | struct mlx4_priv *priv = mlx4_priv(dev); |
@@ -1074,6 +1076,14 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1074 | snprintf(priv->eq_table.irq_names + | 1076 | snprintf(priv->eq_table.irq_names + |
1075 | vec * MLX4_IRQNAME_SIZE, | 1077 | vec * MLX4_IRQNAME_SIZE, |
1076 | MLX4_IRQNAME_SIZE, "%s", name); | 1078 | MLX4_IRQNAME_SIZE, "%s", name); |
1079 | #ifdef CONFIG_RFS_ACCEL | ||
1080 | if (rmap) { | ||
1081 | err = irq_cpu_rmap_add(rmap, | ||
1082 | priv->eq_table.eq[vec].irq); | ||
1083 | if (err) | ||
1084 | mlx4_warn(dev, "Failed adding irq rmap\n"); | ||
1085 | } | ||
1086 | #endif | ||
1077 | err = request_irq(priv->eq_table.eq[vec].irq, | 1087 | err = request_irq(priv->eq_table.eq[vec].irq, |
1078 | mlx4_msi_x_interrupt, 0, | 1088 | mlx4_msi_x_interrupt, 0, |
1079 | &priv->eq_table.irq_names[vec<<5], | 1089 | &priv->eq_table.irq_names[vec<<5], |