diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2009-01-16 13:36:52 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-25 08:55:13 -0500 |
commit | 41bbdbebbbe7e06871d25f51c2eb1d6466bb9e5f (patch) | |
tree | d457ba5ef266100b75e85af89ddc0eb622978d1f /drivers/scsi | |
parent | 2f5899a39dcffb404c9a3d06ad438aff3e03bf04 (diff) |
[SCSI] qla4xxx: do not reuse session when connecting to different target port
qla4xxx does not check the I_T nexus values correctly
so it ends up creating one session to the target. If
a portal should disappear or they should be reported
in different order the driver will think it is already
logged in when it could now be speaking to a different
target portal or accessing it through a different
initiator port (iscsi initiator port is not tied to
hardware and is just the initiator name plus isid
so you could end up with multiple ports through one
host).
This patch has the driver check the iscsi scsi port
values when matching sessions (we do not check
the initiator name because that is static). It results
in a portal from each target portal group getting
logged into instead of just one per target. In the future
the firmware should hopefully send us notification of other
sessions that are created to other portals within the
same tpgt and the sessions should have different isids.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_def.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index d6be0762eb91..b586f27c3bd4 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h | |||
@@ -244,6 +244,7 @@ struct ddb_entry { | |||
244 | uint8_t ip_addr[ISCSI_IPADDR_SIZE]; | 244 | uint8_t ip_addr[ISCSI_IPADDR_SIZE]; |
245 | uint8_t iscsi_name[ISCSI_NAME_SIZE]; /* 72 x48 */ | 245 | uint8_t iscsi_name[ISCSI_NAME_SIZE]; /* 72 x48 */ |
246 | uint8_t iscsi_alias[0x20]; | 246 | uint8_t iscsi_alias[0x20]; |
247 | uint8_t isid[6]; | ||
247 | }; | 248 | }; |
248 | 249 | ||
249 | /* | 250 | /* |
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 109c5f5985ec..af8c3233e8ae 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
@@ -342,8 +342,12 @@ static struct ddb_entry* qla4xxx_get_ddb_entry(struct scsi_qla_host *ha, | |||
342 | DEBUG2(printk("scsi%ld: %s: Looking for ddb[%d]\n", ha->host_no, | 342 | DEBUG2(printk("scsi%ld: %s: Looking for ddb[%d]\n", ha->host_no, |
343 | __func__, fw_ddb_index)); | 343 | __func__, fw_ddb_index)); |
344 | list_for_each_entry(ddb_entry, &ha->ddb_list, list) { | 344 | list_for_each_entry(ddb_entry, &ha->ddb_list, list) { |
345 | if (memcmp(ddb_entry->iscsi_name, fw_ddb_entry->iscsi_name, | 345 | if ((memcmp(ddb_entry->iscsi_name, fw_ddb_entry->iscsi_name, |
346 | ISCSI_NAME_SIZE) == 0) { | 346 | ISCSI_NAME_SIZE) == 0) && |
347 | (ddb_entry->tpgt == | ||
348 | le32_to_cpu(fw_ddb_entry->tgt_portal_grp)) && | ||
349 | (memcmp(ddb_entry->isid, fw_ddb_entry->isid, | ||
350 | sizeof(ddb_entry->isid)) == 0)) { | ||
347 | found++; | 351 | found++; |
348 | break; | 352 | break; |
349 | } | 353 | } |
@@ -430,6 +434,8 @@ static int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha, | |||
430 | 434 | ||
431 | ddb_entry->port = le16_to_cpu(fw_ddb_entry->port); | 435 | ddb_entry->port = le16_to_cpu(fw_ddb_entry->port); |
432 | ddb_entry->tpgt = le32_to_cpu(fw_ddb_entry->tgt_portal_grp); | 436 | ddb_entry->tpgt = le32_to_cpu(fw_ddb_entry->tgt_portal_grp); |
437 | memcpy(ddb_entry->isid, fw_ddb_entry->isid, sizeof(ddb_entry->isid)); | ||
438 | |||
433 | memcpy(&ddb_entry->iscsi_name[0], &fw_ddb_entry->iscsi_name[0], | 439 | memcpy(&ddb_entry->iscsi_name[0], &fw_ddb_entry->iscsi_name[0], |
434 | min(sizeof(ddb_entry->iscsi_name), | 440 | min(sizeof(ddb_entry->iscsi_name), |
435 | sizeof(fw_ddb_entry->iscsi_name))); | 441 | sizeof(fw_ddb_entry->iscsi_name))); |