Skip to content

Commit 8eebf0e

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Remove reftag check in DIF paths
When preparing protection DIF I/O for DMA, the driver obtains reference tags from scsi_prot_ref_tag(). Previously, there was a wrong assumption that an all 0xffffffff value meant error and thus the driver failed the I/O. This patch removes the evaluation code and accepts whatever the upper layer returns. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20230803211932.155745-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b6d128f commit 8eebf0e

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ lpfc_sli4_set_rsp_sgl_last(struct lpfc_hba *phba,
109109
}
110110
}
111111

112-
#define LPFC_INVALID_REFTAG ((u32)-1)
113-
114112
/**
115113
* lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread
116114
* @phba: The Hba for which this call is being executed.
@@ -978,8 +976,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
978976

979977
sgpe = scsi_prot_sglist(sc);
980978
lba = scsi_prot_ref_tag(sc);
981-
if (lba == LPFC_INVALID_REFTAG)
982-
return 0;
983979

984980
/* First check if we need to match the LBA */
985981
if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) {
@@ -1560,8 +1556,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
15601556

15611557
/* extract some info from the scsi command for pde*/
15621558
reftag = scsi_prot_ref_tag(sc);
1563-
if (reftag == LPFC_INVALID_REFTAG)
1564-
goto out;
15651559

15661560
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
15671561
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -1723,8 +1717,6 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
17231717
/* extract some info from the scsi command */
17241718
blksize = scsi_prot_interval(sc);
17251719
reftag = scsi_prot_ref_tag(sc);
1726-
if (reftag == LPFC_INVALID_REFTAG)
1727-
goto out;
17281720

17291721
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
17301722
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -1953,8 +1945,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
19531945

19541946
/* extract some info from the scsi command for pde*/
19551947
reftag = scsi_prot_ref_tag(sc);
1956-
if (reftag == LPFC_INVALID_REFTAG)
1957-
goto out;
19581948

19591949
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
19601950
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -2154,8 +2144,6 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
21542144
/* extract some info from the scsi command */
21552145
blksize = scsi_prot_interval(sc);
21562146
reftag = scsi_prot_ref_tag(sc);
2157-
if (reftag == LPFC_INVALID_REFTAG)
2158-
goto out;
21592147

21602148
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
21612149
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
@@ -2746,8 +2734,6 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
27462734

27472735
src = (struct scsi_dif_tuple *)sg_virt(sgpe);
27482736
start_ref_tag = scsi_prot_ref_tag(cmd);
2749-
if (start_ref_tag == LPFC_INVALID_REFTAG)
2750-
goto out;
27512737
start_app_tag = src->app_tag;
27522738
len = sgpe->length;
27532739
while (src && protsegcnt) {
@@ -3493,11 +3479,11 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba,
34933479
scsi_cmnd->sc_data_direction);
34943480

34953481
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
3496-
"9084 Cannot setup S/G List for HBA"
3497-
"IO segs %d/%d SGL %d SCSI %d: %d %d\n",
3482+
"9084 Cannot setup S/G List for HBA "
3483+
"IO segs %d/%d SGL %d SCSI %d: %d %d %d\n",
34983484
lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
34993485
phba->cfg_total_seg_cnt, phba->cfg_sg_seg_cnt,
3500-
prot_group_type, num_sge);
3486+
prot_group_type, num_sge, ret);
35013487

35023488
lpfc_cmd->seg_cnt = 0;
35033489
lpfc_cmd->prot_seg_cnt = 0;

0 commit comments

Comments
 (0)