From cd258ce089afeb94d993510b51255473a8f0cd9f Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 19 Jul 2016 16:20:39 +0800 Subject: [PATCH] nvmf: ack the disconect event before call rdma_destroy_id If we connected a subsystem twice from the initiator, the second connection will be rejected by the NVMf target, however, the previous connection will also be impacted because we destroy the connection id before ack the disconnect event. Change-Id: Ib597cc68a7823524460693053898f4d6e5499eb4 Signed-off-by: Changpeng Liu --- lib/nvmf/rdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 5b11606d4..1f634138a 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -724,6 +724,8 @@ nvmf_rdma_disconnect(struct rdma_cm_event *evt) SPDK_ERRLOG("disconnect request: no active connection\n"); return -1; } + /* ack the disconnect event before rdma_destroy_id */ + rdma_ack_cm_event(evt); rdma_conn = get_rdma_conn(conn); @@ -908,7 +910,7 @@ nvmf_rdma_accept(struct rte_timer *timer, void *arg) SPDK_ERRLOG("Unable to process disconnect event. rc: %d\n", rc); break; } - break; + continue; default: SPDK_ERRLOG("Unexpected Acceptor Event [%d]\n", event->event); break;