nvmf/fc: Dont hold hardware command buffer.

Currently we are holding hardware receive command buffer till
the IO is completed. This is effecting the number of commands hardware
can receive. Copy the cmd into driver buffer and release the
hardware receive buffer back to hardware ASAP.

Signed-off-by: Naresh Gottumukkala <raju.gottumukkala@broadcom.com>
Change-Id: Ic292056b3e012d40515d0de5b9808cd8960811ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5430
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Naresh Gottumukkala 2020-11-26 08:59:18 +00:00 committed by Tomasz Zawadzki
parent 36ba0c573a
commit 892d8bc436
2 changed files with 8 additions and 8 deletions

View File

@ -1277,7 +1277,7 @@ nvmf_fc_request_execute(struct spdk_nvmf_fc_request *fc_req)
static int static int
nvmf_fc_hwqp_handle_request(struct spdk_nvmf_fc_hwqp *hwqp, struct spdk_nvmf_fc_frame_hdr *frame, nvmf_fc_hwqp_handle_request(struct spdk_nvmf_fc_hwqp *hwqp, struct spdk_nvmf_fc_frame_hdr *frame,
uint32_t buf_idx, struct spdk_nvmf_fc_buffer_desc *buffer, uint32_t plen) struct spdk_nvmf_fc_buffer_desc *buffer, uint32_t plen)
{ {
uint16_t cmnd_len; uint16_t cmnd_len;
uint64_t rqst_conn_id; uint64_t rqst_conn_id;
@ -1342,12 +1342,12 @@ nvmf_fc_hwqp_handle_request(struct spdk_nvmf_fc_hwqp *hwqp, struct spdk_nvmf_fc_
fc_req->req.length = from_be32(&cmd_iu->data_len); fc_req->req.length = from_be32(&cmd_iu->data_len);
fc_req->req.qpair = &fc_conn->qpair; fc_req->req.qpair = &fc_conn->qpair;
fc_req->req.cmd = (union nvmf_h2c_msg *)&cmd_iu->cmd; memcpy(&fc_req->cmd, &cmd_iu->cmd, sizeof(union nvmf_h2c_msg));
fc_req->req.cmd = (union nvmf_h2c_msg *)&fc_req->cmd;
fc_req->req.rsp = (union nvmf_c2h_msg *)&fc_req->ersp.rsp; fc_req->req.rsp = (union nvmf_c2h_msg *)&fc_req->ersp.rsp;
fc_req->oxid = frame->ox_id; fc_req->oxid = frame->ox_id;
fc_req->oxid = from_be16(&fc_req->oxid); fc_req->oxid = from_be16(&fc_req->oxid);
fc_req->rpi = fc_conn->rpi; fc_req->rpi = fc_conn->rpi;
fc_req->buf_index = buf_idx;
fc_req->poller_lcore = hwqp->lcore_id; fc_req->poller_lcore = hwqp->lcore_id;
fc_req->poller_thread = hwqp->thread; fc_req->poller_thread = hwqp->thread;
fc_req->hwqp = hwqp; fc_req->hwqp = hwqp;
@ -1396,9 +1396,6 @@ _nvmf_fc_request_free(struct spdk_nvmf_fc_request *fc_req)
fc_req->req.data = NULL; fc_req->req.data = NULL;
fc_req->req.iovcnt = 0; fc_req->req.iovcnt = 0;
/* Release Q buffer */
nvmf_fc_rqpair_buffer_release(hwqp, fc_req->buf_index);
/* Free Fc request */ /* Free Fc request */
nvmf_fc_hwqp_free_fc_request(hwqp, fc_req); nvmf_fc_hwqp_free_fc_request(hwqp, fc_req);
} }
@ -1520,7 +1517,10 @@ nvmf_fc_hwqp_process_frame(struct spdk_nvmf_fc_hwqp *hwqp,
(frame->type == FCNVME_TYPE_FC_EXCHANGE)) { (frame->type == FCNVME_TYPE_FC_EXCHANGE)) {
SPDK_DEBUGLOG(nvmf_fc, "Process IO NVME frame\n"); SPDK_DEBUGLOG(nvmf_fc, "Process IO NVME frame\n");
rc = nvmf_fc_hwqp_handle_request(hwqp, frame, buff_idx, buffer, plen); rc = nvmf_fc_hwqp_handle_request(hwqp, frame, buffer, plen);
if (!rc) {
nvmf_fc_rqpair_buffer_release(hwqp, buff_idx);
}
} else { } else {
SPDK_ERRLOG("Unknown frame received. Dropping\n"); SPDK_ERRLOG("Unknown frame received. Dropping\n");

View File

@ -328,10 +328,10 @@ struct spdk_nvmf_fc_port {
*/ */
struct spdk_nvmf_fc_request { struct spdk_nvmf_fc_request {
struct spdk_nvmf_request req; struct spdk_nvmf_request req;
union nvmf_h2c_msg cmd;
struct spdk_nvmf_fc_ersp_iu ersp; struct spdk_nvmf_fc_ersp_iu ersp;
uint32_t poller_lcore; /* for tracing purposes only */ uint32_t poller_lcore; /* for tracing purposes only */
struct spdk_thread *poller_thread; struct spdk_thread *poller_thread;
uint16_t buf_index;
struct spdk_nvmf_fc_xchg *xchg; struct spdk_nvmf_fc_xchg *xchg;
uint16_t oxid; uint16_t oxid;
uint16_t rpi; uint16_t rpi;