All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx4_en: fix allocation of device tx_cq
@ 2013-02-23  0:58 Kleber Sacilotto de Souza
  2013-02-23  7:05 ` Amir Vadai
  2013-02-23 18:54 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Kleber Sacilotto de Souza @ 2013-02-23  0:58 UTC (permalink / raw)
  To: davem; +Cc: Amir Vadai, netdev, Kleber Sacilotto de Souza

The memory to hold the network device tx_cq is not being allocated with
the correct size in mlx4_en_init_netdev(). It should use MAX_TX_RINGS
instead of MAX_RX_RINGS. This can cause problems if the number of tx
rings being used is greater than MAX_RX_RINGS.

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 5088dc5..5944dd6 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2067,7 +2067,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 		err = -ENOMEM;
 		goto out;
 	}
-	priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_RX_RINGS,
+	priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_TX_RINGS,
 			      GFP_KERNEL);
 	if (!priv->tx_cq) {
 		err = -ENOMEM;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mlx4_en: fix allocation of device tx_cq
  2013-02-23  0:58 [PATCH] mlx4_en: fix allocation of device tx_cq Kleber Sacilotto de Souza
@ 2013-02-23  7:05 ` Amir Vadai
  2013-02-23 18:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Vadai @ 2013-02-23  7:05 UTC (permalink / raw)
  To: Kleber Sacilotto de Souza; +Cc: davem, netdev

On 23/02/2013 02:58, Kleber Sacilotto de Souza wrote:
> The memory to hold the network device tx_cq is not being allocated with
> the correct size in mlx4_en_init_netdev(). It should use MAX_TX_RINGS
> instead of MAX_RX_RINGS. This can cause problems if the number of tx
> rings being used is greater than MAX_RX_RINGS.
> 
> 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 5088dc5..5944dd6 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2067,7 +2067,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
>  		err = -ENOMEM;
>  		goto out;
>  	}
> -	priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_RX_RINGS,
> +	priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_TX_RINGS,
>  			      GFP_KERNEL);
>  	if (!priv->tx_cq) {
>  		err = -ENOMEM;
> 

(sorry for double posting - tried to send from my tablet in plain text
without success).

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mlx4_en: fix allocation of device tx_cq
  2013-02-23  0:58 [PATCH] mlx4_en: fix allocation of device tx_cq Kleber Sacilotto de Souza
  2013-02-23  7:05 ` Amir Vadai
@ 2013-02-23 18:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-02-23 18:54 UTC (permalink / raw)
  To: klebers; +Cc: amirv, netdev

From: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Date: Fri, 22 Feb 2013 21:58:02 -0300

> The memory to hold the network device tx_cq is not being allocated with
> the correct size in mlx4_en_init_netdev(). It should use MAX_TX_RINGS
> instead of MAX_RX_RINGS. This can cause problems if the number of tx
> rings being used is greater than MAX_RX_RINGS.
> 
> Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-23 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-23  0:58 [PATCH] mlx4_en: fix allocation of device tx_cq Kleber Sacilotto de Souza
2013-02-23  7:05 ` Amir Vadai
2013-02-23 18:54 ` David Miller

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.