[PATCH 2/3] nvme-rdma: implement existing_ctrl operation

Max Gurtovoy mgurtovoy at nvidia.com
Sun Jan 15 02:03:40 PST 2023


The logic of checking matching connections moved to the core layer.
Implement the needed optional operation and remove the common logic.

Reviewed-by: Israel Rukshin <israelr at nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy at nvidia.com>
---
 drivers/nvme/host/rdma.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index bbad26b82b56..79412e4bfe3e 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -2326,11 +2326,6 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
 		}
 	}
 
-	if (!opts->duplicate_connect && nvme_rdma_existing_controller(opts)) {
-		ret = -EALREADY;
-		goto out_free_ctrl;
-	}
-
 	INIT_DELAYED_WORK(&ctrl->reconnect_work,
 			nvme_rdma_reconnect_ctrl_work);
 	INIT_WORK(&ctrl->err_work, nvme_rdma_error_recovery_work);
@@ -2390,6 +2385,7 @@ static struct nvmf_transport_ops nvme_rdma_transport = {
 			  NVMF_OPT_NR_WRITE_QUEUES | NVMF_OPT_NR_POLL_QUEUES |
 			  NVMF_OPT_TOS,
 	.create_ctrl	= nvme_rdma_create_ctrl,
+	.existing_ctrl	= nvme_rdma_existing_controller,
 };
 
 static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
-- 
2.18.1




More information about the Linux-nvme mailing list