aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-01-07 17:44:57 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-01-18 04:53:12 -0500
commit41861fa831afd4b5006f0042e1f701360330351e (patch)
tree57818e9a7b160cd6b0bb17e74deb9565d238bcc5 /include/target
parent499bf77b0169605a23c38351e3849066fe696877 (diff)
target/sbc: Add DIF TYPE1+TYPE3 read/write verify emulation
This patch adds support for DIF read/write verify emulation for TARGET_DIF_TYPE1_PROT + TARGET_DIF_TYPE3_PROT operation. This includes sbc_dif_verify_write() + sbc_dif_verify_read() calls accessable by backend drivers to perform DIF verify for SGL based data and protection information. Also included is sbc_dif_copy_prot() logic to copy protection information to/from backend provided protection SGLs. Based on scsi_debug.c DIF TYPE1+TYPE3 emulation. v2 changes: - Select CRC_T10DIF for TARGET_CORE in Kconfig (Fengguang) - Drop IP checksum logic from sbc_dif_v1_verify (MKP) - Fix offset on app_tag = 0xffff in sbc_dif_verify_read() Cc: 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 'include/target')
-rw-r--r--include/target/target_core_backend.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 0dc2745b9b18..7020e33e742e 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -73,6 +73,10 @@ sense_reason_t sbc_execute_unmap(struct se_cmd *cmd,
73 sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv, 73 sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv,
74 sector_t lba, sector_t nolb), 74 sector_t lba, sector_t nolb),
75 void *priv); 75 void *priv);
76sense_reason_t sbc_dif_verify_write(struct se_cmd *, sector_t, unsigned int,
77 unsigned int, struct scatterlist *, int);
78sense_reason_t sbc_dif_verify_read(struct se_cmd *, sector_t, unsigned int,
79 unsigned int, struct scatterlist *, int);
76 80
77void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); 81void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
78int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); 82int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);