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: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15916
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
Richael Zhuang 2022-12-14 15:03:32 +08:00 committed by Tomasz Zawadzki
parent 41bf6280e9
commit 070d61f2d6
4 changed files with 24 additions and 0 deletions

View File

@ -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" 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. 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 ### bdev_nvme
Updated `bdev_nvme_set_options` RPC (and rpc.py) to support the new `transport_tos` parameter. Updated `bdev_nvme_set_options` RPC (and rpc.py) to support the new `transport_tos` parameter.

View File

@ -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); 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). * \brief Prints (SPDK_NOTICELOG) the contents of an NVMe submission queue entry (command).
* *

View File

@ -1197,3 +1197,9 @@ spdk_nvme_qpair_get_id(struct spdk_nvme_qpair *qpair)
{ {
return qpair->id; return qpair->id;
} }
uint32_t
spdk_nvme_qpair_get_num_outstanding_reqs(struct spdk_nvme_qpair *qpair)
{
return qpair->num_outstanding_reqs;
}

View File

@ -178,6 +178,7 @@
spdk_nvme_qpair_print_command; spdk_nvme_qpair_print_command;
spdk_nvme_qpair_print_completion; spdk_nvme_qpair_print_completion;
spdk_nvme_qpair_get_id; spdk_nvme_qpair_get_id;
spdk_nvme_qpair_get_num_outstanding_reqs;
spdk_nvme_print_command; spdk_nvme_print_command;
spdk_nvme_print_completion; spdk_nvme_print_completion;