engines/io_uring: add multi range dsm support Update the io_uring_cmd ioengine to support multiple ranges for trim. This includes allocating buffer for multiple ranges, and changes to the nvme trim helper functions. Add an example on how to use multi range trim. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Link: https://lore.kernel.org/r/20240215151812.138370-4-ankit.kumar@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/nvme: pass offset and len instead of io_u Remove io_u dependency while calculating start and number of lba. This is a prep patch for multi-range trim support where an io_u entry will contain multiple start offset and buffer len. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Link: https://lore.kernel.org/r/20240215151812.138370-3-ankit.kumar@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/xnvme: add checks for verify, block size and metadata size Add checks to ensure that the correct block size and metadata size is passed by the user. Disable normal verify checks when end to end data protection checks are enabled because of CRC conflict. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/20240213153315.134202-5-ankit.kumar@samsung.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines:xnvme: add support for end to end data protection This patch enables support for protection information to xnvme ioengine. This adds 4 new ioengine specific options * pi_act - Protection information action. Default: 1 * pi_chk - Can be set to GUARD, APPTAG or REFTAG * apptag - Sets apptag field of command dword 15 * apptag_mask - Sets apptag_mask field of command dword 15 For the sake of consistency these options are the same as the ones used by io_uring_cmd ioengine and SPDK's external ioengine. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/20240213153315.134202-4-ankit.kumar@samsung.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines/xnvme: add support for metadata This enables support for separate metadata buffers with xnvme ioengine. This is done by providing xnvme specific option md_per_io_size, which for the sake of consistency is the same option used by io_uring_cmd engine and SPDK's external ioengine. Bump up the required xnvme support to v0.7.4 Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/20240213153315.134202-3-ankit.kumar@samsung.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines/xnvme: allocate iovecs only if vectored I/O is enabled Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Link: https://lore.kernel.org/r/20240213153315.134202-2-ankit.kumar@samsung.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Add support for VSOCK to engine/net.c * configure: add option to enable/disable vsock support * engines/net.c: add vsock support The VSOCK address family facilitates communication between virtual machines and the host they are running on. The addressing is formed by 2 integers: <CID, port> - CID: Context ID, it is the ID assigned to the VM 0, 1, 2 CIDs are reserved: 0 - hypervisor CID (rarely used) 1 - local communication (loopback) 2 - host CID (the guest can always reach the host using CID=2) - port: port number on 32bit to reach a specific process * examples: add 3 simple job files for vsock (one sender, one receiver and one that uses vsock loopback interface similar to examples/netio.fio) * fio.1: add vsock to supported protocols together with the required parameters * HOWTO.rst: add vsock to supported protocols together with the required parameters Signed-off-by: Marco Pinna <marco.pinn95@gmail.com>
engines/io_uring_cmd: skip pi verify checks for error cases If any error is observed for read requests, skip all end to end data protection checks. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Link: https://lore.kernel.org/r/20231212144718.568406-1-ankit.kumar@samsung.com Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines/io_uring_cmd: friendlier bad bs error msg It can tricky to specify block sizes for devices formatted in extended LBA mode because the block sizes are no longer powers of two. Add a suggested block size in the error message when we abort a job because the specified block size is not a multiple of the extended LBA size. Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
engines/xnvme: only include entry-header ('libxnvme.h') This changes how the xNVMe fio io-engine consumes the xNVMe library by only including the library-entry header "libxnvme.h". From version 0.7.0 the xNVMe API headers are refactored to drop header guards on the individual headers and abide by the idiom of "headers must not include other headers". The exception is the library-entry header "libxnvme.h". The library-entry-header includes all headers provided with xNVMe, which is a convenient approach to consuming the library. One where, in case the API namespace grows or shrinks, then the xNVMe fio io-engine need not change how it includes xNVMe. However, since fio has consumed the main-entry header and individual headers, xNVMe has held back on removing the guards on _nvm, _zns, and _spec to avoid breaking the xNVMe fio engine. They will eventually be deprecated. Thus, this change to consume xNVMe in the manner intended from version v0.7.0 and onwards. Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
engines/xnvme: fix fdp support for userspace drivers The xNVMe backend supports FDP commands for userspace drivers such as SPDK. Enable support in the xnvme ioengine. Update the xnvme fdp example file accordingly. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Link: https://lore.kernel.org/r/20231102135928.195372-1-ankit.kumar@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring_cmd: allocate enough ranges for async trims We round up the iodepth to the next highest power of 2. So io_u->index can be greater than the iodepth specified by the user. Make sure we allocate enough of the buffers used to store the ranges for async trim commands when the iodepth specified by the user is not a power of 2. Fixes: 4885a6eba420ce216e4102df3e42229e167d1b7b ("engines/io_uring_cmd: make trims async") Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
nfs: Fix incorrect engine registering for '--enghelp' list `ioengine` from `nfs` (internal) engine is incorrectly exported thus overriding its value in constructor callbacks of other external engines, that are used for registering engine for listing with `--enghelp`. Because flist is unsafe to double adding it also making `engine_list` to become corrupt and causing infinite loop or abnormal list termination when printing engine list. Issue: https://github.com/axboe/fio/issues/1655 Fixes: 9326926b ("NFS engine") Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
engines:io_uring_cmd: disallow verify for e2e pi with extended blocks For extended logical block sizes we cannot use verify when end to end data protection checks are enabled. The CRC field in PI section of data buffer creates conflict during verify phase. The verify check is also redundant as end to end data protection already ensures data integrity. So disallow use of verify for this case. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>