|
@@ -8188,6 +8188,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
|
|
|
bf_set(wqe_qosd, &wqe->els_req.wqe_com, 1);
|
|
|
bf_set(wqe_lenloc, &wqe->els_req.wqe_com, LPFC_WQE_LENLOC_NONE);
|
|
|
bf_set(wqe_ebde_cnt, &wqe->els_req.wqe_com, 0);
|
|
|
+ wqe->els_req.max_response_payload_len = total_len - xmit_len;
|
|
|
break;
|
|
|
case CMD_XMIT_SEQUENCE64_CX:
|
|
|
bf_set(wqe_ctxt_tag, &wqe->xmit_sequence.wqe_com,
|
|
@@ -8324,6 +8325,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
|
|
|
bf_set(wqe_qosd, &wqe->gen_req.wqe_com, 1);
|
|
|
bf_set(wqe_lenloc, &wqe->gen_req.wqe_com, LPFC_WQE_LENLOC_NONE);
|
|
|
bf_set(wqe_ebde_cnt, &wqe->gen_req.wqe_com, 0);
|
|
|
+ wqe->gen_req.max_response_payload_len = total_len - xmit_len;
|
|
|
command_type = OTHER_COMMAND;
|
|
|
break;
|
|
|
case CMD_XMIT_ELS_RSP64_CX:
|
|
@@ -11195,8 +11197,11 @@ lpfc_sli4_iocb_param_transfer(struct lpfc_hba *phba,
|
|
|
struct lpfc_iocbq *pIocbOut,
|
|
|
struct lpfc_wcqe_complete *wcqe)
|
|
|
{
|
|
|
+ int numBdes, i;
|
|
|
unsigned long iflags;
|
|
|
- uint32_t status;
|
|
|
+ uint32_t status, max_response;
|
|
|
+ struct lpfc_dmabuf *dmabuf;
|
|
|
+ struct ulp_bde64 *bpl, bde;
|
|
|
size_t offset = offsetof(struct lpfc_iocbq, iocb);
|
|
|
|
|
|
memcpy((char *)pIocbIn + offset, (char *)pIocbOut + offset,
|
|
@@ -11213,7 +11218,36 @@ lpfc_sli4_iocb_param_transfer(struct lpfc_hba *phba,
|
|
|
pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter;
|
|
|
else {
|
|
|
pIocbIn->iocb.un.ulpWord[4] = wcqe->parameter;
|
|
|
- pIocbIn->iocb.un.genreq64.bdl.bdeSize = wcqe->total_data_placed;
|
|
|
+ switch (pIocbOut->iocb.ulpCommand) {
|
|
|
+ case CMD_ELS_REQUEST64_CR:
|
|
|
+ dmabuf = (struct lpfc_dmabuf *)pIocbOut->context3;
|
|
|
+ bpl = (struct ulp_bde64 *)dmabuf->virt;
|
|
|
+ bde.tus.w = le32_to_cpu(bpl[1].tus.w);
|
|
|
+ max_response = bde.tus.f.bdeSize;
|
|
|
+ break;
|
|
|
+ case CMD_GEN_REQUEST64_CR:
|
|
|
+ max_response = 0;
|
|
|
+ if (!pIocbOut->context3)
|
|
|
+ break;
|
|
|
+ numBdes = pIocbOut->iocb.un.genreq64.bdl.bdeSize/
|
|
|
+ sizeof(struct ulp_bde64);
|
|
|
+ dmabuf = (struct lpfc_dmabuf *)pIocbOut->context3;
|
|
|
+ bpl = (struct ulp_bde64 *)dmabuf->virt;
|
|
|
+ for (i = 0; i < numBdes; i++) {
|
|
|
+ bde.tus.w = le32_to_cpu(bpl[i].tus.w);
|
|
|
+ if (bde.tus.f.bdeFlags != BUFF_TYPE_BDE_64)
|
|
|
+ max_response += bde.tus.f.bdeSize;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ max_response = wcqe->total_data_placed;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (max_response < wcqe->total_data_placed)
|
|
|
+ pIocbIn->iocb.un.genreq64.bdl.bdeSize = max_response;
|
|
|
+ else
|
|
|
+ pIocbIn->iocb.un.genreq64.bdl.bdeSize =
|
|
|
+ wcqe->total_data_placed;
|
|
|
}
|
|
|
|
|
|
/* Convert BG errors for completion status */
|