Commit 2746d51a authored by Changpeng Liu's avatar Changpeng Liu
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9120


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 40c447f8
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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