mbox series

[liburing,v3,0/5] Add basic test for nvme uring passthrough commands

Message ID 20220728093327.32580-1-ankit.kumar@samsung.com (mailing list archive)
Headers show
Series Add basic test for nvme uring passthrough commands | expand

Message

Ankit Kumar July 28, 2022, 9:33 a.m. UTC
This patchset adds a way to test NVMe uring passthrough commands with
nvme-ns character device. The uring passthrough was introduced with 5.19
io_uring.

To send nvme uring passthrough commands we require helpers to fetch NVMe
char device (/dev/ngXnY) specific fields such as namespace id, lba size etc.

How to run:
./test/io_uring_passthrough.t /dev/ng0n1

It requires argument to be NVMe device, if not the test will be skipped.

The test covers write/read with verify for sqthread poll, vectored / nonvectored
and fixed IO buffers, which can be extended in future. As of now iopoll is not
supported for passthrough commands, there is a test for such case.

Changes from v2 to v3
 - Skip test if argument is not nvme device and remove prints, as
   suggested by Jens.
 - change nvme helper function name, as pointed by Jens.
 - Remove wrong comment about command size, as per Kanchan's review

Ankit Kumar (5):
  configure: check for nvme uring command support
  io_uring.h: sync sqe entry with 5.20 io_uring
  nvme: add nvme opcodes, structures and helper functions
  test: add io_uring passthrough test
  test/io_uring_passthrough: add test case for poll IO

 configure                       |  20 ++
 src/include/liburing/io_uring.h |  17 +-
 test/Makefile                   |   1 +
 test/io_uring_passthrough.c     | 390 ++++++++++++++++++++++++++++++++
 test/nvme.h                     | 168 ++++++++++++++
 5 files changed, 594 insertions(+), 2 deletions(-)
 create mode 100644 test/io_uring_passthrough.c
 create mode 100644 test/nvme.h

Comments

Jens Axboe July 28, 2022, 12:36 p.m. UTC | #1
On 7/28/22 3:33 AM, Ankit Kumar wrote:
> This patchset adds a way to test NVMe uring passthrough commands with
> nvme-ns character device. The uring passthrough was introduced with 5.19
> io_uring.
> 
> To send nvme uring passthrough commands we require helpers to fetch NVMe
> char device (/dev/ngXnY) specific fields such as namespace id, lba size etc.
> 
> How to run:
> ./test/io_uring_passthrough.t /dev/ng0n1
> 
> It requires argument to be NVMe device, if not the test will be skipped.
> 
> The test covers write/read with verify for sqthread poll, vectored / nonvectored
> and fixed IO buffers, which can be extended in future. As of now iopoll is not
> supported for passthrough commands, there is a test for such case.
> 
> Changes from v2 to v3
>  - Skip test if argument is not nvme device and remove prints, as
>    suggested by Jens.
>  - change nvme helper function name, as pointed by Jens.
>  - Remove wrong comment about command size, as per Kanchan's review

I didn't get patch 2/5, and lore didn't either. Can you resend the series?
Ankit Kumar July 28, 2022, 1:01 p.m. UTC | #2
On Thu, Jul 28, 2022 at 06:36:51AM -0600, Jens Axboe wrote:
> On 7/28/22 3:33 AM, Ankit Kumar wrote:
> > This patchset adds a way to test NVMe uring passthrough commands with
> > nvme-ns character device. The uring passthrough was introduced with 5.19
> > io_uring.
> > 
> > To send nvme uring passthrough commands we require helpers to fetch NVMe
> > char device (/dev/ngXnY) specific fields such as namespace id, lba size etc.
> > 
> > How to run:
> > ./test/io_uring_passthrough.t /dev/ng0n1
> > 
> > It requires argument to be NVMe device, if not the test will be skipped.
> > 
> > The test covers write/read with verify for sqthread poll, vectored / nonvectored
> > and fixed IO buffers, which can be extended in future. As of now iopoll is not
> > supported for passthrough commands, there is a test for such case.
> > 
> > Changes from v2 to v3
> >  - Skip test if argument is not nvme device and remove prints, as
> >    suggested by Jens.
> >  - change nvme helper function name, as pointed by Jens.
> >  - Remove wrong comment about command size, as per Kanchan's review
> 
> I didn't get patch 2/5, and lore didn't either. Can you resend the series?
> 
> -- 
> Jens Axboe
> 
>
Sorry, issue from my side it. You should have 2/5 now and I see its there in
lore as well. Hope its sufficient and doesn't require me to resend the entire series
again.
Jens Axboe July 28, 2022, 1:10 p.m. UTC | #3
On 7/28/22 7:01 AM, Ankit Kumar wrote:
> On Thu, Jul 28, 2022 at 06:36:51AM -0600, Jens Axboe wrote:
>> On 7/28/22 3:33 AM, Ankit Kumar wrote:
>>> This patchset adds a way to test NVMe uring passthrough commands with
>>> nvme-ns character device. The uring passthrough was introduced with 5.19
>>> io_uring.
>>>
>>> To send nvme uring passthrough commands we require helpers to fetch NVMe
>>> char device (/dev/ngXnY) specific fields such as namespace id, lba size etc.
>>>
>>> How to run:
>>> ./test/io_uring_passthrough.t /dev/ng0n1
>>>
>>> It requires argument to be NVMe device, if not the test will be skipped.
>>>
>>> The test covers write/read with verify for sqthread poll, vectored / nonvectored
>>> and fixed IO buffers, which can be extended in future. As of now iopoll is not
>>> supported for passthrough commands, there is a test for such case.
>>>
>>> Changes from v2 to v3
>>>  - Skip test if argument is not nvme device and remove prints, as
>>>    suggested by Jens.
>>>  - change nvme helper function name, as pointed by Jens.
>>>  - Remove wrong comment about command size, as per Kanchan's review
>>
>> I didn't get patch 2/5, and lore didn't either. Can you resend the series?
>>
>> -- 
>> Jens Axboe
>>
>>
> Sorry, issue from my side it. You should have 2/5 now and I see its
> there in lore as well. Hope its sufficient and doesn't require me to
> resend the entire series again.

Yep I got it, and I've now applied it. Did a few cleanups on top, but
nothing major. Thanks!
Jens Axboe July 28, 2022, 1:10 p.m. UTC | #4
On Thu, 28 Jul 2022 15:03:22 +0530, Ankit Kumar wrote:
> This patchset adds a way to test NVMe uring passthrough commands with
> nvme-ns character device. The uring passthrough was introduced with 5.19
> io_uring.
> 
> To send nvme uring passthrough commands we require helpers to fetch NVMe
> char device (/dev/ngXnY) specific fields such as namespace id, lba size etc.
> 
> [...]

Applied, thanks!

[1/5] configure: check for nvme uring command support
      commit: 7fc6c1e89f1b83f2bb80a974a40126d10ab95d46
[2/5] io_uring.h: sync sqe entry with 5.20 io_uring
      commit: 893b9d13b7571eb99d124c0804c48e331b4dbe3b
[3/5] nvme: add nvme opcodes, structures and helper functions
      commit: 612101cc61063eed06d5bd232b1ab7a43732f227
[4/5] test: add io_uring passthrough test
      commit: b593422fd0d624b6d1a59d0cc5a674dfdf22db6e
[5/5] test/io_uring_passthrough: add test case for poll IO
      commit: ba10a0e0b3039aab43352f08631845f25aa2b225

Best regards,