All of lore.kernel.org
 help / color / mirror / Atom feed
* discard cmd through ioctl
@ 2015-02-06 18:28 sheng qiu
  2015-02-06 20:02 ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: sheng qiu @ 2015-02-06 18:28 UTC (permalink / raw)


Hi,

May i ask is there a way to issue data set management cmd from
application to achieve discard function with current NVMe driver?

i see there are regular IO or Admin interface for ioctl at driver
side. Is this also applicable to dsm cmd?

Thanks,
Sheng

^ permalink raw reply	[flat|nested] 5+ messages in thread

* discard cmd through ioctl
  2015-02-06 18:28 discard cmd through ioctl sheng qiu
@ 2015-02-06 20:02 ` Keith Busch
  2015-02-06 23:04   ` sheng qiu
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2015-02-06 20:02 UTC (permalink / raw)


On Fri, 6 Feb 2015, sheng qiu wrote:
> Hi,
>
> May i ask is there a way to issue data set management cmd from
> application to achieve discard function with current NVMe driver?
>
> i see there are regular IO or Admin interface for ioctl at driver
> side. Is this also applicable to dsm cmd?

Sure, you can use the NVME_IOCTL_IO_CMD to submit any arbitary IO command
you like.

It would probably be easier to use sg_unmap or blkdiscard to achieve the
same thing unless you require using the DSM command's other attributes
in addition to deallocate.

> Thanks,
> Sheng

^ permalink raw reply	[flat|nested] 5+ messages in thread

* discard cmd through ioctl
  2015-02-06 20:02 ` Keith Busch
@ 2015-02-06 23:04   ` sheng qiu
  2015-02-07  2:52     ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: sheng qiu @ 2015-02-06 23:04 UTC (permalink / raw)


Hi Keith,

thanks for your reply.
for the struct "nvme_passthru_cmd", can you tell me what's the "flags"
and "rsvd1" used for? which cmd filed does it associated to the NVMe
Spec?

just want to make sure i am composing the correct cmd format.

THanks!
Sheng

On Fri, Feb 6, 2015@12:02 PM, Keith Busch <keith.busch@intel.com> wrote:
> On Fri, 6 Feb 2015, sheng qiu wrote:
>>
>> Hi,
>>
>> May i ask is there a way to issue data set management cmd from
>> application to achieve discard function with current NVMe driver?
>>
>> i see there are regular IO or Admin interface for ioctl at driver
>> side. Is this also applicable to dsm cmd?
>
>
> Sure, you can use the NVME_IOCTL_IO_CMD to submit any arbitary IO command
> you like.
>
> It would probably be easier to use sg_unmap or blkdiscard to achieve the
> same thing unless you require using the DSM command's other attributes
> in addition to deallocate.
>
>> Thanks,
>> Sheng

^ permalink raw reply	[flat|nested] 5+ messages in thread

* discard cmd through ioctl
  2015-02-06 23:04   ` sheng qiu
@ 2015-02-07  2:52     ` Keith Busch
  2015-03-16 21:03       ` sheng qiu
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2015-02-07  2:52 UTC (permalink / raw)


On Fri, 6 Feb 2015, sheng qiu wrote:
> Hi Keith,
>
> thanks for your reply.
> for the struct "nvme_passthru_cmd", can you tell me what's the "flags"
> and "rsvd1" used for? which cmd filed does it associated to the NVMe
> Spec?

The IOCTL's structure tries to match an NVMe command except for parts
user space has no way of knowing about; those parts are command id and
bus addresses.

The 'flags' are CDW0's bits 8-15, just after the opcode. The only spec
defined use for them is fuse and SGL, neither of which are supported by
the driver, so should be cleared to 0 for now.

'rsvd1' is for CDW3. The spec has no defined use for it, but we have a
field in the IOCTL's arg so we have a placeholder for it in the future
without breaking ABI.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* discard cmd through ioctl
  2015-02-07  2:52     ` Keith Busch
@ 2015-03-16 21:03       ` sheng qiu
  0 siblings, 0 replies; 5+ messages in thread
From: sheng qiu @ 2015-03-16 21:03 UTC (permalink / raw)


Hi all,

may i ask if there's any plan to support the fused command?

Thanks!
Sheng

On Fri, Feb 6, 2015@6:52 PM, Keith Busch <keith.busch@intel.com> wrote:
> On Fri, 6 Feb 2015, sheng qiu wrote:
>>
>> Hi Keith,
>>
>> thanks for your reply.
>> for the struct "nvme_passthru_cmd", can you tell me what's the "flags"
>> and "rsvd1" used for? which cmd filed does it associated to the NVMe
>> Spec?
>
>
> The IOCTL's structure tries to match an NVMe command except for parts
> user space has no way of knowing about; those parts are command id and
> bus addresses.
>
> The 'flags' are CDW0's bits 8-15, just after the opcode. The only spec
> defined use for them is fuse and SGL, neither of which are supported by
> the driver, so should be cleared to 0 for now.
>
> 'rsvd1' is for CDW3. The spec has no defined use for it, but we have a
> field in the IOCTL's arg so we have a placeholder for it in the future
> without breaking ABI.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-16 21:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 18:28 discard cmd through ioctl sheng qiu
2015-02-06 20:02 ` Keith Busch
2015-02-06 23:04   ` sheng qiu
2015-02-07  2:52     ` Keith Busch
2015-03-16 21:03       ` sheng qiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.