Skip to contentSkip to conversation

nvme-cli: add support for an abort command with documentation

PATCH New Minwoo Im 3 participants 7 messages Jan 24, 2018 – Jan 25, 2018 NVMe

lore
Share & tools
lore

Minwoo Im

author
#0 lore raw

cover nvme-cli: add support for an abort command with documentation

It would be convenient to use abort command by a subcommand. This command will strongly used by device developers to test device.

Minwoo Im (2):
nvme-cli: add support for an abort command
nvme-cli: add documentation for abort command

 Documentation/cmds-main.txt   |   2 +
 Documentation/nvme-abort.1    |  80 ++++
 Documentation/nvme-abort.html | 834 ++++++++++++++++++++++++++++++++++++++++++
 Documentation/nvme-abort.txt  |  51 +++
 nvme-builtin.h                |   1 +
 nvme-ioctl.c                  |  13 +
 nvme-ioctl.h                  |   1 +
 nvme.c                        |  50 +++
 8 files changed, 1032 insertions(+)
 create mode 100644 Documentation/nvme-abort.1
 create mode 100644 Documentation/nvme-abort.html
 create mode 100644 Documentation/nvme-abort.txt
Signature · 1 line
2.7.4
#1 lore raw

cover nvme-cli: add support for an abort command with documentation

Quoted 2 lines · Minwoo Im

It would be convenient to use abort command by a subcommand. This command will strongly used by device developers to test device.

Ahm... please no.

If you need it for development just hack a small tool to create the passthrough ioctl() call but don't hand out loaded guns to children^Wusers.

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
author
#2 lore raw

cover nvme-cli: add support for an abort command with documentation

Hello Johannes,

Quoted 9 lines · Johannes Thumshirn
Quoted 2 lines · Minwoo Im

It would be convenient to use abort command by a subcommand. This command will strongly used by device developers to test device.

Ahm... please no.

If you need it for development just hack a small tool to create the passthrough ioctl() call but don't hand out loaded guns to children^Wusers.

Thanks for your kindly comment.

I thought nvme-cli tool would be used mostly by developers, not children users. Also thought that it will not need any helps from kernel to abort a specified command not just like delete I/O SQ/CQ so that nvme-cli could handle this kind of thing.

But, actually there is no limit for anybody to use this interface tool. I agree what you're saying. So, please skip it.

Thanks,

#3 lore raw

cover nvme-cli: add support for an abort command with documentation

Quoted 13 lines · Minwoo Im

Hello Johannes,

Quoted 9 lines · Johannes Thumshirn
Quoted 2 lines · Minwoo Im

It would be convenient to use abort command by a subcommand. This command will strongly used by device developers to test device.

Ahm... please no.

If you need it for development just hack a small tool to create the passthrough ioctl() call but don't hand out loaded guns to children^Wusers.

Quoted 6 lines

Thanks for your kindly comment.

I thought nvme-cli tool would be used mostly by developers, not children users. Also thought that it will not need any helps from kernel to abort a specified command not just like delete I/O SQ/CQ so that nvme-cli could handle this kind of thing.

nvme-cli will also be used by administrators intending to setup nvme over fabrics connections or debug nvme multipathing as well. It is certainly not a developer only tool.

Quoted 1 line

But, actually there is no limit for anybody to use this interface tool.

Yes, actually thinking more of it, the whole passthrough interface is dangerous. What happens if a user sends a delete CQ/SQ command via this interface and the kernel still tries to do I/O to it?

I think I'll need to come up with a testcase for this.

Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
author
#4 lore raw

cover nvme-cli: add support for an abort command with documentation

Quoted 16 lines · Johannes Thumshirn
Quoted 15 lines · Minwoo Im

Hello Johannes,

Quoted 9 lines · Johannes Thumshirn
Quoted 2 lines · Minwoo Im

It would be convenient to use abort command by a subcommand. This command will strongly used by device developers to test device.

Ahm... please no.

If you need it for development just hack a small tool to create the passthrough ioctl() call but don't hand out loaded guns to children^Wusers.

Thanks for your kindly comment.

Quoted 8 lines
Quoted 4 lines

I thought nvme-cli tool would be used mostly by developers, not children users. Also thought that it will not need any helps from kernel to abort a specified command not just like delete I/O SQ/CQ so that nvme-cli could handle this kind of thing.

nvme-cli will also be used by administrators intending to setup nvme over fabrics connections or debug nvme multipathing as well. It is certainly not a developer only tool.

Got it, Thanks for your kindly comment. :)

Quoted 5 lines
Quoted 1 line

But, actually there is no limit for anybody to use this interface tool.

Yes, actually thinking more of it, the whole passthrough interface is dangerous. What happens if a user sends a delete CQ/SQ command via this interface and the kernel still tries to do I/O to it

Yes, That situation is one of the reason why I tried to add abort command to nvme-cli because it does not need any helps from kernel. As you said, delete CQ/SQ obviously needs helps from kernel to free resources about queues.

Or.. Is there any cases that breaks behavior of kernel by an abort command from user space?

Thanks,

#5 lore raw

cover nvme-cli: add support for an abort command with documentation

Quoted 3 lines · Minwoo Im

Or.. Is there any cases that breaks behavior of kernel by an abort command from user space?

Is it possible yes. Is it simple, no.?? Depends on what the command is and when.? You may confuse a transport which uses aborts - and you're also mandating the transport peek into the pass-through command to check for abort so that is can honor the # of outstanding aborts supported by the controller.

I agree with Johannes. this is an ugly thing to do . The first question I had is - how do you even know what the command and its CID value is ?? Also, many devices won't actually even do aborts.

-- james

author
#6 lore raw

cover nvme-cli: add support for an abort command with documentation

Hi James,

Quoted 11 lines · James Smart
Quoted 3 lines · Minwoo Im

Or.. Is there any cases that breaks behavior of kernel by an abort command from user space?

Is it possible yes. Is it simple, no.?? Depends on what the command is and when.? You may confuse a transport which uses aborts - and you're also mandating the transport peek into the pass-through command to check for abort so that is can honor the # of outstanding aborts supported by the controller.

Quoted 6 lines

I agree with Johannes. this is an ugly thing to do . The first question I had is - how do you even know what the command and its CID value is ? Also, many devices won't actually even do aborts.

-- james

I totally agree with you. I really appreciate your comments. I thought abort command has nothing to do with behavior of kernel, but CID is assigned by kernel when issuing an command to device.

Thanks again.