lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Apr 2020 21:36:27 +0300
From:   Leon Romanovsky <leonro@...lanox.com>
To:     Jason Gunthorpe <jgg@...pe.ca>
Cc:     Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
        Moshe Shemesh <moshe@...lanox.com>, netdev@...r.kernel.org,
        Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH mlx5-next 02/24] net/mlx5: Update cq.c to new cmd
 interface

On Wed, Apr 22, 2020 at 03:32:14PM -0300, Jason Gunthorpe wrote:
> On Wed, Apr 22, 2020 at 07:49:48PM +0300, Leon Romanovsky wrote:
> > >  int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> > >  			u32 *in, int inlen)
> > >  {
> > > -	u32 out[MLX5_ST_SZ_DW(modify_cq_out)] = {0};
> > > -
> > >  	MLX5_SET(modify_cq_in, in, opcode, MLX5_CMD_OP_MODIFY_CQ);
> > >  	MLX5_SET(modify_cq_in, in, uid, cq->uid);
> > > -	return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
> > > +	return mlx5_cmd_exec_in(dev, modify_cq, in);
> > >  }
> > >  EXPORT_SYMBOL(mlx5_core_modify_cq);
> > >
> >
> > This hunk needs this fixup:
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
> > index 1a6f1f14da97..8379b24cb838 100644
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c
> > @@ -187,9 +187,11 @@ EXPORT_SYMBOL(mlx5_core_query_cq);
> >  int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
> >                         u32 *in, int inlen)
> >  {
> > +       u32 out[MLX5_ST_SZ_DW(modify_cq_out)] = {};
> > +
> >         MLX5_SET(modify_cq_in, in, opcode, MLX5_CMD_OP_MODIFY_CQ);
> >         MLX5_SET(modify_cq_in, in, uid, cq->uid);
> > -       return mlx5_cmd_exec_in(dev, modify_cq, in);
> > +       return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
> >  }
> >  EXPORT_SYMBOL(mlx5_core_modify_cq);
>
> Why doesn't this one work with the helper?

In the mlx5_ib_resize_cq() function inlen is equal to

1290         inlen = MLX5_ST_SZ_BYTES(modify_cq_in) +
1291                 MLX5_FLD_SZ_BYTES(modify_cq_in, pas[0]) * npas;

and not to MLX5_ST_SZ_BYTES(modify_cq_in) like helper assumes.

Thanks

>
> Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ