nvme: change num_children to be wider type

uint8_t is too small to handle huge payloads. 32M payload already
overflow this.

Change-Id: I083ba7d3ded25b99571d422b7a3a4e7653a8d231
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/408677
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Pawel Wodkowski 2018-04-23 18:52:25 +02:00 committed by Daniel Verkamp
parent 41d94136e6
commit f9fae3f3a9
2 changed files with 3 additions and 1 deletions

View File

@ -169,7 +169,7 @@ struct nvme_request {
* Number of children requests still outstanding for this
* request which was split into multiple child requests.
*/
uint8_t num_children;
uint16_t num_children;
uint32_t payload_size;
/**

View File

@ -62,6 +62,8 @@ nvme_cb_complete_child(void *child_arg, const struct spdk_nvme_cpl *cpl)
static void
nvme_request_add_child(struct nvme_request *parent, struct nvme_request *child)
{
assert(parent->num_children != UINT16_MAX);
if (parent->num_children == 0) {
/*
* Defer initialization of the children TAILQ since it falls