nvmf/vfio-user: don't check controller ready state in group poll context
The group poll context is for queue pair state, so we don't need to check controller state here, and for the disconnect case below, the ADMIN queue pair will be removed from group poll. Also add spdk_unlikely in the poll context. Change-Id: I5ef32ef3cf41ad757a7cb167e1e1fa32c52a84d6 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6227 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b05b3d0a12
commit
0f30fea99b
@ -1164,7 +1164,6 @@ nvmf_vfio_user_prop_req_rsp(struct nvmf_vfio_user_req *req, void *cb_arg)
|
||||
}
|
||||
}
|
||||
|
||||
qpair->ctrlr->ready = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1277,9 +1276,6 @@ access_bar0_fn(vfu_ctx_t *vfu_ctx, char *buf, size_t count, loff_t pos,
|
||||
req->req.length = count;
|
||||
req->req.data = buf;
|
||||
|
||||
/* Mark the controller as busy to limit the queue depth for fabric get/set to 1 */
|
||||
ctrlr->ready = false;
|
||||
|
||||
spdk_nvmf_request_exec_fabrics(&req->req);
|
||||
|
||||
return count;
|
||||
@ -2266,15 +2262,14 @@ nvmf_vfio_user_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
|
||||
|
||||
TAILQ_FOREACH_SAFE(vu_qpair, &vu_group->qps, link, tmp) {
|
||||
ctrlr = vu_qpair->ctrlr;
|
||||
if (!ctrlr->ready) {
|
||||
continue;
|
||||
}
|
||||
assert(ctrlr != NULL);
|
||||
|
||||
if (nvmf_qpair_is_admin_queue(&vu_qpair->qpair)) {
|
||||
if (spdk_unlikely(nvmf_qpair_is_admin_queue(&vu_qpair->qpair))) {
|
||||
int err;
|
||||
|
||||
err = nvmf_vfio_user_ctrlr_poll(ctrlr);
|
||||
if (spdk_unlikely(err) != 0) {
|
||||
/* initiator shutdown or reset, waiting for another re-connect */
|
||||
if (err == -ENOTCONN) {
|
||||
TAILQ_REMOVE(&vu_group->qps, vu_qpair, link);
|
||||
ctrlr->ready = false;
|
||||
@ -2286,7 +2281,7 @@ nvmf_vfio_user_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
|
||||
}
|
||||
}
|
||||
|
||||
if (vu_qpair->state != VFIO_USER_QPAIR_ACTIVE || !vu_qpair->sq.size) {
|
||||
if (spdk_unlikely(vu_qpair->state != VFIO_USER_QPAIR_ACTIVE || !vu_qpair->sq.size)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user