All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Vadai <amirv@mellanox.com>
To: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH] mlx4_en: fix allocation of CPU affinity reverse-map
Date: Sat, 23 Feb 2013 09:07:40 +0200	[thread overview]
Message-ID: <51286ABC.6080802@mellanox.com> (raw)
In-Reply-To: <1361596492-10565-1-git-send-email-klebers@linux.vnet.ibm.com>

On 23/02/2013 07:14, Kleber Sacilotto de Souza wrote:
> The mlx4_en driver allocates the number of objects for the CPU affinity
> reverse-map based on the number of rx rings of the device. However,
> mlx4_assign_eq() calls irq_cpu_rmap_add() as many times as IRQ's are
> assigned to EQ's, which can be as large as mlx4_dev->caps.comp_pool. If
> caps.comp_pool is larger than rx_ring_num we will eventually hit the
> BUG_ON() in cpu_rmap_add().
> 
> Fix this problem by allocating space for the maximum number of CPU
> affinity reverse-map objects we might want to add.
> 
> Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 5944dd6..5385474 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -1829,7 +1829,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
>  	}
>  
>  #ifdef CONFIG_RFS_ACCEL
> -	priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->rx_ring_num);
> +	priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
>  	if (!priv->dev->rx_cpu_rmap)
>  		goto err;
>  #endif
> 

Acked-by: Amir Vadai <amirv@mellanox.com>

  reply	other threads:[~2013-02-23  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23  5:14 [PATCH] mlx4_en: fix allocation of CPU affinity reverse-map Kleber Sacilotto de Souza
2013-02-23  7:07 ` Amir Vadai [this message]
2013-02-23 18:54 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51286ABC.6080802@mellanox.com \
    --to=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=klebers@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.