diff options
author | Krishna Mohan <krmohan@cisco.com> | 2013-03-01 06:35:31 -0500 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2013-05-10 13:19:19 -0400 |
commit | e6c10b7c5e0e7c6ecf7d60f502c7eeaf3361b48f (patch) | |
tree | 16930a7bcdff2a234cf52ad07a8c1cf1c22d2230 /drivers/scsi | |
parent | c1be5a5b1b355d40e6cf79cc979eb66dafa24ad1 (diff) |
libfcoe: Fix Conflicting FCFs issue in the fabric
When multiple FCFs in use, and first FIP Advertisement received is
with "Available for Login" i.e A bit set to 0, FCF selection will fail.
The fix is to remove the assumption in the code that first FCF is only
allowed selectable FCF.
Consider the scenario fip->fcfs contains FCF1(fabricname X, marked A=0)
FCF2(fabricname Y, marked A=1). list_first_entry(first) points to FCF1
and 1st iteration we ignore the FCF and on 2nd iteration we compare
FCF1 & FCF2 fabric name and we fails to perform FCF selection.
Signed-off-by: Krishna Mohan <krmohan@cisco.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/fcoe/fcoe_ctlr.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index a76247201be5..4c7764181b79 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
@@ -1548,9 +1548,6 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip) | |||
1548 | { | 1548 | { |
1549 | struct fcoe_fcf *fcf; | 1549 | struct fcoe_fcf *fcf; |
1550 | struct fcoe_fcf *best = fip->sel_fcf; | 1550 | struct fcoe_fcf *best = fip->sel_fcf; |
1551 | struct fcoe_fcf *first; | ||
1552 | |||
1553 | first = list_first_entry(&fip->fcfs, struct fcoe_fcf, list); | ||
1554 | 1551 | ||
1555 | list_for_each_entry(fcf, &fip->fcfs, list) { | 1552 | list_for_each_entry(fcf, &fip->fcfs, list) { |
1556 | LIBFCOE_FIP_DBG(fip, "consider FCF fab %16.16llx " | 1553 | LIBFCOE_FIP_DBG(fip, "consider FCF fab %16.16llx " |
@@ -1568,17 +1565,15 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip) | |||
1568 | "" : "un"); | 1565 | "" : "un"); |
1569 | continue; | 1566 | continue; |
1570 | } | 1567 | } |
1571 | if (fcf->fabric_name != first->fabric_name || | 1568 | if (!best || fcf->pri < best->pri || best->flogi_sent) |
1572 | fcf->vfid != first->vfid || | 1569 | best = fcf; |
1573 | fcf->fc_map != first->fc_map) { | 1570 | if (fcf->fabric_name != best->fabric_name || |
1571 | fcf->vfid != best->vfid || | ||
1572 | fcf->fc_map != best->fc_map) { | ||
1574 | LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, " | 1573 | LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, " |
1575 | "or FC-MAP\n"); | 1574 | "or FC-MAP\n"); |
1576 | return NULL; | 1575 | return NULL; |
1577 | } | 1576 | } |
1578 | if (fcf->flogi_sent) | ||
1579 | continue; | ||
1580 | if (!best || fcf->pri < best->pri || best->flogi_sent) | ||
1581 | best = fcf; | ||
1582 | } | 1577 | } |
1583 | fip->sel_fcf = best; | 1578 | fip->sel_fcf = best; |
1584 | if (best) { | 1579 | if (best) { |