Messages in this thread | | | Date | Wed, 18 Oct 2023 08:51:51 -0300 | From | Jason Gunthorpe <> | Subject | Re: [PATCH 5/5] misc: mlx5ctl: Add umem reg/unreg ioctl |
| |
On Wed, Oct 18, 2023 at 11:30:24AM +0200, Arnd Bergmann wrote:
> > +struct mlx5ctl_umem_reg { > > + __aligned_u64 addr; /* user address */ > > + __aligned_u64 len; /* user buffer length */ > > + __aligned_u64 flags; > > + __u32 umem_id; /* returned device's umem ID */ > > + __u32 reserved[7]; > > +}; > > + > > You have a 'flags' argument that is never accessed and can > probably be removed. If the intention was to make the ioctl > extensible for the future, this doesn't work unless you > ensure that only known flags (i.e. none at this point) > are set,
Yes, all the reserved fields and flags should be checked for 0 in the ioctl paths to allow them to be used for something else someday.
> and it's probably a bad idea anyway, compared > to creating a new ioctl command with new semantics.
This has been done successfully quite often in the kernel.
Thanks, Jason
| |