nvmf/vfio-user: inline io_q_id()

This function is called in the IO processing context, also rename
internal queue pair variable with "vu_" prefix.

Change-Id: Iac6be1fddf9ee28e0485ff0c3a707de4e98be96a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9120
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2021-08-09 17:42:41 +08:00
parent 40c447f843
commit 2746d51aa7

View File

@ -452,21 +452,21 @@ ctrlr_id(struct nvmf_vfio_user_ctrlr *ctrlr)
return endpoint_id(ctrlr->endpoint);
}
static uint16_t
static inline uint16_t
io_q_id(struct nvme_q *q)
{
struct nvmf_vfio_user_qpair *vfio_user_qpair;
struct nvmf_vfio_user_qpair *vu_qpair;
assert(q);
if (q->is_cq) {
vfio_user_qpair = SPDK_CONTAINEROF(q, struct nvmf_vfio_user_qpair, cq);
vu_qpair = SPDK_CONTAINEROF(q, struct nvmf_vfio_user_qpair, cq);
} else {
vfio_user_qpair = SPDK_CONTAINEROF(q, struct nvmf_vfio_user_qpair, sq);
vu_qpair = SPDK_CONTAINEROF(q, struct nvmf_vfio_user_qpair, sq);
}
assert(vfio_user_qpair);
return vfio_user_qpair->qpair.qid;
assert(vu_qpair);
return vu_qpair->qpair.qid;
}
static void