Skip to content

Commit 596fc8a

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: Fix dmabuf ptr assignment in lpfc_ct_reject_event()
Upon driver receipt of a CT cmd for type = 0xFA (Management Server) and subtype = 0x11 (Fabric Device Management Interface), the driver is responding with garbage CT cmd data when it should send a properly formed RJT. The __lpfc_prep_xmit_seq64_s4() routine was using the wrong buffer for the reject. Fix by converting the routine to use the buffer specified in the bde within the wqe rather than the ill-set bmp element. Link: https://lore.kernel.org/r/[email protected] Fixes: 61910d6 ("scsi: lpfc: SLI path split: Refactor CT paths") Co-developed-by: Justin Tee <[email protected]> Signed-off-by: Justin Tee <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ead76d4 commit 596fc8a

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10808,24 +10808,15 @@ __lpfc_sli_prep_xmit_seq64_s4(struct lpfc_iocbq *cmdiocbq,
1080810808
{
1080910809
union lpfc_wqe128 *wqe;
1081010810
struct ulp_bde64 *bpl;
10811-
struct ulp_bde64_le *bde;
1081210811

1081310812
wqe = &cmdiocbq->wqe;
1081410813
memset(wqe, 0, sizeof(*wqe));
1081510814

1081610815
/* Words 0 - 2 */
1081710816
bpl = (struct ulp_bde64 *)bmp->virt;
10818-
if (cmdiocbq->cmd_flag & (LPFC_IO_LIBDFC | LPFC_IO_LOOPBACK)) {
10819-
wqe->xmit_sequence.bde.addrHigh = bpl->addrHigh;
10820-
wqe->xmit_sequence.bde.addrLow = bpl->addrLow;
10821-
wqe->xmit_sequence.bde.tus.w = bpl->tus.w;
10822-
} else {
10823-
bde = (struct ulp_bde64_le *)&wqe->xmit_sequence.bde;
10824-
bde->addr_low = cpu_to_le32(putPaddrLow(bmp->phys));
10825-
bde->addr_high = cpu_to_le32(putPaddrHigh(bmp->phys));
10826-
bde->type_size = cpu_to_le32(bpl->tus.f.bdeSize);
10827-
bde->type_size |= cpu_to_le32(ULP_BDE64_TYPE_BDE_64);
10828-
}
10817+
wqe->xmit_sequence.bde.addrHigh = bpl->addrHigh;
10818+
wqe->xmit_sequence.bde.addrLow = bpl->addrLow;
10819+
wqe->xmit_sequence.bde.tus.w = bpl->tus.w;
1082910820

1083010821
/* Word 5 */
1083110822
bf_set(wqe_ls, &wqe->xmit_sequence.wge_ctl, last_seq);

0 commit comments

Comments
 (0)