netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation
@ 2012-01-02 14:07 Yevgeny Petrilin
  2012-01-02 22:05 ` Yinghai Lu
  2012-01-03 18:01 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Yevgeny Petrilin @ 2012-01-02 14:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, yevgenyp, marcela

From: Marcel Apfelbaum <marcela@mellanox.co.il>

The mtt range was allocated in mtt units but deallocated
in segments. Among the rest, this caused crash during hotplug removal

Reported-by: Yinghai Lu <yinghai@kernel.org> 
Signed-off-by: Marcel Apfelbaum <marcela@mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
---
 drivers/net/ethernet/mellanox/mlx4/mr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index f7243b2..01df556 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -239,8 +239,8 @@ void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
 	first_seg = offset / (1 << log_mtts_per_seg);
 
 	mlx4_buddy_free(&mr_table->mtt_buddy, first_seg, seg_order);
-	mlx4_table_put_range(dev, &mr_table->mtt_table, first_seg,
-			     first_seg + (1 << seg_order) - 1);
+	mlx4_table_put_range(dev, &mr_table->mtt_table, offset,
+			     offset + (1 << order) - 1);
 }
 
 static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
-- 
1.7.7

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

* Re: [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation
  2012-01-02 14:07 [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation Yevgeny Petrilin
@ 2012-01-02 22:05 ` Yinghai Lu
  2012-01-03 18:01 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Yinghai Lu @ 2012-01-02 22:05 UTC (permalink / raw)
  To: Yevgeny Petrilin; +Cc: davem, netdev, marcela

On Mon, Jan 2, 2012 at 6:07 AM, Yevgeny Petrilin
<yevgenyp@mellanox.co.il> wrote:
> From: Marcel Apfelbaum <marcela@mellanox.co.il>
>
> The mtt range was allocated in mtt units but deallocated
> in segments. Among the rest, this caused crash during hotplug removal
>
> Reported-by: Yinghai Lu <yinghai@kernel.org>
> Signed-off-by: Marcel Apfelbaum <marcela@mellanox.co.il>
> Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
> ---
>  drivers/net/ethernet/mellanox/mlx4/mr.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
> index f7243b2..01df556 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mr.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
> @@ -239,8 +239,8 @@ void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)
>        first_seg = offset / (1 << log_mtts_per_seg);
>
>        mlx4_buddy_free(&mr_table->mtt_buddy, first_seg, seg_order);
> -       mlx4_table_put_range(dev, &mr_table->mtt_table, first_seg,
> -                            first_seg + (1 << seg_order) - 1);
> +       mlx4_table_put_range(dev, &mr_table->mtt_table, offset,
> +                            offset + (1 << order) - 1);
>  }
>
>  static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order)

Tested-by: Yinghai Lu <yinghai@kernel.org>

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

* Re: [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation
  2012-01-02 14:07 [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation Yevgeny Petrilin
  2012-01-02 22:05 ` Yinghai Lu
@ 2012-01-03 18:01 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-01-03 18:01 UTC (permalink / raw)
  To: yevgenyp; +Cc: netdev, marcela

From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Mon, 2 Jan 2012 16:07:39 +0200

> From: Marcel Apfelbaum <marcela@mellanox.co.il>
> 
> The mtt range was allocated in mtt units but deallocated
> in segments. Among the rest, this caused crash during hotplug removal
> 
> Reported-by: Yinghai Lu <yinghai@kernel.org> 
> Signed-off-by: Marcel Apfelbaum <marcela@mellanox.co.il>
> Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>

Applied.

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

end of thread, other threads:[~2012-01-03 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-02 14:07 [PATCH net-next 1/2] mlx4_core: fix mtt range deallocation Yevgeny Petrilin
2012-01-02 22:05 ` Yinghai Lu
2012-01-03 18:01 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).