Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Justin Tee and committed by
Martin K. Petersen
8eebf0e8 b6d128f8

+3 -17
+3 -17
drivers/scsi/lpfc/lpfc_scsi.c
··· 109 109 } 110 110 } 111 111 112 - #define LPFC_INVALID_REFTAG ((u32)-1) 113 - 114 112 /** 115 113 * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread 116 114 * @phba: The Hba for which this call is being executed. ··· 976 978 977 979 sgpe = scsi_prot_sglist(sc); 978 980 lba = scsi_prot_ref_tag(sc); 979 - if (lba == LPFC_INVALID_REFTAG) 980 - return 0; 981 981 982 982 /* First check if we need to match the LBA */ 983 983 if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) { ··· 1556 1560 1557 1561 /* extract some info from the scsi command for pde*/ 1558 1562 reftag = scsi_prot_ref_tag(sc); 1559 - if (reftag == LPFC_INVALID_REFTAG) 1560 - goto out; 1561 1563 1562 1564 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS 1563 1565 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); ··· 1717 1723 /* extract some info from the scsi command */ 1718 1724 blksize = scsi_prot_interval(sc); 1719 1725 reftag = scsi_prot_ref_tag(sc); 1720 - if (reftag == LPFC_INVALID_REFTAG) 1721 - goto out; 1722 1726 1723 1727 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS 1724 1728 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); ··· 1945 1953 1946 1954 /* extract some info from the scsi command for pde*/ 1947 1955 reftag = scsi_prot_ref_tag(sc); 1948 - if (reftag == LPFC_INVALID_REFTAG) 1949 - goto out; 1950 1956 1951 1957 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS 1952 1958 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); ··· 2144 2154 /* extract some info from the scsi command */ 2145 2155 blksize = scsi_prot_interval(sc); 2146 2156 reftag = scsi_prot_ref_tag(sc); 2147 - if (reftag == LPFC_INVALID_REFTAG) 2148 - goto out; 2149 2157 2150 2158 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS 2151 2159 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); ··· 2734 2746 2735 2747 src = (struct scsi_dif_tuple *)sg_virt(sgpe); 2736 2748 start_ref_tag = scsi_prot_ref_tag(cmd); 2737 - if (start_ref_tag == LPFC_INVALID_REFTAG) 2738 - goto out; 2739 2749 start_app_tag = src->app_tag; 2740 2750 len = sgpe->length; 2741 2751 while (src && protsegcnt) { ··· 3479 3493 scsi_cmnd->sc_data_direction); 3480 3494 3481 3495 lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 3482 - "9084 Cannot setup S/G List for HBA" 3483 - "IO segs %d/%d SGL %d SCSI %d: %d %d\n", 3496 + "9084 Cannot setup S/G List for HBA " 3497 + "IO segs %d/%d SGL %d SCSI %d: %d %d %d\n", 3484 3498 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, 3485 3499 phba->cfg_total_seg_cnt, phba->cfg_sg_seg_cnt, 3486 - prot_group_type, num_sge); 3500 + prot_group_type, num_sge, ret); 3487 3501 3488 3502 lpfc_cmd->seg_cnt = 0; 3489 3503 lpfc_cmd->prot_seg_cnt = 0;