nvme: do not try to resubmit requests on error
If the transport returns error when polling for completions, it gets to a uint32_t and we end up trying to resubmit all of the requests that are currently queued. But that's not correct - if the transport returns an error we shouldn't be trying to resubmit requests at all. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I9198e3e2d71875cc1e46e0ac928338bb983487f3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8395 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
7d5ba10581
commit
59c8bb527b
@ -658,6 +658,8 @@ nvme_qpair_resubmit_requests(struct spdk_nvme_qpair *qpair, uint32_t num_request
|
||||
int resubmit_rc;
|
||||
struct nvme_request *req;
|
||||
|
||||
assert(num_requests > 0);
|
||||
|
||||
for (i = 0; i < num_requests; i++) {
|
||||
if (qpair->ctrlr->is_resetting) {
|
||||
break;
|
||||
@ -733,7 +735,9 @@ spdk_nvme_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
|
||||
* At this point, ret must represent the number of completions we reaped.
|
||||
* submit as many queued requests as we completed.
|
||||
*/
|
||||
nvme_qpair_resubmit_requests(qpair, ret);
|
||||
if (ret > 0) {
|
||||
nvme_qpair_resubmit_requests(qpair, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2579,7 +2579,9 @@ nvme_rdma_poll_group_process_completions(struct spdk_nvme_transport_poll_group *
|
||||
|
||||
nvme_rdma_qpair_submit_sends(rqpair);
|
||||
nvme_rdma_qpair_submit_recvs(rqpair);
|
||||
nvme_qpair_resubmit_requests(&rqpair->qpair, rqpair->num_completions);
|
||||
if (rqpair->num_completions > 0) {
|
||||
nvme_qpair_resubmit_requests(&rqpair->qpair, rqpair->num_completions);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user