aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorDavid Dillow <dillowda@ornl.gov>2010-10-08 14:40:47 -0400
committerRoland Dreier <rolandd@cisco.com>2010-10-23 01:19:10 -0400
commitbb12588a38e6db85e01dceadff7bc161fc92e7d2 (patch)
tree6cf9f3b90cc1118aa2fcd716537916524384d428 /include/scsi
parentdd5e6e38b2b8bd8bf71cae800e2b613e85ef1522 (diff)
IB/srp: Implement SRP_CRED_REQ and SRP_AER_REQ
This patch adds support for SRP_CRED_REQ to avoid a lockup by targets that use that mechanism to return credits to the initiator. This prevents a lockup observed in the field where we would never add the credits from the SRP_CRED_REQ to our current count, and would therefore never send another command to the target. Minimal support for SRP_AER_REQ is also added, as these messages can also be used to convey additional credits to the initiator. Based upon extensive debugging and code by Bart Van Assche and a bug report by Chris Worley. Signed-off-by: David Dillow <dillowda@ornl.gov> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/srp.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/scsi/srp.h b/include/scsi/srp.h
index ad178fa78f66..1ae84db4c9fb 100644
--- a/include/scsi/srp.h
+++ b/include/scsi/srp.h
@@ -239,4 +239,42 @@ struct srp_rsp {
239 u8 data[0]; 239 u8 data[0];
240} __attribute__((packed)); 240} __attribute__((packed));
241 241
242struct srp_cred_req {
243 u8 opcode;
244 u8 sol_not;
245 u8 reserved[2];
246 __be32 req_lim_delta;
247 u64 tag;
248};
249
250struct srp_cred_rsp {
251 u8 opcode;
252 u8 reserved[7];
253 u64 tag;
254};
255
256/*
257 * The SRP spec defines the fixed portion of the AER_REQ structure to be
258 * 36 bytes, so it needs to be packed to avoid having it padded to 40 bytes
259 * on 64-bit architectures.
260 */
261struct srp_aer_req {
262 u8 opcode;
263 u8 sol_not;
264 u8 reserved[2];
265 __be32 req_lim_delta;
266 u64 tag;
267 u32 reserved2;
268 __be64 lun;
269 __be32 sense_data_len;
270 u32 reserved3;
271 u8 sense_data[0];
272} __attribute__((packed));
273
274struct srp_aer_rsp {
275 u8 opcode;
276 u8 reserved[7];
277 u64 tag;
278};
279
242#endif /* SCSI_SRP_H */ 280#endif /* SCSI_SRP_H */