]> www.infradead.org Git - nvme.git/commit
nvme: Add PCI transport type
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 4 Jan 2025 04:59:39 +0000 (13:59 +0900)
committerKeith Busch <kbusch@kernel.org>
Sat, 11 Jan 2025 03:30:47 +0000 (19:30 -0800)
commit200adac75888182c09027e9b7852507dabd87034
treec3d308d08dbb9f4ac563f3eaf9e0bd1cd58f8b4c
parent35c593e5303c7f1f389728b4115cfd0f4d8c30ae
nvme: Add PCI transport type

Define the transport type NVMF_TRTYPE_PCI for PCI endpoint targets.
This transport type is defined using the value 0 which is reserved in
the NVMe base specifications v2.1 (Figure 294). Given that struct
nvmet_port are zeroed out on creation, to avoid having this transsport
type becoming the new default, nvmet_referral_make() and
nvmet_ports_make() are modified to initialize a port discovery address
transport type field (disc_addr.trtype) to NVMF_TRTYPE_MAX.

Any port using this transport type is also skipped and not reported in
the discovery log page (nvmet_execute_disc_get_log_page()).

The helper function nvmet_is_pci_ctrl() is also introduced to check if
a target controller uses the PCI transport.

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/configfs.c
drivers/nvme/target/discovery.c
drivers/nvme/target/nvmet.h
include/linux/nvme.h