Re: [PATCH] mlx4: properly mask MGM entry members count

Aleksey Senin
2010-11-16T09:38:45Z

On Mon, Nov 15, 2010 at 4:08 PM, Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> The members_count field size is 24 bits so mask it properly when reading it.
>
> Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
> ---
>  drivers/net/mlx4/mcg.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
> index c4f88b7..fff20fc 100644
> --- a/drivers/net/mlx4/mcg.c
> +++ b/drivers/net/mlx4/mcg.c
> @@ -187,7 +187,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
>                memcpy(mgm->gid, gid, 16);
>        }
>
> -       members_count = be32_to_cpu(mgm->members_count);
> +       members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
>        if (members_count == MLX4_QP_PER_MGM) {
>                mlx4_err(dev, "MGM at index %x is full.\n", index);
>                err = -ENOMEM;
> --
> 1.6.0.2
>

Don't you need to do the same when detaching?