Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8cf5dfe authored by James Smart's avatar James Smart Committed by Martin K. Petersen
Browse files

scsi: lpfc: Added recovery logic for running out of NVMET IO context resources



Previous logic would just drop the IO.

Added logic to queue the IO to wait for an IO context resource from an
IO thats already in progress.

Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6c621a22
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ struct rqb_dmabuf {
	struct lpfc_dmabuf dbuf;
	uint16_t total_size;
	uint16_t bytes_recv;
	uint16_t idx;
	struct lpfc_queue *hrq;	  /* ptr to associated Header RQ */
	struct lpfc_queue *drq;	  /* ptr to associated Data RQ */
};
+6 −0
Original line number Diff line number Diff line
@@ -245,6 +245,12 @@ lpfc_nvme_info_show(struct device *dev, struct device_attribute *attr,
				atomic_read(&tgtp->xmt_abort_rsp),
				atomic_read(&tgtp->xmt_abort_rsp_error));

		len += snprintf(buf + len, PAGE_SIZE - len,
				"IO_CTX: %08x outstanding %08x total %x",
				phba->sli4_hba.nvmet_ctx_cnt,
				phba->sli4_hba.nvmet_io_wait_cnt,
				phba->sli4_hba.nvmet_io_wait_total);

		len +=  snprintf(buf+len, PAGE_SIZE-len, "\n");
		return len;
	}
+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ void lpfc_retry_pport_discovery(struct lpfc_hba *);
void lpfc_release_rpi(struct lpfc_hba *, struct lpfc_vport *, uint16_t);
int lpfc_init_iocb_list(struct lpfc_hba *phba, int cnt);
void lpfc_free_iocb_list(struct lpfc_hba *phba);
int lpfc_post_rq_buffer(struct lpfc_hba *phba, struct lpfc_queue *hrq,
			struct lpfc_queue *drq, int count, int idx);

void lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *, LPFC_MBOXQ_t *);
void lpfc_mbx_cmpl_reg_login(struct lpfc_hba *, LPFC_MBOXQ_t *);
+6 −0
Original line number Diff line number Diff line
@@ -842,6 +842,12 @@ lpfc_debugfs_nvmestat_data(struct lpfc_vport *vport, char *buf, int size)
			}
			spin_unlock(&phba->sli4_hba.abts_nvme_buf_list_lock);
		}

		len += snprintf(buf + len, size - len,
				"IO_CTX: %08x  outstanding %08x total %08x\n",
				phba->sli4_hba.nvmet_ctx_cnt,
				phba->sli4_hba.nvmet_io_wait_cnt,
				phba->sli4_hba.nvmet_io_wait_total);
	} else {
		if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME))
			return len;
+2 −0
Original line number Diff line number Diff line
@@ -5825,6 +5825,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
		INIT_LIST_HEAD(&phba->sli4_hba.lpfc_abts_nvme_buf_list);
		INIT_LIST_HEAD(&phba->sli4_hba.lpfc_abts_nvmet_ctx_list);
		INIT_LIST_HEAD(&phba->sli4_hba.lpfc_nvmet_ctx_list);
		INIT_LIST_HEAD(&phba->sli4_hba.lpfc_nvmet_io_wait_list);

		/* Fast-path XRI aborted CQ Event work queue list */
		INIT_LIST_HEAD(&phba->sli4_hba.sp_nvme_xri_aborted_work_queue);
@@ -5833,6 +5834,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
	/* This abort list used by worker thread */
	spin_lock_init(&phba->sli4_hba.sgl_list_lock);
	spin_lock_init(&phba->sli4_hba.nvmet_io_lock);
	spin_lock_init(&phba->sli4_hba.nvmet_io_wait_lock);

	/*
	 * Initialize driver internal slow-path work queues
Loading