diff options
author | James Smart <james.smart@emulex.com> | 2013-07-15 18:32:28 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-08-23 13:15:43 -0400 |
commit | 48a5a664d0f8b69689ed52ff59fdd7626bfb79be (patch) | |
tree | bfd76cd2a68f2322c62e948f3371384c21658331 /drivers/scsi/lpfc | |
parent | 445fd0809ec1bc8872df3acbe009278ac58402b4 (diff) |
[SCSI] lpfc 8.3.41: Fixed Receive Queue varied frame size handling
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 437740f65d1e..230f9eddb797 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -14703,14 +14703,20 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf) | |||
14703 | first_iocbq->iocb.unsli3.rcvsli3.vpi = | 14703 | first_iocbq->iocb.unsli3.rcvsli3.vpi = |
14704 | vport->phba->vpi_ids[vport->vpi]; | 14704 | vport->phba->vpi_ids[vport->vpi]; |
14705 | /* put the first buffer into the first IOCBq */ | 14705 | /* put the first buffer into the first IOCBq */ |
14706 | tot_len = bf_get(lpfc_rcqe_length, | ||
14707 | &seq_dmabuf->cq_event.cqe.rcqe_cmpl); | ||
14708 | |||
14706 | first_iocbq->context2 = &seq_dmabuf->dbuf; | 14709 | first_iocbq->context2 = &seq_dmabuf->dbuf; |
14707 | first_iocbq->context3 = NULL; | 14710 | first_iocbq->context3 = NULL; |
14708 | first_iocbq->iocb.ulpBdeCount = 1; | 14711 | first_iocbq->iocb.ulpBdeCount = 1; |
14709 | first_iocbq->iocb.un.cont64[0].tus.f.bdeSize = | 14712 | if (tot_len > LPFC_DATA_BUF_SIZE) |
14713 | first_iocbq->iocb.un.cont64[0].tus.f.bdeSize = | ||
14710 | LPFC_DATA_BUF_SIZE; | 14714 | LPFC_DATA_BUF_SIZE; |
14715 | else | ||
14716 | first_iocbq->iocb.un.cont64[0].tus.f.bdeSize = tot_len; | ||
14717 | |||
14711 | first_iocbq->iocb.un.rcvels.remoteID = sid; | 14718 | first_iocbq->iocb.un.rcvels.remoteID = sid; |
14712 | tot_len = bf_get(lpfc_rcqe_length, | 14719 | |
14713 | &seq_dmabuf->cq_event.cqe.rcqe_cmpl); | ||
14714 | first_iocbq->iocb.unsli3.rcvsli3.acc_len = tot_len; | 14720 | first_iocbq->iocb.unsli3.rcvsli3.acc_len = tot_len; |
14715 | } | 14721 | } |
14716 | iocbq = first_iocbq; | 14722 | iocbq = first_iocbq; |
@@ -14726,14 +14732,17 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf) | |||
14726 | if (!iocbq->context3) { | 14732 | if (!iocbq->context3) { |
14727 | iocbq->context3 = d_buf; | 14733 | iocbq->context3 = d_buf; |
14728 | iocbq->iocb.ulpBdeCount++; | 14734 | iocbq->iocb.ulpBdeCount++; |
14729 | pbde = (struct ulp_bde64 *) | ||
14730 | &iocbq->iocb.unsli3.sli3Words[4]; | ||
14731 | pbde->tus.f.bdeSize = LPFC_DATA_BUF_SIZE; | ||
14732 | |||
14733 | /* We need to get the size out of the right CQE */ | 14735 | /* We need to get the size out of the right CQE */ |
14734 | hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf); | 14736 | hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf); |
14735 | len = bf_get(lpfc_rcqe_length, | 14737 | len = bf_get(lpfc_rcqe_length, |
14736 | &hbq_buf->cq_event.cqe.rcqe_cmpl); | 14738 | &hbq_buf->cq_event.cqe.rcqe_cmpl); |
14739 | pbde = (struct ulp_bde64 *) | ||
14740 | &iocbq->iocb.unsli3.sli3Words[4]; | ||
14741 | if (len > LPFC_DATA_BUF_SIZE) | ||
14742 | pbde->tus.f.bdeSize = LPFC_DATA_BUF_SIZE; | ||
14743 | else | ||
14744 | pbde->tus.f.bdeSize = len; | ||
14745 | |||
14737 | iocbq->iocb.unsli3.rcvsli3.acc_len += len; | 14746 | iocbq->iocb.unsli3.rcvsli3.acc_len += len; |
14738 | tot_len += len; | 14747 | tot_len += len; |
14739 | } else { | 14748 | } else { |
@@ -14748,16 +14757,19 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf) | |||
14748 | lpfc_in_buf_free(vport->phba, d_buf); | 14757 | lpfc_in_buf_free(vport->phba, d_buf); |
14749 | continue; | 14758 | continue; |
14750 | } | 14759 | } |
14760 | /* We need to get the size out of the right CQE */ | ||
14761 | hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf); | ||
14762 | len = bf_get(lpfc_rcqe_length, | ||
14763 | &hbq_buf->cq_event.cqe.rcqe_cmpl); | ||
14751 | iocbq->context2 = d_buf; | 14764 | iocbq->context2 = d_buf; |
14752 | iocbq->context3 = NULL; | 14765 | iocbq->context3 = NULL; |
14753 | iocbq->iocb.ulpBdeCount = 1; | 14766 | iocbq->iocb.ulpBdeCount = 1; |
14754 | iocbq->iocb.un.cont64[0].tus.f.bdeSize = | 14767 | if (len > LPFC_DATA_BUF_SIZE) |
14768 | iocbq->iocb.un.cont64[0].tus.f.bdeSize = | ||
14755 | LPFC_DATA_BUF_SIZE; | 14769 | LPFC_DATA_BUF_SIZE; |
14770 | else | ||
14771 | iocbq->iocb.un.cont64[0].tus.f.bdeSize = len; | ||
14756 | 14772 | ||
14757 | /* We need to get the size out of the right CQE */ | ||
14758 | hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf); | ||
14759 | len = bf_get(lpfc_rcqe_length, | ||
14760 | &hbq_buf->cq_event.cqe.rcqe_cmpl); | ||
14761 | tot_len += len; | 14773 | tot_len += len; |
14762 | iocbq->iocb.unsli3.rcvsli3.acc_len = tot_len; | 14774 | iocbq->iocb.unsli3.rcvsli3.acc_len = tot_len; |
14763 | 14775 | ||