nvme: move queueing requests to the generic layer
The tailq and the requests all belong to the generic layer, might as well put the queueing code there for better encapsulation. Change-Id: Id5f08f798121b50a21044cfc61856999c50ca227 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469758 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
fd892b333d
commit
7630daa204
@ -1984,12 +1984,8 @@ nvme_pcie_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_reques
|
||||
tr = TAILQ_FIRST(&pqpair->free_tr);
|
||||
|
||||
if (tr == NULL) {
|
||||
/*
|
||||
* Put the request on the qpair's request queue to be
|
||||
* processed when a tracker frees up via a command
|
||||
* completion.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
/* Inform the upper layer to try again later. */
|
||||
rc = -EAGAIN;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -633,6 +633,11 @@ nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *re
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rc == -EAGAIN) {
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
error:
|
||||
if (req->parent != NULL) {
|
||||
nvme_request_remove_child(req->parent, req);
|
||||
|
@ -1765,12 +1765,8 @@ nvme_rdma_qpair_submit_request(struct spdk_nvme_qpair *qpair,
|
||||
|
||||
rdma_req = nvme_rdma_req_get(rqpair);
|
||||
if (!rdma_req) {
|
||||
/*
|
||||
* No rdma_req is available, so queue the request to be
|
||||
* processed later.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
return 0;
|
||||
/* Inform the upper layer to try again later. */
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (nvme_rdma_req_init(rqpair, req, rdma_req)) {
|
||||
|
@ -694,12 +694,8 @@ nvme_tcp_qpair_submit_request(struct spdk_nvme_qpair *qpair,
|
||||
|
||||
tcp_req = nvme_tcp_req_get(tqpair);
|
||||
if (!tcp_req) {
|
||||
/*
|
||||
* No tcp_req is available, so queue the request to be
|
||||
* processed later.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
return 0;
|
||||
/* Inform the upper layer to try again later. */
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (nvme_tcp_req_init(tqpair, req, tcp_req)) {
|
||||
|
Loading…
Reference in New Issue
Block a user