Commit 892d8bc4 authored by Naresh Gottumukkala's avatar Naresh Gottumukkala Committed by Tomasz Zawadzki
Browse files

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: default avatarNaresh 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: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAnil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 36ba0c57
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1277,7 +1277,7 @@ nvmf_fc_request_execute(struct spdk_nvmf_fc_request *fc_req)

static int
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;
	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.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->oxid = frame->ox_id;
	fc_req->oxid = from_be16(&fc_req->oxid);
	fc_req->rpi = fc_conn->rpi;
	fc_req->buf_index = buf_idx;
	fc_req->poller_lcore = hwqp->lcore_id;
	fc_req->poller_thread = hwqp->thread;
	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.iovcnt  = 0;

	/* Release Q buffer */
	nvmf_fc_rqpair_buffer_release(hwqp, fc_req->buf_index);

	/* Free Fc request */
	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)) {

		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 {

		SPDK_ERRLOG("Unknown frame received. Dropping\n");
+1 −1
Original line number Diff line number Diff line
@@ -328,10 +328,10 @@ struct spdk_nvmf_fc_port {
 */
struct spdk_nvmf_fc_request {
	struct spdk_nvmf_request req;
	union nvmf_h2c_msg cmd;
	struct spdk_nvmf_fc_ersp_iu ersp;
	uint32_t poller_lcore; /* for tracing purposes only */
	struct spdk_thread *poller_thread;
	uint16_t buf_index;
	struct spdk_nvmf_fc_xchg *xchg;
	uint16_t oxid;
	uint16_t rpi;