diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2006-04-06 22:13:39 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-04-14 15:05:09 -0400 |
commit | 30a6c65236f9d26e3325cae468f330b833a3878c (patch) | |
tree | 355519ccc74d4b3984c06d7dcb5852282e47c845 /include/scsi | |
parent | fd7255f51a13ea915099c7e488001dfbbeb05104 (diff) |
[SCSI] iscsi: fix up iscsi eh
The current iscsi_tcp eh is not nicely setup for dm-multipath
and performs some extra task management functions when they
are not needed.
The attached patch:
- Fixes the TMF issues. If a session is rebuilt
then we do not send aborts.
- Fixes the problem where if the host reset fired, we would
return SUCCESS even though we had not really done anything
yet. This ends up causing problem with scsi_error.c's TUR.
- If someone has turned on the userspace nop daemon code to try
and detect network problems before the scsi command timeout
we can now drop and clean up the session before the scsi command
timesout and fires the eh speeding up the time it takes for a
command to go from one patch to another. For network problems
we fail the command with DID_BUS_BUSY so if failfast is set
scsi_decide_disposition fails the command up to dm for it to
try on another path.
- And we had to add some basic iscsi session block code. Previously
if we were trying to repair a session we would retrun a MLQUEUE code
in the queuecommand. This worked but it was not the most efficient
or pretty thing to do since it would take a while to relogin
to the target. For iscsi_tcp/open-iscsi a lot of the iscsi error handler
is in userspace the block code is pretty bare. We will be
adding to that for qla4xxx.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 2 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 2c3a89b64e71..eebe2b15161b 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -174,6 +174,7 @@ enum iscsi_param { | |||
174 | ISCSI_PARAM_TPGT, | 174 | ISCSI_PARAM_TPGT, |
175 | ISCSI_PARAM_PERSISTENT_ADDRESS, | 175 | ISCSI_PARAM_PERSISTENT_ADDRESS, |
176 | ISCSI_PARAM_PERSISTENT_PORT, | 176 | ISCSI_PARAM_PERSISTENT_PORT, |
177 | ISCSI_PARAM_SESS_RECOVERY_TMO, | ||
177 | 178 | ||
178 | /* pased in through bind conn using transport_fd */ | 179 | /* pased in through bind conn using transport_fd */ |
179 | ISCSI_PARAM_CONN_PORT, | 180 | ISCSI_PARAM_CONN_PORT, |
@@ -201,6 +202,7 @@ enum iscsi_param { | |||
201 | #define ISCSI_TPGT (1 << ISCSI_PARAM_TPGT) | 202 | #define ISCSI_TPGT (1 << ISCSI_PARAM_TPGT) |
202 | #define ISCSI_PERSISTENT_ADDRESS (1 << ISCSI_PARAM_PERSISTENT_ADDRESS) | 203 | #define ISCSI_PERSISTENT_ADDRESS (1 << ISCSI_PARAM_PERSISTENT_ADDRESS) |
203 | #define ISCSI_PERSISTENT_PORT (1 << ISCSI_PARAM_PERSISTENT_PORT) | 204 | #define ISCSI_PERSISTENT_PORT (1 << ISCSI_PARAM_PERSISTENT_PORT) |
205 | #define ISCSI_SESS_RECOVERY_TMO (1 << ISCSI_PARAM_SESS_RECOVERY_TMO) | ||
204 | #define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT) | 206 | #define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT) |
205 | #define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS) | 207 | #define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS) |
206 | 208 | ||
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 4b200645c84b..9d2b99159ee7 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -90,6 +90,7 @@ struct iscsi_transport { | |||
90 | char *data, uint32_t data_size); | 90 | char *data, uint32_t data_size); |
91 | void (*get_stats) (struct iscsi_cls_conn *conn, | 91 | void (*get_stats) (struct iscsi_cls_conn *conn, |
92 | struct iscsi_stats *stats); | 92 | struct iscsi_stats *stats); |
93 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); | ||
93 | }; | 94 | }; |
94 | 95 | ||
95 | /* | 96 | /* |
@@ -130,12 +131,20 @@ struct iscsi_cls_conn { | |||
130 | 131 | ||
131 | struct iscsi_cls_session { | 132 | struct iscsi_cls_session { |
132 | struct list_head sess_list; /* item in session_list */ | 133 | struct list_head sess_list; /* item in session_list */ |
134 | struct list_head host_list; | ||
133 | struct iscsi_transport *transport; | 135 | struct iscsi_transport *transport; |
134 | 136 | ||
135 | /* iSCSI values used as unique id by userspace. */ | 137 | /* iSCSI values used as unique id by userspace. */ |
136 | char *targetname; | 138 | char *targetname; |
137 | int tpgt; | 139 | int tpgt; |
138 | 140 | ||
141 | /* recovery fields */ | ||
142 | int recovery_tmo; | ||
143 | struct work_struct recovery_work; | ||
144 | |||
145 | int target_id; | ||
146 | int channel; | ||
147 | |||
139 | int sid; /* session id */ | 148 | int sid; /* session id */ |
140 | void *dd_data; /* LLD private data */ | 149 | void *dd_data; /* LLD private data */ |
141 | struct device dev; /* sysfs transport/container device */ | 150 | struct device dev; /* sysfs transport/container device */ |
@@ -147,15 +156,23 @@ struct iscsi_cls_session { | |||
147 | #define iscsi_session_to_shost(_session) \ | 156 | #define iscsi_session_to_shost(_session) \ |
148 | dev_to_shost(_session->dev.parent) | 157 | dev_to_shost(_session->dev.parent) |
149 | 158 | ||
159 | struct iscsi_host { | ||
160 | int next_target_id; | ||
161 | struct list_head sessions; | ||
162 | struct mutex mutex; | ||
163 | }; | ||
164 | |||
150 | /* | 165 | /* |
151 | * session and connection functions that can be used by HW iSCSI LLDs | 166 | * session and connection functions that can be used by HW iSCSI LLDs |
152 | */ | 167 | */ |
153 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, | 168 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, |
154 | struct iscsi_transport *t); | 169 | struct iscsi_transport *t, int channel); |
155 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); | 170 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); |
156 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, | 171 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, |
157 | uint32_t cid); | 172 | uint32_t cid); |
158 | extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); | 173 | extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); |
174 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); | ||
175 | extern void iscsi_block_session(struct iscsi_cls_session *session); | ||
159 | 176 | ||
160 | /* | 177 | /* |
161 | * session functions used by software iscsi | 178 | * session functions used by software iscsi |