nvmf/rdma: Add qpair to poll group after initialization succeeds
nvmf_rdma_poll_group_add() added a rqpair to the poll_group->qpairs list before its initialization. If we change the poll_group->qpairs list from linked list to RB tree, the qpair can be added to the poll_group_qpairs list only after its initialization completes because QP number is necessary. As a preparation, change nvmf_rdma_poll_group_add() to add a rqpair to the poll_group->qpairs list after its initialization succeeds. Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: I42525f68c5efbd445f96da8f4f63d31f06f739e3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11800 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
89ee5a13bf
commit
7613e3fefb
@ -3480,16 +3480,19 @@ nvmf_rdma_poll_group_add(struct spdk_nvmf_transport_poll_group *group,
|
||||
return -1;
|
||||
}
|
||||
|
||||
TAILQ_INSERT_TAIL(&poller->qpairs, rqpair, link);
|
||||
rqpair->poller = poller;
|
||||
rqpair->srq = rqpair->poller->srq;
|
||||
|
||||
rc = nvmf_rdma_qpair_initialize(qpair);
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("Failed to initialize nvmf_rdma_qpair with qpair=%p\n", qpair);
|
||||
rqpair->poller = NULL;
|
||||
rqpair->srq = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
TAILQ_INSERT_TAIL(&poller->qpairs, rqpair, link);
|
||||
|
||||
rc = nvmf_rdma_event_accept(rqpair->cm_id, rqpair);
|
||||
if (rc) {
|
||||
/* Try to reject, but we probably can't */
|
||||
|
Loading…
Reference in New Issue
Block a user