[PATCH blktests] nvme/081: test the per-queue io_cpu sysfs attribute

Nilay Shroff nilay at linux.ibm.com
Mon Nov 9 05:43:27 PST 2026


On 11/7/26 3:23 PM, Saravanan D wrote:
> +test() {
> +	echo "Running ${TEST_NAME}"
> +
> +	_setup_nvmet
> +
> +	local cfs_path="${NVMET_CFS}/subsystems/${def_subsysnqn}"
> +	local skipped=false
> +	local nvmedev qdir cpu writer
> +
> +	_nvmet_target_setup --blkdev file
> +
> +	_nvme_connect_subsys --keep-alive-tmo 1 --reconnect-delay 2

How about adding connection option "--nr-io-queues 2"? If we add
this option then we may not need to have the requirement of
_require_min_cpus 2. I think, we shall be able to run this test
also on the system with only one cpu.

> +	_nvmf_wait_for_state "${def_subsysnqn}" "live"
> +	nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
> +	qdir="/sys/class/nvme/${nvmedev}/queues"
> +	cpu=$(last_online_cpu)
> +
Can we also add one more test here which tests whether "$qdir"
exists or not?

> +	if [[ ! -f "${qdir}/1/io_cpu" ]]; then
> +		SKIP_REASONS+=("missing per-queue io_cpu attribute")
> +		skipped=true
> +	elif [[ "$(nr_queue_dirs "${nvmedev}")" -lt 2 ]]; then
> +		SKIP_REASONS+=("controller has fewer than 2 I/O queues")
> +		skipped=true

I think using --nr-io-queues option would also replace the above relative
comparison with an exact comparison based on num of queues selected.

> +	else
> +		test_read_write "${qdir}" "${cpu}"
> +		test_reset "${nvmedev}" "${qdir}" "${cpu}"

The reset test could be updated to ensure that number of queues
remains unchanged after controller reset. Current test_reset()
verifies that the io_cpu and managed attributes retain their expected
values after reset. However, it doesn't explicitly verify that the
queue directories were recreated with the same count. I would capture
the queue_count before reset and compare it afterward as well as
ensure that queue_count matches with nr_queue_dirs.

Thanks,
--Nilay




More information about the Linux-nvme mailing list