]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet: Introduce nvmet_sq_create() and nvmet_cq_create()
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 4 Jan 2025 04:59:42 +0000 (13:59 +0900)
committerKeith Busch <kbusch@kernel.org>
Sat, 11 Jan 2025 03:30:48 +0000 (19:30 -0800)
commit1eb380caf5275bba1d3d6182dde1fd740f331743
tree7cc84038b872e10e4aec2e1f86f660d0d9acf0f2
parent43043c9b97258a008b3402cfbbf1c5d82151c77f
nvmet: Introduce nvmet_sq_create() and nvmet_cq_create()

Introduce the new functions nvmet_sq_create() and nvmet_cq_create() to
allow a target driver to initialize and setup admin and IO queues
directly, without needing to execute connect fabrics commands.
The helper functions nvmet_check_cqid() and nvmet_check_sqid() are
implemented to check the correctness of SQ and CQ IDs when
nvmet_sq_create() and nvmet_cq_create() are called.

nvmet_sq_create() and nvmet_cq_create() are primarily intended for use
with PCI target controller drivers and thus are not well integrated
with the current queue creation of fabrics controllers using the connect
command. These fabrices drivers are not modified to use these functions.
This simple implementation of SQ and CQ management for PCI target
controller drivers does not allow multiple SQs to share the same CQ,
similarly to other fabrics transports. This is a specification
violation. A more involved set of changes will follow to add support for
this required completion queue sharing feature.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Rick Wertenbroek <rick.wertenbroek@gmail.com>
Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/core.c
drivers/nvme/target/nvmet.h