Commit 20aefac3 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Validate adapter support for SRIU option

When using the special option to suppress the response iu, ensure the
adapter fully supports the feature by checking feature flags from the
adapter and validating the support when formatting the WQE.
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 c1dd9111
...@@ -3293,6 +3293,9 @@ struct lpfc_sli4_parameters { ...@@ -3293,6 +3293,9 @@ struct lpfc_sli4_parameters {
#define cfg_eqdr_SHIFT 8 #define cfg_eqdr_SHIFT 8
#define cfg_eqdr_MASK 0x00000001 #define cfg_eqdr_MASK 0x00000001
#define cfg_eqdr_WORD word19 #define cfg_eqdr_WORD word19
#define cfg_nosr_SHIFT 9
#define cfg_nosr_MASK 0x00000001
#define cfg_nosr_WORD word19
#define LPFC_NODELAY_MAX_IO 32 #define LPFC_NODELAY_MAX_IO 32
}; };
......
...@@ -10473,8 +10473,19 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) ...@@ -10473,8 +10473,19 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP; phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP;
} }
if (bf_get(cfg_xib, mbx_sli4_parameters) && phba->cfg_suppress_rsp) /*
* To support Suppress Response feature we must satisfy 3 conditions.
* lpfc_suppress_rsp module parameter must be set (default).
* In SLI4-Parameters Descriptor:
* Extended Inline Buffers (XIB) must be supported.
* Suppress Response IU Not Supported (SRIUNS) must NOT be supported
* (double negative).
*/
if (phba->cfg_suppress_rsp && bf_get(cfg_xib, mbx_sli4_parameters) &&
!(bf_get(cfg_nosr, mbx_sli4_parameters)))
phba->sli.sli_flag |= LPFC_SLI_SUPPRESS_RSP; phba->sli.sli_flag |= LPFC_SLI_SUPPRESS_RSP;
else
phba->cfg_suppress_rsp = 0;
if (bf_get(cfg_eqdr, mbx_sli4_parameters)) if (bf_get(cfg_eqdr, mbx_sli4_parameters))
phba->sli.sli_flag |= LPFC_SLI_USE_EQDR; phba->sli.sli_flag |= LPFC_SLI_USE_EQDR;
......
...@@ -2290,9 +2290,10 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, ...@@ -2290,9 +2290,10 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba,
if (rsp->op == NVMET_FCOP_READDATA_RSP) { if (rsp->op == NVMET_FCOP_READDATA_RSP) {
atomic_inc(&tgtp->xmt_fcp_read_rsp); atomic_inc(&tgtp->xmt_fcp_read_rsp);
bf_set(wqe_ar, &wqe->fcp_tsend.wqe_com, 1); bf_set(wqe_ar, &wqe->fcp_tsend.wqe_com, 1);
if ((ndlp->nlp_flag & NLP_SUPPRESS_RSP) && if (rsp->rsplen == LPFC_NVMET_SUCCESS_LEN) {
(rsp->rsplen == 12)) { if (ndlp->nlp_flag & NLP_SUPPRESS_RSP)
bf_set(wqe_sup, &wqe->fcp_tsend.wqe_com, 1); bf_set(wqe_sup,
&wqe->fcp_tsend.wqe_com, 1);
bf_set(wqe_wqes, &wqe->fcp_tsend.wqe_com, 0); bf_set(wqe_wqes, &wqe->fcp_tsend.wqe_com, 0);
bf_set(wqe_irsp, &wqe->fcp_tsend.wqe_com, 0); bf_set(wqe_irsp, &wqe->fcp_tsend.wqe_com, 0);
bf_set(wqe_irsplen, &wqe->fcp_tsend.wqe_com, 0); bf_set(wqe_irsplen, &wqe->fcp_tsend.wqe_com, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment