[ofa-general] Re: [PATCH] mlx4: Do not invoke mlx4_bitmap_free for special QPs

Jack Morgenstein jackm at dev.mellanox.co.il
Tue Aug 7 23:26:26 PDT 2007


On Tuesday 07 August 2007 22:49, Roland Dreier wrote:
>  > mlx4_bitmap_free should not be called for special QPs.
> 
> I think I'd rather fix this problem like the patch below.  Does this
> look OK to you?
> 
Yes, it does.  The same calculation (dev->caps.sqp_start + 8) is
used when creating the bitmap, for the reserved values, so your
version is actually more correct (i.e., don't free reserved values).

Also, obviously, no prototype changes are needed.

- Jack

> 
> diff --git a/drivers/net/mlx4/qp.c b/drivers/net/mlx4/qp.c
> index 19b48c7..278414b 100644
> --- a/drivers/net/mlx4/qp.c
> +++ b/drivers/net/mlx4/qp.c
> @@ -240,7 +240,8 @@ void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp)
>  	mlx4_table_put(dev, &qp_table->auxc_table, qp->qpn);
>  	mlx4_table_put(dev, &qp_table->qp_table, qp->qpn);
>  
> -	mlx4_bitmap_free(&qp_table->bitmap, qp->qpn);
> +	if (qp->qpn < dev->caps.sqp_start + 8)
> +		mlx4_bitmap_free(&qp_table->bitmap, qp->qpn);
>  }
>  EXPORT_SYMBOL_GPL(mlx4_qp_free);
>  
> 



More information about the general mailing list