diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-23 15:39:23 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-01-18 21:22:06 -0500 |
commit | 59dedde2b67130bf81a2df55df464909c7459df5 (patch) | |
tree | 377a2f3b01dddeb630e3d6165302993074360da5 /drivers/target | |
parent | 6e611119b16c73a6e1c450d00deb4d7eef853336 (diff) |
tcm_loop: Enable DIF/DIX modes in SCSI host LLD
This patch updates tcm_loop_driver_probe() to set protection
information using scsi_host_set_prot() and scsi_host_set_guard(),
which currently enabled all modes of DIF/DIX protection, minus
DIX TYPE0.
Also, update tcm_loop_submission_work() to pass struct scsi_cmnd
related protection into target_submit_cmd_map_sgls() during CDB
dispatch.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 112b795a7b80..fadad7c5f635 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -217,7 +217,8 @@ static void tcm_loop_submission_work(struct work_struct *work) | |||
217 | scsi_bufflen(sc), tcm_loop_sam_attr(sc), | 217 | scsi_bufflen(sc), tcm_loop_sam_attr(sc), |
218 | sc->sc_data_direction, 0, | 218 | sc->sc_data_direction, 0, |
219 | scsi_sglist(sc), scsi_sg_count(sc), | 219 | scsi_sglist(sc), scsi_sg_count(sc), |
220 | sgl_bidi, sgl_bidi_count, NULL, 0); | 220 | sgl_bidi, sgl_bidi_count, |
221 | scsi_prot_sglist(sc), scsi_prot_sg_count(sc)); | ||
221 | if (rc < 0) { | 222 | if (rc < 0) { |
222 | set_host_byte(sc, DID_NO_CONNECT); | 223 | set_host_byte(sc, DID_NO_CONNECT); |
223 | goto out_done; | 224 | goto out_done; |
@@ -462,7 +463,7 @@ static int tcm_loop_driver_probe(struct device *dev) | |||
462 | { | 463 | { |
463 | struct tcm_loop_hba *tl_hba; | 464 | struct tcm_loop_hba *tl_hba; |
464 | struct Scsi_Host *sh; | 465 | struct Scsi_Host *sh; |
465 | int error; | 466 | int error, host_prot; |
466 | 467 | ||
467 | tl_hba = to_tcm_loop_hba(dev); | 468 | tl_hba = to_tcm_loop_hba(dev); |
468 | 469 | ||
@@ -486,6 +487,13 @@ static int tcm_loop_driver_probe(struct device *dev) | |||
486 | sh->max_channel = 0; | 487 | sh->max_channel = 0; |
487 | sh->max_cmd_len = TL_SCSI_MAX_CMD_LEN; | 488 | sh->max_cmd_len = TL_SCSI_MAX_CMD_LEN; |
488 | 489 | ||
490 | host_prot = SHOST_DIF_TYPE1_PROTECTION | SHOST_DIF_TYPE2_PROTECTION | | ||
491 | SHOST_DIF_TYPE3_PROTECTION | SHOST_DIX_TYPE1_PROTECTION | | ||
492 | SHOST_DIX_TYPE2_PROTECTION | SHOST_DIX_TYPE3_PROTECTION; | ||
493 | |||
494 | scsi_host_set_prot(sh, host_prot); | ||
495 | scsi_host_set_guard(sh, SHOST_DIX_GUARD_CRC); | ||
496 | |||
489 | error = scsi_add_host(sh, &tl_hba->dev); | 497 | error = scsi_add_host(sh, &tl_hba->dev); |
490 | if (error) { | 498 | if (error) { |
491 | pr_err("%s: scsi_add_host failed\n", __func__); | 499 | pr_err("%s: scsi_add_host failed\n", __func__); |