diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-03-07 15:02:37 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-12 09:54:29 -0500 |
commit | 488d1469b318e6bf2b907743d626008340bc4f6e (patch) | |
tree | 66853f237b78ebbe2b28b991c640aefe83297615 /drivers/scsi/lpfc/lpfc_hbadisc.c | |
parent | 071a651e28bfc1a66a885dc285792e335427a097 (diff) |
[SCSI] lpfc 8.1.4 : Fix Discovery processing for NPorts that change their NPortId on the fly
Fix Discovery processing for NPorts that change their NPortId on the fly
due to a cable swap.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 68 |
1 files changed, 60 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index e7664a6bd251..2b227b363ae3 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -59,6 +59,7 @@ static void lpfc_disc_timeout_handler(struct lpfc_hba *); | |||
59 | static void | 59 | static void |
60 | lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) | 60 | lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) |
61 | { | 61 | { |
62 | uint8_t *name = (uint8_t *)&ndlp->nlp_portname; | ||
62 | int warn_on = 0; | 63 | int warn_on = 0; |
63 | 64 | ||
64 | spin_lock_irq(phba->host->host_lock); | 65 | spin_lock_irq(phba->host->host_lock); |
@@ -79,15 +80,23 @@ lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) | |||
79 | 80 | ||
80 | if (warn_on) { | 81 | if (warn_on) { |
81 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, | 82 | lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, |
82 | "%d:0203 Nodev timeout on NPort x%x " | 83 | "%d:0203 Nodev timeout on " |
83 | "Data: x%x x%x x%x\n", | 84 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " |
84 | phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, | 85 | "NPort x%x Data: x%x x%x x%x\n", |
86 | phba->brd_no, | ||
87 | *name, *(name+1), *(name+2), *(name+3), | ||
88 | *(name+4), *(name+5), *(name+6), *(name+7), | ||
89 | ndlp->nlp_DID, ndlp->nlp_flag, | ||
85 | ndlp->nlp_state, ndlp->nlp_rpi); | 90 | ndlp->nlp_state, ndlp->nlp_rpi); |
86 | } else { | 91 | } else { |
87 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, | 92 | lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, |
88 | "%d:0204 Nodev timeout on NPort x%x " | 93 | "%d:0204 Nodev timeout on " |
89 | "Data: x%x x%x x%x\n", | 94 | "WWPN %x:%x:%x:%x:%x:%x:%x:%x " |
90 | phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, | 95 | "NPort x%x Data: x%x x%x x%x\n", |
96 | phba->brd_no, | ||
97 | *name, *(name+1), *(name+2), *(name+3), | ||
98 | *(name+4), *(name+5), *(name+6), *(name+7), | ||
99 | ndlp->nlp_DID, ndlp->nlp_flag, | ||
91 | ndlp->nlp_state, ndlp->nlp_rpi); | 100 | ndlp->nlp_state, ndlp->nlp_rpi); |
92 | } | 101 | } |
93 | 102 | ||
@@ -945,7 +954,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) | |||
945 | } | 954 | } |
946 | ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; | 955 | ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; |
947 | lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); | 956 | lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST); |
948 | lpfc_issue_els_plogi(phba, ndlp, 0); | 957 | lpfc_issue_els_plogi(phba, NameServer_DID, 0); |
949 | if (phba->cfg_fdmi_on) { | 958 | if (phba->cfg_fdmi_on) { |
950 | ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, | 959 | ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, |
951 | GFP_KERNEL); | 960 | GFP_KERNEL); |
@@ -953,7 +962,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb) | |||
953 | lpfc_nlp_init(phba, ndlp_fdmi, FDMI_DID); | 962 | lpfc_nlp_init(phba, ndlp_fdmi, FDMI_DID); |
954 | ndlp_fdmi->nlp_type |= NLP_FABRIC; | 963 | ndlp_fdmi->nlp_type |= NLP_FABRIC; |
955 | ndlp_fdmi->nlp_state = NLP_STE_PLOGI_ISSUE; | 964 | ndlp_fdmi->nlp_state = NLP_STE_PLOGI_ISSUE; |
956 | lpfc_issue_els_plogi(phba, ndlp_fdmi, 0); | 965 | lpfc_issue_els_plogi(phba, FDMI_DID, 0); |
957 | } | 966 | } |
958 | } | 967 | } |
959 | } | 968 | } |
@@ -2516,6 +2525,49 @@ lpfc_findnode_rpi(struct lpfc_hba * phba, uint16_t rpi) | |||
2516 | return NULL; | 2525 | return NULL; |
2517 | } | 2526 | } |
2518 | 2527 | ||
2528 | /* | ||
2529 | * This routine looks up the ndlp lists | ||
2530 | * for the given WWPN. If WWPN found | ||
2531 | * it return the node list pointer | ||
2532 | * else return NULL. | ||
2533 | */ | ||
2534 | struct lpfc_nodelist * | ||
2535 | lpfc_findnode_wwpn(struct lpfc_hba * phba, uint32_t order, | ||
2536 | struct lpfc_name * wwpn) | ||
2537 | { | ||
2538 | struct lpfc_nodelist *ndlp; | ||
2539 | struct list_head * lists[]={&phba->fc_nlpunmap_list, | ||
2540 | &phba->fc_nlpmap_list, | ||
2541 | &phba->fc_npr_list, | ||
2542 | &phba->fc_plogi_list, | ||
2543 | &phba->fc_adisc_list, | ||
2544 | &phba->fc_reglogin_list, | ||
2545 | &phba->fc_prli_list}; | ||
2546 | uint32_t search[]={NLP_SEARCH_UNMAPPED, | ||
2547 | NLP_SEARCH_MAPPED, | ||
2548 | NLP_SEARCH_NPR, | ||
2549 | NLP_SEARCH_PLOGI, | ||
2550 | NLP_SEARCH_ADISC, | ||
2551 | NLP_SEARCH_REGLOGIN, | ||
2552 | NLP_SEARCH_PRLI}; | ||
2553 | int i; | ||
2554 | |||
2555 | spin_lock_irq(phba->host->host_lock); | ||
2556 | for (i = 0; i < ARRAY_SIZE(lists); i++ ) { | ||
2557 | if (!(order & search[i])) | ||
2558 | continue; | ||
2559 | list_for_each_entry(ndlp, lists[i], nlp_listp) { | ||
2560 | if (memcmp(&ndlp->nlp_portname, wwpn, | ||
2561 | sizeof(struct lpfc_name)) == 0) { | ||
2562 | spin_unlock_irq(phba->host->host_lock); | ||
2563 | return ndlp; | ||
2564 | } | ||
2565 | } | ||
2566 | } | ||
2567 | spin_unlock_irq(phba->host->host_lock); | ||
2568 | return NULL; | ||
2569 | } | ||
2570 | |||
2519 | void | 2571 | void |
2520 | lpfc_nlp_init(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, | 2572 | lpfc_nlp_init(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, |
2521 | uint32_t did) | 2573 | uint32_t did) |