fio: add fdp support for io_uring_cmd nvme engine Add support for NVMe TP4146 Flexible Data Placemen, allowing placement identifiers in write commands. The user can enabled this with the new "fdp=1" parameter for fio's io_uring_cmd ioengine. By default, the fio jobs will cycle through all the namespace's available placement identifiers for write commands. The user can limit which placement identifiers can be used with additional parameter, "fdp_pli=<list,>", which can be used to separate write intensive jobs from less intensive ones. Setting up your namespace for FDP is outside the scope of 'fio', so this assumes the namespace is already properly configured for the mode. Link: https://lore.kernel.org/fio/CAKi7+wfX-eaUD5pky5cJ824uCzsQ4sPYMZdp3AuCUZOA1TQrYw@mail.gmail.com/T/#m056018eb07229bed00d4e589f9760b2a2aa009fc Based-on-a-patch-by: Ankit Kumar <ankit.kumar@samsung.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> [Vincent: fold in sfree fix from Ankit] Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Makefile: add -Wno-stringop-truncation for y.tab.o This file is auto-generated, and it currently spews the following warning for me: In function ‘setup_to_parse_string’, inlined from ‘evaluate_arithmetic_expression’ at y.tab.c:1571:2: y.tab.c:1559:9: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation] 1559 | strncpy(lexer_input_buffer, string, len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ y.tab.c:1556:19: note: length computed here 1556 | if (len > strlen(string)) | ^~~~~~~~~~~~~~ when compiled with: gcc (Debian 12.2.0-14) 12.2.0 Just set -Wno-stringop-truncation unconditionally in the Makefile for this file, don't think there's any point in checking if this warning has been enabled manually. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add a libblkio engine The libblkio library provides a unified API for efficiently accessing block devices using modern high-performance block I/O interfaces like io_uring and vhost-user-blk. Using libblkio reduces the amount of code needed for interfacing with storage devices and allows developers to focus on their applcations. Add a libblkio engine that uses libblkio to perform I/O. This is useful to benchmark the library itself, and also adds support for storage interfaces and devices otherwise not supported by fio, such as virtio-blk PCI, vhost-user, and vhost-vDPA devices. See the libblkio documentation [2] or KVM Forum 2022 [3] presentation for more information on the library itself. [1] https://gitlab.com/libblkio/libblkio [2] https://libblkio.gitlab.io/libblkio/index.html [3] https://static.sched.com/hosted_files/kvmforum2022/8c/libblkio-kvm-forum-2022.pdf Signed-off-by: Alberto Faria <afaria@redhat.com> Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
nvme: add nvme opcodes, structures and helper functions Add NVMe specification opcodes, data structures and helper functions to get identify namespace and form nvme uring command. This will help the follow up patches to get nvme-ns generic character device size, lba size. Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Co-authored-by: Anuj Gupta <anuj20.g@samsung.com> Link: https://lore.kernel.org/r/20220531133155.17493-5-ankit.kumar@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile: Suppress `-Wimplicit-fallthrough` when compiling `lex.yy` lex.yy.c is an auto generated C file. When compiling with clang-15, we got the following warning: ``` CC lex.yy.o lex.yy.c:1444:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] case EOB_ACT_END_OF_FILE: ^ lex.yy.c:1444:5: note: insert '__attribute__((fallthrough));' to silence this warning case EOB_ACT_END_OF_FILE: ^ __attribute__((fallthrough)); lex.yy.c:1444:5: note: insert 'break;' to avoid fall-through case EOB_ACT_END_OF_FILE: ^ break; 1 warning generated. ``` There is nothing we can do to fix lex.yy.c since it's an auto generated file. Fix this by appending `-Wno-implicit-fallthrough` when compiling this file if we have `-Wimplicit-fallthrough` flag enabled. Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220512164333.46516-4-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/xnvme: add xnvme engine This patch introduces a new fio engine to work with xNVMe >= 0.2.0. xNVMe provides a user space library (libxnvme) to work with NVMe devices. The NVMe driver being used by libxnvme is re-targetable and can be any one of the GNU/Linux Kernel NVMe driver via libaio, IOCTLs, io_uring, the SPDK NVMe driver, or your own custom NVMe driver. For more info visit https://xnvme.io https://github.com/OpenMPDK/xNVMe Co-Authored-By: Ankit Kumar <ankit.kumar@samsung.com> Co-Authored-By: Simon A. F. Lund <simon.lund@samsung.com> Co-Authored-By: Mads Ynddal <m.ynddal@samsung.com> Co-Authored-By: Michael Bang <mi.bang@samsung.com> Co-Authored-By: Karl Bonde Torp <k.torp@samsung.com> Co-Authored-By: Gurmeet Singh <gur.singh@samsung.com> Co-Authored-By: Pierre Labat <plabat@micron.com> Link: https://lore.kernel.org/r/20220511163019.5608-2-ankit.kumar@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
fuzz: avoid building t/fuzz/parse_ini by default With a vanilla build t/fuzz/parse_ini will segfault because the symbol FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is not defined. If the symbol FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is defined, fio won't tear down shared memory on program termination. Not tearing down shared memory is necessary for t/fuzz/parse_ini to work correctly. Don't build t/fuzz/parse_ini unless CFLAGS contains -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION. Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
fio: really use LDFLAGS when linking dynamic engines Fix stupid braino on my part. Fixes: 2b3d4a6a924e ("fio: use LDFLAGS when linking dynamic engines") Signed-off-by: Eric Sandeen <sandeen@redhat.com> Link: https://lore.kernel.org/r/1644336039-12774-1-git-send-email-sandeen@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile: build t/fio-dedupe only if zlib support is found df284fbdc23974c931865a8ddb7d171606b3c778 added zlib support as a requirement for building fio-dedupe. The current patch changes the Makefile to avoid trying to build fio-dedupe when zlib support is not present. Link: https://lore.kernel.org/fio/51b79acb-c314-143b-514c-a22ff9462829@gmail.com/T/#u Reported-by: Professor Pro <annivation@gmail.com> Signed-off-by: Vincent Fu <vincent.fu@samsung.com> Link: https://lore.kernel.org/r/20220128214611.165312-1-vincent.fu@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile: Fix android compilation Inclue cmdprio for Android as well. Without the patch, make for Android fails at link time: engines/io_uring.c:824: error: undefined reference to 'fio_cmdprio_init' engines/io_uring.c:456: error: undefined reference to 'fio_cmdprio_set_ioprio' ... Fixes e27b9ff0e ("cmdprio: move cmdprio function definitions to a new cmdprio.c file") Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Link: https://lore.kernel.org/r/20211117221918.3050439-1-gwendal@chromium.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
cmdprio: move cmdprio function definitions to a new cmdprio.c file Move cmdprio function definitions from the cmdprio.h header file to a new cmdprio.c file, such that we can add new static functions to cmdprio.c. A follow up patch will add new cmdprio functions which do not need to be directly accessible by ioengines. Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Link: https://lore.kernel.org/r/20211112095428.158300-3-Niklas.Cassel@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>