Commit 070d61f2 authored by Richael Zhuang's avatar Richael Zhuang Committed by Tomasz Zawadzki
Browse files

nvme: add API to get outstanding reqs number



Added spdk_nvme_qpair_get_num_outstanding_reqs to get the number
of outstanding reqs for a specific qpair.

Change-Id: I55d75a7363ac63bd26db76594e70e8b17b3e5830
Signed-off-by: default avatarRichael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15916


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 41bf6280
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -115,6 +115,9 @@ tag that was logged at least once.
Added `transport_tos` to `spdk_nvme_ctrlr_opts` to support setting of the "type of service"
value in the IPv4 header. Only RDMA is supported at this time.

Added API spdk_nvme_qpair_get_num_outstanding_reqs to get the number of outstanding reqs of
a specified qpair.

### bdev_nvme

Updated `bdev_nvme_set_options` RPC (and rpc.py) to support the new `transport_tos` parameter.
+14 −0
Original line number Diff line number Diff line
@@ -3791,6 +3791,20 @@ void spdk_nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair,
 */
uint16_t spdk_nvme_qpair_get_id(struct spdk_nvme_qpair *qpair);

/**
 * Gets the number of outstanding requests for the specified qpair.
 *
 * This number is not decremented until after a request's callback function is completed.
 *
 * This number is not matched necessarily to the number of NVMe commands submitted by the
 * user. For example, nvme driver may split a request due to MDTS limitations, that will
 * also allocate a request for the parent, etc.
 *
 * \param qpair Pointer to the NVMe queue pair.
 * \returns number of outstanding requests for the specified qpair.
 */
uint32_t spdk_nvme_qpair_get_num_outstanding_reqs(struct spdk_nvme_qpair *qpair);

/**
 * \brief Prints (SPDK_NOTICELOG) the contents of an NVMe submission queue entry (command).
 *
+6 −0
Original line number Diff line number Diff line
@@ -1197,3 +1197,9 @@ spdk_nvme_qpair_get_id(struct spdk_nvme_qpair *qpair)
{
	return qpair->id;
}

uint32_t
spdk_nvme_qpair_get_num_outstanding_reqs(struct spdk_nvme_qpair *qpair)
{
	return qpair->num_outstanding_reqs;
}
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@
	spdk_nvme_qpair_print_command;
	spdk_nvme_qpair_print_completion;
	spdk_nvme_qpair_get_id;
	spdk_nvme_qpair_get_num_outstanding_reqs;

	spdk_nvme_print_command;
	spdk_nvme_print_completion;