linux/tools/testing/selftests/ublk
Ming Lei 9b2785ea85 ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device
Add a new command line option --no_ublk_fixed_fd that excludes the ublk
control device (/dev/ublkcN) from io_uring's registered files array.
When this option is used, only backing files are registered starting
from index 1, while the ublk control device is accessed using its raw
file descriptor.

Add ublk_get_registered_fd() helper function that returns the appropriate
file descriptor for use with io_uring operations.

Key optimizations implemented:
- Cache UBLKS_Q_NO_UBLK_FIXED_FD flag in ublk_queue.flags to avoid
  reading dev->no_ublk_fixed_fd in fast path
- Cache ublk char device fd in ublk_queue.ublk_fd for fast access
- Update ublk_get_registered_fd() to use ublk_queue * parameter
- Update io_uring_prep_buf_register/unregister() to use ublk_queue *
- Replace ublk_device * access with ublk_queue * access in fast paths

Also pass --no_ublk_fixed_fd to test_stress_04.sh for covering
plain ublk char device mode.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250827121602.2619736-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-08-28 07:56:57 -06:00
..
trace selftests: ublk: add functional test for per io daemons 2025-05-31 14:38:48 -06:00
.gitignore
Makefile selftests: ublk: cover PER_IO_DAEMON in more stress tests 2025-06-02 12:00:31 -06:00
common.c selftests: ublk: move common code into common.c 2025-03-22 08:35:08 -06:00
config
fault_inject.c selftests: ublk: pass 'ublk_thread *' to more common helpers 2025-07-15 08:04:17 -06:00
file_backed.c ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
kublk.c ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
kublk.h ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
null.c ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
stripe.c ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
test_common.sh selftests: ublk: add stress test for per io daemons 2025-05-31 14:38:53 -06:00
test_generic_01.sh selftests: ublk: add generic_01 for verifying sequential IO order 2025-03-22 08:35:08 -06:00
test_generic_02.sh selftests: ublk: add more tests for covering MQ 2025-03-28 16:15:43 -06:00
test_generic_03.sh selftests: ublk: add test for checking zero copy related parameter 2025-03-28 16:15:43 -06:00
test_generic_04.sh selftests: ublk: add test for UBLK_F_QUIESCE 2025-05-23 09:42:12 -06:00
test_generic_05.sh selftests: ublk: add test for UBLK_F_QUIESCE 2025-05-23 09:42:12 -06:00
test_generic_06.sh selftests: ublk: make test_generic_06 silent on success 2025-05-05 16:54:52 -06:00
test_generic_07.sh selftests: ublk: fix UBLK_F_NEED_GET_DATA 2025-04-29 06:01:36 -06:00
test_generic_08.sh selftests: ublk: support UBLK_F_AUTO_BUF_REG 2025-05-20 10:24:45 -06:00
test_generic_09.sh selftests: ublk: add test for covering UBLK_AUTO_BUF_REG_FALLBACK 2025-05-20 10:24:45 -06:00
test_generic_10.sh selftests: ublk: add test case for UBLK_U_CMD_UPDATE_SIZE 2025-05-23 09:42:12 -06:00
test_generic_11.sh selftests: ublk: add test for UBLK_F_QUIESCE 2025-05-23 09:42:12 -06:00
test_generic_12.sh selftests: ublk: add functional test for per io daemons 2025-05-31 14:38:48 -06:00
test_loop_01.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_loop_02.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_loop_03.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_loop_04.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_loop_05.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_null_01.sh selftests: ublk: improve test usability 2025-03-10 16:24:42 -06:00
test_null_02.sh selftests: ublk: enable zero copy for null target 2025-03-22 08:35:08 -06:00
test_stress_01.sh selftests: ublk: run stress tests in parallel 2025-04-16 19:32:18 -06:00
test_stress_02.sh selftests: ublk: make IO & device removal test more stressful 2025-05-20 10:24:13 -06:00
test_stress_03.sh selftests: ublk: don't take same backing file for more than one ublk devices 2025-06-24 20:45:31 -06:00
test_stress_04.sh ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
test_stress_05.sh selftests: ublk: cover PER_IO_DAEMON in more stress tests 2025-06-02 12:00:31 -06:00
test_stripe_01.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_stripe_02.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_stripe_03.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
test_stripe_04.sh selftests: ublk: cleanup backfile automatically 2025-04-16 19:32:18 -06:00
ublk_dep.h selftests: ublk: add one dependency header 2025-03-20 17:18:55 -06:00
utils.h selftests: ublk: add utils.h 2025-07-15 08:04:17 -06:00