{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>
This commit is contained in:
parent
122733a189
commit
d9236c3f10
|
@ -1159,7 +1159,8 @@ static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev)
|
|||
sprintf(name, "mlx4-ib-%d-%d@%s",
|
||||
i, j, dev->pdev->bus->name);
|
||||
/* Set IRQ for specific name (per ring) */
|
||||
if (mlx4_assign_eq(dev, name, &ibdev->eq_table[eq])) {
|
||||
if (mlx4_assign_eq(dev, name, NULL,
|
||||
&ibdev->eq_table[eq])) {
|
||||
/* Use legacy (same as mlx4_en driver) */
|
||||
pr_warn("Can't allocate EQ %d; reverting to legacy\n", eq);
|
||||
ibdev->eq_table[eq] =
|
||||
|
|
|
@ -91,7 +91,8 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
|
|||
sprintf(name, "%s-%d", priv->dev->name,
|
||||
cq->ring);
|
||||
/* Set IRQ for specific name (per ring) */
|
||||
if (mlx4_assign_eq(mdev->dev, name, &cq->vector)) {
|
||||
if (mlx4_assign_eq(mdev->dev, name, NULL,
|
||||
&cq->vector)) {
|
||||
cq->vector = (cq->ring + 1 + priv->port)
|
||||
% mdev->dev->caps.num_comp_vectors;
|
||||
mlx4_warn(mdev, "Failed Assigning an EQ to "
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <linux/dma-mapping.h>
|
||||
|
||||
#include <linux/mlx4/cmd.h>
|
||||
#include <linux/cpu_rmap.h>
|
||||
|
||||
#include "mlx4.h"
|
||||
#include "fw.h"
|
||||
|
@ -1060,7 +1061,8 @@ int mlx4_test_interrupts(struct mlx4_dev *dev)
|
|||
}
|
||||
EXPORT_SYMBOL(mlx4_test_interrupts);
|
||||
|
||||
int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
|
||||
int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
|
||||
int *vector)
|
||||
{
|
||||
|
||||
struct mlx4_priv *priv = mlx4_priv(dev);
|
||||
|
@ -1074,6 +1076,14 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
|
|||
snprintf(priv->eq_table.irq_names +
|
||||
vec * MLX4_IRQNAME_SIZE,
|
||||
MLX4_IRQNAME_SIZE, "%s", name);
|
||||
#ifdef CONFIG_RFS_ACCEL
|
||||
if (rmap) {
|
||||
err = irq_cpu_rmap_add(rmap,
|
||||
priv->eq_table.eq[vec].irq);
|
||||
if (err)
|
||||
mlx4_warn(dev, "Failed adding irq rmap\n");
|
||||
}
|
||||
#endif
|
||||
err = request_irq(priv->eq_table.eq[vec].irq,
|
||||
mlx4_msi_x_interrupt, 0,
|
||||
&priv->eq_table.irq_names[vec<<5],
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <linux/pci.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <linux/cpu_rmap.h>
|
||||
|
||||
#include <linux/atomic.h>
|
||||
|
||||
|
@ -784,7 +785,8 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
|
|||
int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
|
||||
int mlx4_SYNC_TPT(struct mlx4_dev *dev);
|
||||
int mlx4_test_interrupts(struct mlx4_dev *dev);
|
||||
int mlx4_assign_eq(struct mlx4_dev *dev, char* name , int* vector);
|
||||
int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
|
||||
int *vector);
|
||||
void mlx4_release_eq(struct mlx4_dev *dev, int vec);
|
||||
|
||||
int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
|
||||
|
|
Loading…
Reference in New Issue