diff options
author | James Smart <james.smart@emulex.com> | 2012-08-03 12:35:03 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-14 09:34:46 -0400 |
commit | 34f5ad8bddeda2a6b8d0dd1b61a015d06e62e1a4 (patch) | |
tree | 7d7b134176d53e19eaff21f42c555aa999fb61dc /drivers | |
parent | 908e18e4e7a1e77d3cefb227599d653a6907bbb4 (diff) |
[SCSI] lpfc 8.3.33: Fix error when remote port switches address
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 32 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 35 |
2 files changed, 59 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d54ae199979..3c624a5494a 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -1476,6 +1476,10 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, | |||
1476 | return ndlp; | 1476 | return ndlp; |
1477 | memset(&rrq.xri_bitmap, 0, sizeof(new_ndlp->active_rrqs.xri_bitmap)); | 1477 | memset(&rrq.xri_bitmap, 0, sizeof(new_ndlp->active_rrqs.xri_bitmap)); |
1478 | 1478 | ||
1479 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, | ||
1480 | "3178 PLOGI confirm: ndlp %p x%x: new_ndlp %p\n", | ||
1481 | ndlp, ndlp->nlp_DID, new_ndlp); | ||
1482 | |||
1479 | if (!new_ndlp) { | 1483 | if (!new_ndlp) { |
1480 | rc = memcmp(&ndlp->nlp_portname, name, | 1484 | rc = memcmp(&ndlp->nlp_portname, name, |
1481 | sizeof(struct lpfc_name)); | 1485 | sizeof(struct lpfc_name)); |
@@ -1527,6 +1531,9 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, | |||
1527 | /* The new_ndlp is replacing ndlp totally, so we need | 1531 | /* The new_ndlp is replacing ndlp totally, so we need |
1528 | * to put ndlp on UNUSED list and try to free it. | 1532 | * to put ndlp on UNUSED list and try to free it. |
1529 | */ | 1533 | */ |
1534 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, | ||
1535 | "3179 PLOGI confirm NEW: %x %x\n", | ||
1536 | new_ndlp->nlp_DID, keepDID); | ||
1530 | 1537 | ||
1531 | /* Fix up the rport accordingly */ | 1538 | /* Fix up the rport accordingly */ |
1532 | rport = ndlp->rport; | 1539 | rport = ndlp->rport; |
@@ -1559,23 +1566,34 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, | |||
1559 | lpfc_drop_node(vport, ndlp); | 1566 | lpfc_drop_node(vport, ndlp); |
1560 | } | 1567 | } |
1561 | else { | 1568 | else { |
1569 | lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, | ||
1570 | "3180 PLOGI confirm SWAP: %x %x\n", | ||
1571 | new_ndlp->nlp_DID, keepDID); | ||
1572 | |||
1562 | lpfc_unreg_rpi(vport, ndlp); | 1573 | lpfc_unreg_rpi(vport, ndlp); |
1574 | |||
1563 | /* Two ndlps cannot have the same did */ | 1575 | /* Two ndlps cannot have the same did */ |
1564 | ndlp->nlp_DID = keepDID; | 1576 | ndlp->nlp_DID = keepDID; |
1565 | if (phba->sli_rev == LPFC_SLI_REV4) | 1577 | if (phba->sli_rev == LPFC_SLI_REV4) |
1566 | memcpy(&ndlp->active_rrqs.xri_bitmap, | 1578 | memcpy(&ndlp->active_rrqs.xri_bitmap, |
1567 | &rrq.xri_bitmap, | 1579 | &rrq.xri_bitmap, |
1568 | sizeof(ndlp->active_rrqs.xri_bitmap)); | 1580 | sizeof(ndlp->active_rrqs.xri_bitmap)); |
1581 | |||
1569 | /* Since we are swapping the ndlp passed in with the new one | 1582 | /* Since we are swapping the ndlp passed in with the new one |
1570 | * and the did has already been swapped, copy over the | 1583 | * and the did has already been swapped, copy over state. |
1571 | * state and names. | 1584 | * The new WWNs are already in new_ndlp since thats what |
1585 | * we looked it up by in the begining of this routine. | ||
1572 | */ | 1586 | */ |
1573 | memcpy(&new_ndlp->nlp_portname, &ndlp->nlp_portname, | ||
1574 | sizeof(struct lpfc_name)); | ||
1575 | memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename, | ||
1576 | sizeof(struct lpfc_name)); | ||
1577 | new_ndlp->nlp_state = ndlp->nlp_state; | 1587 | new_ndlp->nlp_state = ndlp->nlp_state; |
1578 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); | 1588 | |
1589 | /* Since we are switching over to the new_ndlp, the old | ||
1590 | * ndlp should be put in the NPR state, unless we have | ||
1591 | * already started re-discovery on it. | ||
1592 | */ | ||
1593 | if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) || | ||
1594 | (ndlp->nlp_state == NLP_STE_MAPPED_NODE)) | ||
1595 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); | ||
1596 | |||
1579 | /* Fix up the rport accordingly */ | 1597 | /* Fix up the rport accordingly */ |
1580 | rport = ndlp->rport; | 1598 | rport = ndlp->rport; |
1581 | if (rport) { | 1599 | if (rport) { |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 9b4f92941dc..6b36d95668c 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -123,6 +123,10 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
123 | "rport devlosscb: sid:x%x did:x%x flg:x%x", | 123 | "rport devlosscb: sid:x%x did:x%x flg:x%x", |
124 | ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); | 124 | ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); |
125 | 125 | ||
126 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, | ||
127 | "3181 dev_loss_callbk x%06x, rport %p flg x%x\n", | ||
128 | ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag); | ||
129 | |||
126 | /* Don't defer this if we are in the process of deleting the vport | 130 | /* Don't defer this if we are in the process of deleting the vport |
127 | * or unloading the driver. The unload will cleanup the node | 131 | * or unloading the driver. The unload will cleanup the node |
128 | * appropriately we just need to cleanup the ndlp rport info here. | 132 | * appropriately we just need to cleanup the ndlp rport info here. |
@@ -142,6 +146,15 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
142 | if (ndlp->nlp_state == NLP_STE_MAPPED_NODE) | 146 | if (ndlp->nlp_state == NLP_STE_MAPPED_NODE) |
143 | return; | 147 | return; |
144 | 148 | ||
149 | if (ndlp->nlp_type & NLP_FABRIC) { | ||
150 | |||
151 | /* If the WWPN of the rport and ndlp don't match, ignore it */ | ||
152 | if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn)) { | ||
153 | put_device(&rport->dev); | ||
154 | return; | ||
155 | } | ||
156 | } | ||
157 | |||
145 | evtp = &ndlp->dev_loss_evt; | 158 | evtp = &ndlp->dev_loss_evt; |
146 | 159 | ||
147 | if (!list_empty(&evtp->evt_listp)) | 160 | if (!list_empty(&evtp->evt_listp)) |
@@ -202,6 +215,10 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) | |||
202 | "rport devlosstmo:did:x%x type:x%x id:x%x", | 215 | "rport devlosstmo:did:x%x type:x%x id:x%x", |
203 | ndlp->nlp_DID, ndlp->nlp_type, rport->scsi_target_id); | 216 | ndlp->nlp_DID, ndlp->nlp_type, rport->scsi_target_id); |
204 | 217 | ||
218 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, | ||
219 | "3182 dev_loss_tmo_handler x%06x, rport %p flg x%x\n", | ||
220 | ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag); | ||
221 | |||
205 | /* Don't defer this if we are in the process of deleting the vport | 222 | /* Don't defer this if we are in the process of deleting the vport |
206 | * or unloading the driver. The unload will cleanup the node | 223 | * or unloading the driver. The unload will cleanup the node |
207 | * appropriately we just need to cleanup the ndlp rport info here. | 224 | * appropriately we just need to cleanup the ndlp rport info here. |
@@ -3834,6 +3851,10 @@ lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
3834 | if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) | 3851 | if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) |
3835 | fc_remote_port_rolechg(rport, rport_ids.roles); | 3852 | fc_remote_port_rolechg(rport, rport_ids.roles); |
3836 | 3853 | ||
3854 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, | ||
3855 | "3183 rport register x%06x, rport %p role x%x\n", | ||
3856 | ndlp->nlp_DID, rport, rport_ids.roles); | ||
3857 | |||
3837 | if ((rport->scsi_target_id != -1) && | 3858 | if ((rport->scsi_target_id != -1) && |
3838 | (rport->scsi_target_id < LPFC_MAX_TARGET)) { | 3859 | (rport->scsi_target_id < LPFC_MAX_TARGET)) { |
3839 | ndlp->nlp_sid = rport->scsi_target_id; | 3860 | ndlp->nlp_sid = rport->scsi_target_id; |
@@ -3850,6 +3871,10 @@ lpfc_unregister_remote_port(struct lpfc_nodelist *ndlp) | |||
3850 | "rport delete: did:x%x flg:x%x type x%x", | 3871 | "rport delete: did:x%x flg:x%x type x%x", |
3851 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); | 3872 | ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); |
3852 | 3873 | ||
3874 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, | ||
3875 | "3184 rport unregister x%06x, rport %p\n", | ||
3876 | ndlp->nlp_DID, rport); | ||
3877 | |||
3853 | fc_remote_port_delete(rport); | 3878 | fc_remote_port_delete(rport); |
3854 | 3879 | ||
3855 | return; | 3880 | return; |
@@ -5365,9 +5390,17 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) | |||
5365 | struct lpfc_nodelist *ndlp; | 5390 | struct lpfc_nodelist *ndlp; |
5366 | 5391 | ||
5367 | list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { | 5392 | list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { |
5368 | if (filter(ndlp, param)) | 5393 | if (filter(ndlp, param)) { |
5394 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, | ||
5395 | "3185 FIND node filter %p DID " | ||
5396 | "Data: x%p x%x x%x\n", | ||
5397 | filter, ndlp, ndlp->nlp_DID, | ||
5398 | ndlp->nlp_flag); | ||
5369 | return ndlp; | 5399 | return ndlp; |
5400 | } | ||
5370 | } | 5401 | } |
5402 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, | ||
5403 | "3186 FIND node filter %p NOT FOUND.\n", filter); | ||
5371 | return NULL; | 5404 | return NULL; |
5372 | } | 5405 | } |
5373 | 5406 | ||