aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-03-05 12:43:49 -0500
committerRoland Dreier <roland@purestorage.com>2014-03-18 01:33:58 -0400
commit55e51eda4820ec5a1c1fc8693a51029f74eac2b9 (patch)
tree77198a5b21bff21aecc44f625b620efd2342d2f9 /include/scsi
parent177e31bd5a40999028f6694623ceea1bec5abff6 (diff)
SCSI/libiscsi: Add check_protection callback for transports
iSCSI needs to be at least aware that a task involves protection information. In case it does, after the transaction completed libiscsi will ask the transport to check the protection status of the transaction. Unlike transport errors, DIF errors should not prevent successful completion of the transaction from the transport point of view, but should be escelated to scsi mid-layer when constructing the scsi result and sense data. check_protection routine will return the ascq corresponding to the DIF error that occured (or 0 if no error happened). return ascq: - 0x1: GUARD_CHECK_FAILED - 0x2: APPTAG_CHECK_FAILED - 0x3: REFTAG_CHECK_FAILED Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Alex Tabachnik <alext@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libiscsi.h4
-rw-r--r--include/scsi/scsi_transport_iscsi.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 309f51336fb9..1457c26dfc58 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -133,6 +133,10 @@ struct iscsi_task {
133 unsigned long last_xfer; 133 unsigned long last_xfer;
134 unsigned long last_timeout; 134 unsigned long last_timeout;
135 bool have_checked_conn; 135 bool have_checked_conn;
136
137 /* T10 protection information */
138 bool protected;
139
136 /* state set/tested under session->lock */ 140 /* state set/tested under session->lock */
137 int state; 141 int state;
138 atomic_t refcount; 142 atomic_t refcount;
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 88640a47216c..2555ee5343fd 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -167,6 +167,7 @@ struct iscsi_transport {
167 struct iscsi_bus_flash_conn *fnode_conn); 167 struct iscsi_bus_flash_conn *fnode_conn);
168 int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess); 168 int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess);
169 int (*get_host_stats) (struct Scsi_Host *shost, char *buf, int len); 169 int (*get_host_stats) (struct Scsi_Host *shost, char *buf, int len);
170 u8 (*check_protection)(struct iscsi_task *task, sector_t *sector);
170}; 171};
171 172
172/* 173/*