Re: [PATCH rdma-next 1/3] IB/mlx4: Align query device response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 07, 2018 at 04:21:12PM -0700, Jason Gunthorpe wrote:
> On Mon, Feb 26, 2018 at 03:02:21PM +0200, Leon Romanovsky wrote:
>
> > diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> > index 8d2ee9322f2e..cd6b81ef4f5a 100644
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -584,8 +584,9 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
> >  			sizeof(struct mlx4_wqe_data_seg);
> >  	}
> >
> > -	if (uhw->outlen >= resp.response_length + sizeof(resp.rss_caps)) {
> > -		resp.response_length += sizeof(resp.rss_caps);
> > +	if (uhw->outlen >= resp.response_length + sizeof(resp.rss_caps) +
> > +	    sizeof(resp.reserved)) {
> > +		resp.response_length += sizeof(resp.rss_caps) + sizeof(resp.reserved);
> >  		if (props->rss_caps.supported_qpts) {
> >  			resp.rss_caps.rx_hash_function =
> >  				MLX4_IB_RX_HASH_FUNC_TOEPLITZ;
>
> This is a bug today even on 64 bit, although it seems basically
> harmless because of the existing padding.
>
> I assume this bug is why the missing padding was noticed?
>

Yes, you are right.

> Anyhow, can we please fix this sanely? Adding in the reserved just
> seems so ugly and frail..

Our mlx4 driver is in steady state, and we would prefer to minimize
changes in that area, however we'll take your note as an action for
any future changes in that area.

Thanks

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux