Commit 21d3bbdd authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Jens Axboe
Browse files

nvmet: don't try to add ns to p2p map unless it actually uses it



Even without CONFIG_P2PDMA this results in a error print:
nvmet: no peer-to-peer memory is available that's supported by rxe0 and /dev/nullb0

Fixes: c6925093 ("nvmet: Optionally use PCI P2P memory")
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent bb39ba6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ static void nvmet_p2pmem_ns_add_p2p(struct nvmet_ctrl *ctrl,
	struct pci_dev *p2p_dev;
	int ret;

	if (!ctrl->p2p_client)
	if (!ctrl->p2p_client || !ns->use_p2pmem)
		return;

	if (ns->p2p_dev) {