* [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing
@ 2015-05-22 14:42 James Smart
2015-05-24 19:56 ` Sebastian Herbszt
2015-05-25 15:15 ` Hannes Reinecke
0 siblings, 2 replies; 4+ messages in thread
From: James Smart @ 2015-05-22 14:42 UTC (permalink / raw)
To: linux-scsi
Devices are not discovered during takeaway/giveback testing
When a remote nport changes it's DID, a new ndlp is used.
However, we left the old ndlp state unchanged and still in
a discovery state. The may stall discovery resulting in some
devices not being discovered. Correct by swapping the state
of the 2 ndlp's when a DID swap is detected.
Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
---
drivers/scsi/lpfc/lpfc_els.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 30021f3..21c4a3d 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1509,12 +1509,14 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
struct lpfc_nodelist *ndlp)
{
struct lpfc_vport *vport = ndlp->vport;
+ struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
struct lpfc_nodelist *new_ndlp;
struct lpfc_rport_data *rdata;
struct fc_rport *rport;
struct serv_parm *sp;
uint8_t name[sizeof(struct lpfc_name)];
uint32_t rc, keepDID = 0, keep_nlp_flag = 0;
+ uint16_t keep_nlp_state;
int put_node;
int put_rport;
unsigned long *active_rrqs_xri_bitmap = NULL;
@@ -1603,11 +1605,14 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
ndlp->active_rrqs_xri_bitmap,
phba->cfg_rrq_xri_bitmap_sz);
+ spin_lock_irq(shost->host_lock);
keep_nlp_flag = new_ndlp->nlp_flag;
new_ndlp->nlp_flag = ndlp->nlp_flag;
ndlp->nlp_flag = keep_nlp_flag;
+ spin_unlock_irq(shost->host_lock);
- /* Set state will put new_ndlp on to node list if not already done */
+ /* Set nlp_states accordingly */
+ keep_nlp_state = new_ndlp->nlp_state;
lpfc_nlp_set_state(vport, new_ndlp, ndlp->nlp_state);
/* Move this back to NPR state */
@@ -1668,20 +1673,13 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
active_rrqs_xri_bitmap,
phba->cfg_rrq_xri_bitmap_sz);
- /* Since we are swapping the ndlp passed in with the new one
- * and the did has already been swapped, copy over state.
- * The new WWNs are already in new_ndlp since thats what
- * we looked it up by in the begining of this routine.
- */
- new_ndlp->nlp_state = ndlp->nlp_state;
-
- /* Since we are switching over to the new_ndlp, the old
- * ndlp should be put in the NPR state, unless we have
- * already started re-discovery on it.
+ /* Since we are switching over to the new_ndlp,
+ * reset the old ndlp state
*/
if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) ||
(ndlp->nlp_state == NLP_STE_MAPPED_NODE))
- lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
+ keep_nlp_state = NLP_STE_NPR_NODE;
+ lpfc_nlp_set_state(vport, ndlp, keep_nlp_state);
/* Fix up the rport accordingly */
rport = ndlp->rport;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing
2015-05-22 14:42 [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing James Smart
@ 2015-05-24 19:56 ` Sebastian Herbszt
2015-05-26 13:36 ` James Smart
2015-05-25 15:15 ` Hannes Reinecke
1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Herbszt @ 2015-05-24 19:56 UTC (permalink / raw)
To: James Smart; +Cc: linux-scsi, Sebastian Herbszt
James Smart wrote:
>
> Devices are not discovered during takeaway/giveback testing
>
> When a remote nport changes it's DID, a new ndlp is used.
its
> However, we left the old ndlp state unchanged and still in
> a discovery state. The may stall discovery resulting in some
The?
> devices not being discovered. Correct by swapping the state
two spaces
> of the 2 ndlp's when a DID swap is detected.
Sebastian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing
2015-05-22 14:42 [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing James Smart
2015-05-24 19:56 ` Sebastian Herbszt
@ 2015-05-25 15:15 ` Hannes Reinecke
1 sibling, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2015-05-25 15:15 UTC (permalink / raw)
To: James Smart, linux-scsi
On 05/22/2015 04:42 PM, James Smart wrote:
>
> Devices are not discovered during takeaway/giveback testing
>
> When a remote nport changes it's DID, a new ndlp is used.
> However, we left the old ndlp state unchanged and still in
> a discovery state. The may stall discovery resulting in some
> devices not being discovered. Correct by swapping the state
> of the 2 ndlp's when a DID swap is detected.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
> Signed-off-by: James Smart <james.smart@avagotech.com>
> ---
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing
2015-05-24 19:56 ` Sebastian Herbszt
@ 2015-05-26 13:36 ` James Smart
0 siblings, 0 replies; 4+ messages in thread
From: James Smart @ 2015-05-26 13:36 UTC (permalink / raw)
To: Sebastian Herbszt; +Cc: linux-scsi
uh - we're flagging issues with in a patch explanation (such as 2 spaces
after a period) and not something in the patch itself ??
I'm not going to revise patches for minor typos or styles disagreements
in patch descriptions.
-- james
On 5/24/2015 3:56 PM, Sebastian Herbszt wrote:
> James Smart wrote:
>> Devices are not discovered during takeaway/giveback testing
>>
>> When a remote nport changes it's DID, a new ndlp is used.
> its
>
>> However, we left the old ndlp state unchanged and still in
>> a discovery state. The may stall discovery resulting in some
> The?
>
>> devices not being discovered. Correct by swapping the state
> two spaces
>
>> of the 2 ndlp's when a DID swap is detected.
> Sebastian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-26 13:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 14:42 [PATCH 3/9] lpfc: Devices are not discovered during takeaway/giveback testing James Smart
2015-05-24 19:56 ` Sebastian Herbszt
2015-05-26 13:36 ` James Smart
2015-05-25 15:15 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox