From 2746d51aa79342c7a443735c3054698a30203413 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Mon, 9 Aug 2021 17:42:41 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9120 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvmf/vfio_user.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 0a1afbc23..c828f0544 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -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