mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
scsi: lpfc: Remove reftag check in DIF paths
[ Upstream commit 8eebf0e84f ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b439e33a8c
commit
bef6c89a92
@@ -117,8 +117,6 @@ lpfc_sli4_set_rsp_sgl_last(struct lpfc_hba *phba,
|
||||
}
|
||||
}
|
||||
|
||||
#define LPFC_INVALID_REFTAG ((u32)-1)
|
||||
|
||||
/**
|
||||
* lpfc_update_stats - Update statistical data for the command completion
|
||||
* @vport: The virtual port on which this call is executing.
|
||||
@@ -1042,8 +1040,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||
|
||||
sgpe = scsi_prot_sglist(sc);
|
||||
lba = scsi_prot_ref_tag(sc);
|
||||
if (lba == LPFC_INVALID_REFTAG)
|
||||
return 0;
|
||||
|
||||
/* First check if we need to match the LBA */
|
||||
if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) {
|
||||
@@ -1624,8 +1620,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||
|
||||
/* extract some info from the scsi command for pde*/
|
||||
reftag = scsi_prot_ref_tag(sc);
|
||||
if (reftag == LPFC_INVALID_REFTAG)
|
||||
goto out;
|
||||
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
|
||||
@@ -1787,8 +1781,6 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||
/* extract some info from the scsi command */
|
||||
blksize = scsi_prot_interval(sc);
|
||||
reftag = scsi_prot_ref_tag(sc);
|
||||
if (reftag == LPFC_INVALID_REFTAG)
|
||||
goto out;
|
||||
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
|
||||
@@ -2018,8 +2010,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||
|
||||
/* extract some info from the scsi command for pde*/
|
||||
reftag = scsi_prot_ref_tag(sc);
|
||||
if (reftag == LPFC_INVALID_REFTAG)
|
||||
goto out;
|
||||
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
|
||||
@@ -2219,8 +2209,6 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||
/* extract some info from the scsi command */
|
||||
blksize = scsi_prot_interval(sc);
|
||||
reftag = scsi_prot_ref_tag(sc);
|
||||
if (reftag == LPFC_INVALID_REFTAG)
|
||||
goto out;
|
||||
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1);
|
||||
@@ -2812,8 +2800,6 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
|
||||
|
||||
src = (struct scsi_dif_tuple *)sg_virt(sgpe);
|
||||
start_ref_tag = scsi_prot_ref_tag(cmd);
|
||||
if (start_ref_tag == LPFC_INVALID_REFTAG)
|
||||
goto out;
|
||||
start_app_tag = src->app_tag;
|
||||
len = sgpe->length;
|
||||
while (src && protsegcnt) {
|
||||
@@ -3660,11 +3646,11 @@ err:
|
||||
scsi_cmnd->sc_data_direction);
|
||||
|
||||
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
|
||||
"9084 Cannot setup S/G List for HBA"
|
||||
"IO segs %d/%d SGL %d SCSI %d: %d %d\n",
|
||||
"9084 Cannot setup S/G List for HBA "
|
||||
"IO segs %d/%d SGL %d SCSI %d: %d %d %d\n",
|
||||
lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
|
||||
phba->cfg_total_seg_cnt, phba->cfg_sg_seg_cnt,
|
||||
prot_group_type, num_sge);
|
||||
prot_group_type, num_sge, ret);
|
||||
|
||||
lpfc_cmd->seg_cnt = 0;
|
||||
lpfc_cmd->prot_seg_cnt = 0;
|
||||
|
||||
Reference in New Issue
Block a user