[PATCH v2] nvme: add vectored-io support for user-passthru
Kanchan Joshi
joshiiitr at gmail.com
Tue Feb 1 22:52:53 PST 2022
On Tue, Feb 1, 2022 at 1:32 PM Christoph Hellwig <hch at lst.de> wrote:
>
> > +static int nvme_user_cmd64(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
> > + struct nvme_passthru_cmd64 __user *ucmd)
> > +{
> > + return nvme_user_cmd64_common(ctrl, ns, ucmd, false);
> > +}
> > +
> > +static int nvme_user_cmd64_vec(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
> > + struct nvme_passthru_cmd64 __user *ucmd)
> > +{
> > + return nvme_user_cmd64_common(ctrl, ns, ucmd, true);
> > }
>
> I think we cn skip these tiny wrappers.
With the wrappers, the attempt was to retain nvme_user_cmd64
parameters so that we don't have to change all its invocations.
But sure, I can do away with that.
> > static bool is_ctrl_ioctl(unsigned int cmd)
> > @@ -341,6 +369,8 @@ static int nvme_ns_ioctl(struct nvme_ns *ns, unsigned int cmd,
> > return nvme_submit_io(ns, argp);
> > case NVME_IOCTL_IO64_CMD:
> > return nvme_user_cmd64(ns->ctrl, ns, argp);
> > + case NVME_IOCTL_IO64_CMD_VEC:
> > + return nvme_user_cmd64_vec(ns->ctrl, ns, argp);
>
> Maybe add a rationale why we don't need a new ioctl for admin
> commands to the commit log.
Not many admin commands are buffer-heavy and likely to have lower
invocation frequency too, so I did not think of adding support.
If you foresee this to be useful for some (maybe log-page or
fw-download), I can fold that in.
Thanks,
--
Kanchan
More information about the Linux-nvme
mailing list