nvme: zero request->submit_tick in allocation

Request may be submitted several times via nvme_qpair_submit_request
function, such as request in queued_req queue being re-submitted.

With enabling timeout feature, nvme_qpair_submit_request compares
request->submit_tick to zero to check if this is the first submission
for this request. If true, record submit_tick for this reuqest.

So request->submit_tick needs to be set zero in allocation.

Signed-off-by: lorneli <lorneli@163.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456328 (master)

(cherry picked from commit a5dfbc4daf)
Change-Id: Ie3f420aa337802c5ad3962c3fdcd680dec1ccdcb
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457290
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
lorneli 2019-05-30 18:34:12 +08:00 committed by Darek Stojaczyk
parent ad96f83787
commit 902bef378c

View File

@ -881,6 +881,7 @@ nvme_allocate_request(struct spdk_nvme_qpair *qpair,
req->payload_size = payload_size;
req->qpair = qpair;
req->pid = g_spdk_nvme_pid;
req->submit_tick = 0;
return req;
}