NVMe specification allow multiple ranges for the dataset management command. The block ioctl only accepts a single entry for trim, but with nvme character device we can send multiple ranges. The first patch in this series adds an option num_range to send multiple range per trim request. This will only work if the data direction is solely trim i.e. trim or randtrim. The next two patches in this series updates io_uring_cmd ioengine with the required changes. Note: The first patch which changes the io_u request for multiple ranges can be used in future for NVMe copy command which copies multiple source range entries to single destination. Changes since v1: - Remove unnecessary else conditions and bump server version as suggested by Jens. - Separate function to fill buffer with source range entries as suggested by Jens. - Debug log for trim offsets and man page update for num_range as suggested by Vincent. Ankit Kumar (3): trim: add support for multiple ranges engines/nvme: pass offset and len instead of io_u engines/io_uring: add multi range dsm support HOWTO.rst | 9 +++ backend.c | 20 ++++- cconv.c | 2 + engines/io_uring.c | 34 +++++++-- engines/nvme.c | 72 +++++++++++------- engines/nvme.h | 7 +- examples/uring-cmd-trim-multi-range.fio | 21 ++++++ fio.1 | 7 ++ fio.h | 18 +++++ init.c | 13 ++++ io_u.c | 97 +++++++++++++++++++++---- io_u.h | 4 + ioengines.h | 2 + options.c | 11 +++ server.h | 2 +- thread_options.h | 3 + 16 files changed, 266 insertions(+), 56 deletions(-) create mode 100644 examples/uring-cmd-trim-multi-range.fio -- 2.25.1