Skip to contentSkip to conversation

nvme-tcp: allow setting per-queue io_cpu through sysfs

PATCH Superseded Saravanan D 3 participants 8 messages Nov 4 – Nov 6

Subsystems (2)

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v7 cover nvme-tcp: allow setting per-queue io_cpu through sysfs

On hosts that partition their CPUs after connect time, the connect time io_cpu selection can place a queue's socket work on CPUs owned by another workload. This series lets a control plane set each queue's io_cpu through /sys/class/nvme/nvmeX/queues/<qid>/. Patch 1 adds the core helpers, patch 2 the nvme-tcp attributes.

Changes since v6 [1]:
- nvme-core now owns the queues directory. A transport lists its queue attributes in the new queue_attr_groups member of struct nvme_ctrl_ops, nvme_add_ctrl() creates the directory for it, and nvme_uninit_ctrl() removes it through the new nvme_queue_dir_destroy() helper (Nilay).
- Rebased onto the current nvme-7.4.

A blktests patch, nvme/077, covers the interface and follows in this thread.

[1] https://lore.kernel.org/linux-nvme/[email protected]/

Saravanan D (2):
nvme: add per-queue sysfs directories
nvme-tcp: allow setting per-queue io_cpu through sysfs

 Documentation/ABI/stable/sysfs-nvme |  31 ++++++
 drivers/nvme/host/core.c            |  12 ++
 drivers/nvme/host/nvme.h            |  25 +++++
 drivers/nvme/host/sysfs.c           |  88 +++++++++++++++
 drivers/nvme/host/tcp.c             | 167 ++++++++++++++++++++++++----
 5 files changed, 303 insertions(+), 20 deletions(-)

base-commit: ca7e6a9a693240f059a0b47726f64a3f0573011a

Signature · 1 line
2.56.0
#1 lore raw

PATCH v7 1/2 nvme: add per-queue sysfs directories

Per I/O queue transport state, such as the nvme-tcp io_cpu, has nowhere to live in sysfs, since the core has no directory for individual queues.

Add helpers that create the controller's queues directory and add or remove one directory per queue

/sys/class/nvme/nvmeX/queues/<qid>/

carrying the attributes a transport sets in the new queue_attr_groups member of struct nvme_ctrl_ops. For such transports nvme_add_ctrl() creates the queues directory. It holds a reference on the controller device, so nvme_uninit_ctrl() deletes it before deleting the device, after the transport has removed the queue directories.

The transport adds a queue's directory when it sets the queue up and removes it when it frees the queue, so the directories follow the queues across reconnects and changes in the queue count. The core allocates each queue directory and its release frees only that allocation. Removal waits for running attribute callbacks, so the transport may tear the queue down once it returns.

---
 drivers/nvme/host/core.c  | 12 ++++++
 drivers/nvme/host/nvme.h  | 25 +++++++++++
 drivers/nvme/host/sysfs.c | 88 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 125 insertions(+)
drivers/nvme/host/core.c +12 -0
index 9ea9db0271c2..7246502f1e66 100644
@@ -5183,6 +5183,8 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
 {
 	nvme_stop_keep_alive(ctrl);
 	nvme_hwmon_exit(ctrl);
+	/* transports remove their queue directories before this point */
+	nvme_queue_dir_destroy(ctrl);
 	nvme_fault_inject_fini(&ctrl->fault_inject);
 	dev_pm_qos_hide_latency_tolerance(ctrl->device);
 	cdev_device_del(&ctrl->cdev, ctrl->device);
@@ -5327,6 +5329,12 @@ int nvme_add_ctrl(struct nvme_ctrl *ctrl)
 	if (ret)
 		return ret;
 
+	if (ctrl->ops->queue_attr_groups) {
+		ret = nvme_queue_dir_create(ctrl);
+		if (ret)
+			goto out_del_cdev;
+	}
+
 	/*
 	 * Initialize latency tolerance controls.  The sysfs files won't
 	 * be visible to userspace unless the device actually supports APST.
@@ -5339,6 +5347,10 @@ int nvme_add_ctrl(struct nvme_ctrl *ctrl)
 	nvme_get_ctrl(ctrl);
 
 	return 0;
+
+out_del_cdev:
+	cdev_device_del(&ctrl->cdev, ctrl->device);
+	return ret;
 }
 EXPORT_SYMBOL_GPL(nvme_add_ctrl);
 
drivers/nvme/host/nvme.h +25 -0
index 92c048002ecd..017e23e449e6 100644
@@ -339,6 +339,28 @@ enum nvme_ctrl_flags {
 	NVME_CTRL_FROZEN		= 6,
 };
 
+/*
+ * Per-queue directory /sys/class/nvme/nvmeX/queues/<qid>/, allocated by the
+ * core and carrying attributes provided by the transport.
+ */
+struct nvme_queue_info {
+	struct kobject		kobj;
+	void			*data;
+};
+
+static inline void *nvme_queue_info_data(struct kobject *kobj)
+{
+	return container_of(kobj, struct nvme_queue_info, kobj)->data;
+}
+
+struct nvme_ctrl;
+
+int nvme_queue_dir_create(struct nvme_ctrl *ctrl);
+void nvme_queue_dir_destroy(struct nvme_ctrl *ctrl);
+struct nvme_queue_info *
+nvme_add_queue_info(struct nvme_ctrl *ctrl, unsigned int qid, void *data);
+void nvme_remove_queue_info(struct nvme_queue_info *qinfo);
+
 struct nvme_ctrl {
 	bool comp_seen;
 	bool identified;
@@ -360,6 +382,7 @@ struct nvme_ctrl {
 	struct srcu_struct srcu;
 	struct device ctrl_device;
 	struct device *device;	/* char device */
+	struct kobject *queues_kobj;
 #ifdef CONFIG_NVME_HWMON
 	struct device *hwmon_device;
 #endif
@@ -658,6 +681,8 @@ struct nvme_ctrl_ops {
 #define NVME_F_BLOCKING			(1 << 2)
 
 	const struct attribute_group **dev_attr_groups;
+	/* attributes of each /sys/class/nvme/nvmeX/queues/<qid>/ directory */
+	const struct attribute_group **queue_attr_groups;
 	int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val);
 	int (*reg_write32)(struct nvme_ctrl *ctrl, u32 off, u32 val);
 	int (*reg_read64)(struct nvme_ctrl *ctrl, u32 off, u64 *val);
drivers/nvme/host/sysfs.c +88 -0

91 lines not on this page · raw message

Signature · 1 line
2.56.0
#6 lore raw

PATCH v7 2/2 nvme-tcp: allow setting per-queue io_cpu through sysfs

In reply to Saravanan D

nvme_tcp_set_queue_io_cpu() picks each queue's io_cpu at connect time as the least loaded CPU in the queue's blk-mq map group, and all socket work runs there for the connection's lifetime. This decision falls short when the host partitions its CPUs after connect time. On a 384 cpu multi tenant host with 128 queue controllers, blk-mq folds three CPUs into every map group, some groups straddle two tenants' cpusets, and 9% of nvme_tcp_io_work executions ran outside the submitting VM's cpuset, seen by the neighbor as steal time.

Expose the io_cpu in each I/O queue's directory

/sys/class/nvme/nvmeX/queues/<qid>/io_cpu

so a control plane that owns CPU placement can set it directly instead of relying on the driver's heuristic. The attribute accepts a decimal cpu number, -1 or "unbound". A user assignment, unbound included, is marked in the queue flags, persists across reconnects and is never reselected by the driver. The read-only managed attribute reports 1 while io_cpu is driver managed and 0 once the user assigned it. The accounting of nvme_tcp_cpu_queues applies regardless of who set the io_cpu.

A queue's directory is added once the connect time selection has set its io_cpu, so readers never see a placement that is about to change, and removed when the queue is freed, before it is torn down, so a sysfs store never runs on a freed queue. All io_cpu writes, from sysfs and from the driver, serialize with the accounting under nvme_tcp_cpu_queues_lock, while the I/O paths read io_cpu locklessly. The queue stop now clears NVME_TCP_Q_IO_CPU_SET under that lock, since a sysfs store may move io_cpu in between.

nvme_tcp_free_queue() now clears NVME_TCP_Q_IO_CPU_SET and drops its count, because a queue can still be counted when it is freed. A sysfs store may have run after the queue stop, or the connect may have failed, and the setup error path frees such a queue without calling nvme_tcp_stop_queue(), where the count is normally dropped.

---
 Documentation/ABI/stable/sysfs-nvme |  31 ++++++
 drivers/nvme/host/tcp.c             | 167 ++++++++++++++++++++++++----
 2 files changed, 178 insertions(+), 20 deletions(-)
Documentation/ABI/stable/sysfs-nvme +31 -0
index 9291595f8102..fcfd0426866c 100644
@@ -503,3 +503,34 @@ Contact:	Hannes Reinecke <[email protected]>
 Description:
 		Shows the subsystem type. Possible values: "discovery",
 		"nvm", "reserved".
+
+What:		/sys/class/nvme/nvmeX/queues/<qid>/io_cpu
+What:		/sys/class/nvme/nvmeX/queues/<qid>/managed
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	Saravanan D <[email protected]>
+Description:
+		Per I/O queue directories, populated by the transport
+		backing the controller. A directory appears once the
+		driver has selected the queue's CPU at connect time and
+		is removed when the queue is torn down, so the
+		directories follow the queue count and are absent while
+		the controller reconnects.
+		NVMe over TCP exposes:
+
+		io_cpu: (RW) The CPU that runs the socket work for I/O
+		queue <qid>, selected by the driver at connect time.
+		Writing a decimal online CPU number overrides the
+		selection, and writing -1 or "unbound" leaves the socket
+		work unbound. A written value persists across reconnects
+		for the life of the controller, also when its CPU goes
+		offline. Unbound socket work runs on the CPU that queued
+		it. When the nvme_tcp module is loaded with wq_unbound
+		set, the socket work runs on an unbound workqueue and
+		how closely it follows io_cpu depends on the affinity
+		scope of the nvme_tcp_wq workqueue. Reads return the
+		current CPU, or -1 when the queue is unbound.
+
+		managed: (RO) Shows who owns the CPU placement. 1 while
+		io_cpu is driver managed, 0 once the user assigned it,
+		for the life of the controller.
drivers/nvme/host/tcp.c +147 -20

291 lines not on this page · raw message

Signature · 1 line
2.56.0
#7 lore raw

PATCH 1/1 nvme/077: test the per-queue io_cpu sysfs attribute

In reply to Saravanan D

nvme-tcp exposes /sys/class/nvme/nvmeX/queues/<qid>/io_cpu and managed, so a control plane can choose the CPU that runs each I/O queue's socket work [1]. Test that

- io_cpu reads back a written CPU and rejects invalid values
- managed is read only and turns 0 once io_cpu is written
- an assignment survives a controller reset
- the queue directories follow the queue count as attr_qid_max shrinks and grows it
- removing the controller while io_cpu is written completes

The test skips when the kernel does not have the attribute.

[1] https://lore.kernel.org/linux-nvme/[email protected]/

Assisted-by Claude:claude-opus-5-5 [Claude Code]
---
 tests/nvme/077     | 185 +++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/077.out |   2 +
 2 files changed, 187 insertions(+)
 create mode 100755 tests/nvme/077
 create mode 100644 tests/nvme/077.out
tests/nvme/077 new file +185 -0
new file mode 100755
index 0000000..0b4bce5
@@ -0,0 +1,185 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2026 Saravanan D <[email protected]>
+#
+# Test the per-queue io_cpu sysfs attribute of nvme-tcp
+
+. tests/nvme/rc
+
+DESCRIPTION="test the per-queue io_cpu sysfs attribute"
+
+requires() {
+	_nvme_requires
+	_have_loop
+	_require_nvme_trtype tcp
+	_require_min_cpus 2
+}
+
+set_conditions() {
+	_set_nvme_trtype "$@"
+}
+
+# last CPU in the online list, and the first CPU id past the possible ones
+last_online_cpu() {
+	awk -F'[-,]' '{ print $NF }' /sys/devices/system/cpu/online
+}
+
+first_impossible_cpu() {
+	echo $(( $(awk -F'[-,]' '{ print $NF }' /sys/devices/system/cpu/possible) + 1 ))
+}
+
+nr_queue_dirs() {
+	local nvmedev="$1"
+
+	find "/sys/class/nvme/${nvmedev}/queues" -mindepth 1 -maxdepth 1 \
+		-type d 2>/dev/null | wc -l
+}
+
+expect_attr() {
+	local file="$1"
+	local expected="$2"
+	local value
+
+	value=$(cat "${file}")
+	if [[ "${value}" != "${expected}" ]]; then
+		echo "${file}: read ${value}, expected ${expected}"
+		return 1
+	fi
+	return 0
+}
+
+test_read_write() {
+	local qdir="$1"
+	local cpu="$2"
+	local bad
+
+	expect_attr "${qdir}/1/managed" 1
+
+	echo "${cpu}" > "${qdir}/1/io_cpu"
+	expect_attr "${qdir}/1/io_cpu" "${cpu}"
+	expect_attr "${qdir}/1/managed" 0
+
+	for bad in "$(first_impossible_cpu)" -2 abc 0x1; do
+		if { echo "${bad}" > "${qdir}/1/io_cpu"; } 2>/dev/null; then
+			echo "io_cpu accepted ${bad}"
+		fi
+	done
+	expect_attr "${qdir}/1/io_cpu" "${cpu}"
+
+	if { echo 1 > "${qdir}/1/managed"; } 2>/dev/null; then
+		echo "managed is writable"
+	fi
+
+	echo unbound > "${qdir}/2/io_cpu"
+	expect_attr "${qdir}/2/io_cpu" -1
+	echo -1 > "${qdir}/2/io_cpu"
+	expect_attr "${qdir}/2/io_cpu" -1
+	expect_attr "${qdir}/2/managed" 0
+}
+
+test_reset() {
+	local nvmedev="$1"
+	local qdir="$2"
+	local cpu="$3"
+
+	echo 1 > "/sys/class/nvme/${nvmedev}/reset_controller"
+	_nvmf_wait_for_state "${def_subsysnqn}" "live" || return 1
+
+	expect_attr "${qdir}/1/io_cpu" "${cpu}"
+	expect_attr "${qdir}/1/managed" 0
+	expect_attr "${qdir}/2/io_cpu" -1
+	expect_attr "${qdir}/2/managed" 0
+}
+
+set_qid_max() {
+	local nvmedev="$1"
+	local qid_max="$2"
+	local queue_count_file="/sys/class/nvme-fabrics/ctl/${nvmedev}/queue_count"
+	local retries=10
+
+	echo "${qid_max}" > \
+		"${NVMET_CFS}/subsystems/${def_subsysnqn}/attr_qid_max"
+	while [[ "$(cat "${queue_count_file}")" -ne $((qid_max + 1)) ]]; do
+		if (( retries-- == 0 )); then
+			echo "queue count did not change to $((qid_max + 1))"
+			return 1
+		fi
+		sleep 1
+	done
+	_nvmf_wait_for_state "${def_subsysnqn}" "live" || return 1
+
+	if [[ "$(nr_queue_dirs "${nvmedev}")" -ne "${qid_max}" ]]; then
+		echo "$(nr_queue_dirs "${nvmedev}") queue directories," \
+			"expected ${qid_max}"
+		return 1
+	fi
+	return 0
+}
+
+io_cpu_writer() {
+	local qdir="$1"
+	local cpu="$2"
+	local file
+
+	while true; do
+		for file in "${qdir}"/*/io_cpu; do
+			{ echo "${cpu}" > "${file}"; } 2>/dev/null
+			{ echo unbound > "${file}"; } 2>/dev/null
+		done
+	done
+}
+
+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
+	_nvmf_wait_for_state "${def_subsysnqn}" "live"
+	nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
+	qdir="/sys/class/nvme/${nvmedev}/queues"
+	cpu=$(last_online_cpu)
+
+	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
+	else
+		test_read_write "${qdir}" "${cpu}"
+		test_reset "${nvmedev}" "${qdir}" "${cpu}"
+
+		if [[ -f "${cfs_path}/attr_qid_max" ]]; then
+			set_qid_max "${nvmedev}" 1
+			expect_attr "${qdir}/1/io_cpu" "${cpu}"
+			set_qid_max "${nvmedev}" 2
+		fi
+
+		# remove the controller while its queue directories are written
+		io_cpu_writer "${qdir}" "${cpu}" &
+		writer=$!
+		sleep 1
+	fi
+
+	_nvme_disconnect_subsys
+
+	if [[ -n "${writer}" ]]; then
+		kill "${writer}"
+		wait "${writer}" 2>/dev/null
+	fi
+
+	_nvmet_target_cleanup
+
+	if [[ "${skipped}" = true ]] ; then
+		return 1
+	fi
+
+	echo "Test complete"
+}
tests/nvme/077.out new file +2 -0
new file mode 100644
index 0000000..c7f6ac3
@@ -0,0 +1,2 @@
+Running nvme/077
+Test complete
Signature · 1 line
2.56.0
#2 lore raw

Re: [PATCH v7 1/2] nvme: add per-queue sysfs directories

In reply to Saravanan D
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] nvme: missing kobject_del() on error path in nvme_add_queue_info() --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] nvme: missing kobject_del() on error path in nvme_add_queue_info() --

commit 6e5f76664582ac2e5b614fa65fb1066286cd6645
Author: Saravanan D <[email protected]>

nvme: add per-queue sysfs directories

This commit adds helpers to create a per-controller queues sysfs directory and manage per-queue subdirectories (/sys/class/nvme/nvmeX/queues/<qid>/) populated with transport-provided attribute groups.

Quoted 4 lines
drivers/nvme/host/sysfs.c +0 -0
index 10018c6356b62..8a982453cb69d 100644

[ ... ]

Quoted 18 lines
drivers/nvme/host/sysfs.c +18 -0
+struct nvme_queue_info *
+nvme_add_queue_info(struct nvme_ctrl *ctrl, unsigned int qid, void *data)
+{
+	struct nvme_queue_info *qinfo;
+	int ret;
+
+	if (WARN_ON_ONCE(!ctrl->queues_kobj))
+		return ERR_PTR(-EINVAL);
+
+	qinfo = kzalloc_obj(*qinfo);
+	if (!qinfo)
+		return ERR_PTR(-ENOMEM);
+	qinfo->data = data;
+
+	ret = kobject_init_and_add(&qinfo->kobj, &nvme_queue_info_ktype,
+				   ctrl->queues_kobj, "%u", qid);
+	if (ret)
+		goto out_put;

drivers/nvme/host/sysfs.c const struct attribute_group *nvme_subsys_attrs_groups[] = { · line 1388

Quoted 10 lines
drivers/nvme/host/sysfs.c +10 -0
+
+	ret = sysfs_create_groups(&qinfo->kobj, ctrl->ops->queue_attr_groups);
+	if (ret)
+		goto out_put;
+	return qinfo;
+
+out_put:
+	kobject_put(&qinfo->kobj);
+	return ERR_PTR(ret);
+}

[Severity: Medium]
If sysfs_create_groups() fails in nvme_add_queue_info() after kobject_init_and_add() has already published qinfo->kobj in sysfs, should the error path call kobject_del(&qinfo->kobj) before kobject_put(&qinfo->kobj), just like nvme_remove_queue_info() does?

Without kobject_del(), unlinking the directory from sysfs is deferred to kobject_cleanup(). If CONFIG_DEBUG_KOBJECT_RELEASE is enabled or if another thread grabbed a reference to qinfo->kobj after it was added to sysfs, the <qid> directory and its parent reference on ctrl->queues_kobj remain live after nvme_add_queue_info() returns an error, which can cause a subsequent retry or reconnect for the same qid to fail with -EEXIST or expose a dangling qinfo->data pointer.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#4 lore raw

Re: [PATCH v7 1/2] nvme: add per-queue sysfs directories

In reply to Saravanan D
Quoted 12 lines · Saravanan D
drivers/nvme/host/sysfs.c +12 -0
+struct nvme_queue_info *
+nvme_add_queue_info(struct nvme_ctrl *ctrl, unsigned int qid, void *data)
+{
+	struct nvme_queue_info *qinfo;
+	int ret;
+
+	if (WARN_ON_ONCE(!ctrl->queues_kobj))
+		return ERR_PTR(-EINVAL);
+
+	qinfo = kzalloc_obj(*qinfo);
+	if (!qinfo)
+		return ERR_PTR(-ENOMEM);

drivers/nvme/host/sysfs.c const struct attribute_group *nvme_subsys_attrs_groups[] = { · line 1382

Quoted 10 lines
drivers/nvme/host/sysfs.c +10 -0
+	qinfo->data = data;
+
+	ret = kobject_init_and_add(&qinfo->kobj, &nvme_queue_info_ktype,
+				   ctrl->queues_kobj, "%u", qid);
+	if (ret)
+		goto out_put;
+
+	ret = sysfs_create_groups(&qinfo->kobj, ctrl->ops->queue_attr_groups);
+	if (ret)
+		goto out_put;

Don't you have to call kobject_del(&qinfo->kobj); here?

#3 lore raw

Re: [PATCH v7 1/2] nvme: add per-queue sysfs directories

In reply to [email protected]

On Wed, Nov 04, 2026 at 02:17:33PM +0000, [email protected] wrote:
[...]

Quoted 5 lines

[Severity: Medium]
If sysfs_create_groups() fails in nvme_add_queue_info() after kobject_init_and_add() has already published qinfo->kobj in sysfs, should the error path call kobject_del(&qinfo->kobj) before kobject_put(&qinfo->kobj), just like nvme_remove_queue_info() does?

I'm surprised this sequence went unnoticed in the previous versions of this patch, since the error path has not changed since v5. My fault injection runs used DEBUG_KOBJECT_RELEASE, which would have exposed the directory left behind, but they set fail-nth on the task writing to /dev/nvme-fabrics, and fail-nth only fails allocations made by that task. nvme_tcp_setup_io_queues() starts each I/O queue from an async worker, so nvme_add_queue_info() runs in a different task and none of its allocations failed.

I will send a v8 that calls kobject_del() before kobject_put() once kobject_init_and_add() has succeeded, so a failed sysfs_create_groups() unlinks the <qid> directory before nvme_add_queue_info() returns, the same way nvme_remove_queue_info() does.

I have also extended my own testing with a run that uses the failslab stack filter to fail each allocation under nvme_add_queue_info() in turn, including those made from the async workers. It checks that a failed add leaves no queues/<qid> directory behind and that a controller reset can add the same qid again. It fails on v7 and passes with the fix.

Thanks,
Saravanan D.

#5 lore raw

Re: [PATCH v7 1/2] nvme: add per-queue sysfs directories

In reply to Daniel Wagner
Quoted 5 lines · Daniel Wagner

drivers/nvme/host/sysfs.c const struct attribute_group *nvme_subsys_attrs_groups[] = { · line 1382

Quoted 3 lines
drivers/nvme/host/sysfs.c +3 -0
+	ret = sysfs_create_groups(&qinfo->kobj, ctrl->ops->queue_attr_groups);
+	if (ret)
+		goto out_put;

Don't you have to call kobject_del(&qinfo->kobj); here?

Yes. Sashiko flagged the same error path.

I will send a v8 that adds an out_del label calling kobject_del() before kobject_put(), so a failed sysfs_create_groups() unlinks the <qid> directory before nvme_add_queue_info() returns.

Thanks for the review.

Saravanan D.