aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-10-31 14:44:49 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-11-26 23:59:44 -0500
commit8012cc38cd1a98ec2c560b80c7d8b858955400e1 (patch)
tree3accd5cf0da3a42d96eb83f3781da4a6a2b64a1a
parenta6571c6ebad15d04e8312e71b0ed17675ea4f6b3 (diff)
[SCSI] lpfc 8.3.36: Update DIF support for passthru/strip/insert
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_hw4.h3
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.h4
4 files changed, 29 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 2cdeb5434fb7..a47cfbdd05f2 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -3219,6 +3219,9 @@ struct wqe_common {
3219#define wqe_dif_SHIFT 0 3219#define wqe_dif_SHIFT 0
3220#define wqe_dif_MASK 0x00000003 3220#define wqe_dif_MASK 0x00000003
3221#define wqe_dif_WORD word7 3221#define wqe_dif_WORD word7
3222#define LPFC_WQE_DIF_PASSTHRU 1
3223#define LPFC_WQE_DIF_STRIP 2
3224#define LPFC_WQE_DIF_INSERT 3
3222#define wqe_ct_SHIFT 2 3225#define wqe_ct_SHIFT 2
3223#define wqe_ct_MASK 0x00000003 3226#define wqe_ct_MASK 0x00000003
3224#define wqe_ct_WORD word7 3227#define wqe_ct_WORD word7
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index fd2ff5a9e18c..60e5a177644c 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -3227,6 +3227,21 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba,
3227 } 3227 }
3228 } 3228 }
3229 3229
3230 switch (scsi_get_prot_op(scsi_cmnd)) {
3231 case SCSI_PROT_WRITE_STRIP:
3232 case SCSI_PROT_READ_STRIP:
3233 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_STRIP;
3234 break;
3235 case SCSI_PROT_WRITE_INSERT:
3236 case SCSI_PROT_READ_INSERT:
3237 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_INSERT;
3238 break;
3239 case SCSI_PROT_WRITE_PASS:
3240 case SCSI_PROT_READ_PASS:
3241 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF_PASS;
3242 break;
3243 }
3244
3230 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd); 3245 fcpdl = lpfc_bg_scsi_adjust_dl(phba, lpfc_cmd);
3231 3246
3232 fcp_cmnd->fcpDl = be32_to_cpu(fcpdl); 3247 fcp_cmnd->fcpDl = be32_to_cpu(fcpdl);
@@ -3236,7 +3251,6 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba,
3236 * we need to set word 4 of IOCB here 3251 * we need to set word 4 of IOCB here
3237 */ 3252 */
3238 iocb_cmd->un.fcpi.fcpi_parm = fcpdl; 3253 iocb_cmd->un.fcpi.fcpi_parm = fcpdl;
3239 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_IO_DIF;
3240 3254
3241 return 0; 3255 return 0;
3242err: 3256err:
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index d7f3313ef886..624eab370396 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -8068,10 +8068,6 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
8068 LPFC_WQE_LENLOC_WORD4); 8068 LPFC_WQE_LENLOC_WORD4);
8069 bf_set(wqe_ebde_cnt, &wqe->fcp_iwrite.wqe_com, 0); 8069 bf_set(wqe_ebde_cnt, &wqe->fcp_iwrite.wqe_com, 0);
8070 bf_set(wqe_pu, &wqe->fcp_iwrite.wqe_com, iocbq->iocb.ulpPU); 8070 bf_set(wqe_pu, &wqe->fcp_iwrite.wqe_com, iocbq->iocb.ulpPU);
8071 if (iocbq->iocb_flag & LPFC_IO_DIF) {
8072 iocbq->iocb_flag &= ~LPFC_IO_DIF;
8073 bf_set(wqe_dif, &wqe->generic.wqe_com, 1);
8074 }
8075 bf_set(wqe_dbde, &wqe->fcp_iwrite.wqe_com, 1); 8071 bf_set(wqe_dbde, &wqe->fcp_iwrite.wqe_com, 1);
8076 break; 8072 break;
8077 case CMD_FCP_IREAD64_CR: 8073 case CMD_FCP_IREAD64_CR:
@@ -8091,10 +8087,6 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
8091 LPFC_WQE_LENLOC_WORD4); 8087 LPFC_WQE_LENLOC_WORD4);
8092 bf_set(wqe_ebde_cnt, &wqe->fcp_iread.wqe_com, 0); 8088 bf_set(wqe_ebde_cnt, &wqe->fcp_iread.wqe_com, 0);
8093 bf_set(wqe_pu, &wqe->fcp_iread.wqe_com, iocbq->iocb.ulpPU); 8089 bf_set(wqe_pu, &wqe->fcp_iread.wqe_com, iocbq->iocb.ulpPU);
8094 if (iocbq->iocb_flag & LPFC_IO_DIF) {
8095 iocbq->iocb_flag &= ~LPFC_IO_DIF;
8096 bf_set(wqe_dif, &wqe->generic.wqe_com, 1);
8097 }
8098 bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1); 8090 bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1);
8099 break; 8091 break;
8100 case CMD_FCP_ICMND64_CR: 8092 case CMD_FCP_ICMND64_CR:
@@ -8304,6 +8296,14 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq,
8304 break; 8296 break;
8305 } 8297 }
8306 8298
8299 if (iocbq->iocb_flag & LPFC_IO_DIF_PASS)
8300 bf_set(wqe_dif, &wqe->generic.wqe_com, LPFC_WQE_DIF_PASSTHRU);
8301 else if (iocbq->iocb_flag & LPFC_IO_DIF_STRIP)
8302 bf_set(wqe_dif, &wqe->generic.wqe_com, LPFC_WQE_DIF_STRIP);
8303 else if (iocbq->iocb_flag & LPFC_IO_DIF_INSERT)
8304 bf_set(wqe_dif, &wqe->generic.wqe_com, LPFC_WQE_DIF_INSERT);
8305 iocbq->iocb_flag &= ~(LPFC_IO_DIF_PASS | LPFC_IO_DIF_STRIP |
8306 LPFC_IO_DIF_INSERT);
8307 bf_set(wqe_xri_tag, &wqe->generic.wqe_com, xritag); 8307 bf_set(wqe_xri_tag, &wqe->generic.wqe_com, xritag);
8308 bf_set(wqe_reqtag, &wqe->generic.wqe_com, iocbq->iotag); 8308 bf_set(wqe_reqtag, &wqe->generic.wqe_com, iocbq->iotag);
8309 wqe->generic.wqe_com.abort_tag = abort_tag; 8309 wqe->generic.wqe_com.abort_tag = abort_tag;
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index 2f48d000a3b4..9d2e0c6fe334 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -69,7 +69,9 @@ struct lpfc_iocbq {
69#define LPFC_USE_FCPWQIDX 0x80 /* Submit to specified FCPWQ index */ 69#define LPFC_USE_FCPWQIDX 0x80 /* Submit to specified FCPWQ index */
70#define DSS_SECURITY_OP 0x100 /* security IO */ 70#define DSS_SECURITY_OP 0x100 /* security IO */
71#define LPFC_IO_ON_TXCMPLQ 0x200 /* The IO is still on the TXCMPLQ */ 71#define LPFC_IO_ON_TXCMPLQ 0x200 /* The IO is still on the TXCMPLQ */
72#define LPFC_IO_DIF 0x400 /* T10 DIF IO */ 72#define LPFC_IO_DIF_PASS 0x400 /* T10 DIF IO pass-thru prot */
73#define LPFC_IO_DIF_STRIP 0x800 /* T10 DIF IO strip prot */
74#define LPFC_IO_DIF_INSERT 0x1000 /* T10 DIF IO insert prot */
73 75
74#define LPFC_FIP_ELS_ID_MASK 0xc000 /* ELS_ID range 0-3, non-shifted mask */ 76#define LPFC_FIP_ELS_ID_MASK 0xc000 /* ELS_ID range 0-3, non-shifted mask */
75#define LPFC_FIP_ELS_ID_SHIFT 14 77#define LPFC_FIP_ELS_ID_SHIFT 14