[PATCH 3/3] nvme-tcp: implement existing_ctrl operation

Max Gurtovoy mgurtovoy at nvidia.com
Sun Jan 15 02:03:41 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/tcp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 8cedc1ef496c..233e6c3a85de 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2608,11 +2608,6 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev,
 		}
 	}
 
-	if (!opts->duplicate_connect && nvme_tcp_existing_controller(opts)) {
-		ret = -EALREADY;
-		goto out_free_ctrl;
-	}
-
 	ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues),
 				GFP_KERNEL);
 	if (!ctrl->queues) {
@@ -2666,6 +2661,7 @@ static struct nvmf_transport_ops nvme_tcp_transport = {
 			  NVMF_OPT_NR_WRITE_QUEUES | NVMF_OPT_NR_POLL_QUEUES |
 			  NVMF_OPT_TOS | NVMF_OPT_HOST_IFACE,
 	.create_ctrl	= nvme_tcp_create_ctrl,
+	.existing_ctrl	= nvme_tcp_existing_controller,
 };
 
 static int __init nvme_tcp_init_module(void)
-- 
2.18.1




More information about the Linux-nvme mailing list