diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2013-01-28 14:43:03 -0500 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2013-02-19 15:23:07 -0500 |
commit | 1f953b0dbc2549318afcc0a70af5542dffbce34a (patch) | |
tree | 38f9f5bbacd82835f2e9085b9a883df0c16e3297 /drivers/scsi/fcoe/fcoe_ctlr.c | |
parent | a586069b0f56a700d6f6249a64cbc313dd4a97e0 (diff) |
libfcoe: Check for unusable FCFs before looking for conflicting FCFs
When there are multiple FCFs in the fabric, and one of them becomes
unavailable, the fabric name for the unavailable FCF becomes 0 along
with FIP_FL_AVAIL getting reset. In this case, FCF selection logic does
not select any FCF as it first checks for conflicting FCFs (since fabric
name is 0, it fails the condition), instead of first checking if it is
usable or not. Fix it by first checking if FCF is usable and skip that
FCF, and go to the next one in the list to check if it can be selected.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe_ctlr.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe_ctlr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index aff3c44a1cdc..7aca9fd8a11c 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
@@ -1559,15 +1559,6 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip) | |||
1559 | fcf->fabric_name, fcf->vfid, fcf->fcf_mac, | 1559 | fcf->fabric_name, fcf->vfid, fcf->fcf_mac, |
1560 | fcf->fc_map, fcoe_ctlr_mtu_valid(fcf), | 1560 | fcf->fc_map, fcoe_ctlr_mtu_valid(fcf), |
1561 | fcf->flogi_sent, fcf->pri); | 1561 | fcf->flogi_sent, fcf->pri); |
1562 | if (fcf->fabric_name != first->fabric_name || | ||
1563 | fcf->vfid != first->vfid || | ||
1564 | fcf->fc_map != first->fc_map) { | ||
1565 | LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, " | ||
1566 | "or FC-MAP\n"); | ||
1567 | return NULL; | ||
1568 | } | ||
1569 | if (fcf->flogi_sent) | ||
1570 | continue; | ||
1571 | if (!fcoe_ctlr_fcf_usable(fcf)) { | 1562 | if (!fcoe_ctlr_fcf_usable(fcf)) { |
1572 | LIBFCOE_FIP_DBG(fip, "FCF for fab %16.16llx " | 1563 | LIBFCOE_FIP_DBG(fip, "FCF for fab %16.16llx " |
1573 | "map %x %svalid %savailable\n", | 1564 | "map %x %svalid %savailable\n", |
@@ -1577,6 +1568,15 @@ static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip) | |||
1577 | "" : "un"); | 1568 | "" : "un"); |
1578 | continue; | 1569 | continue; |
1579 | } | 1570 | } |
1571 | if (fcf->fabric_name != first->fabric_name || | ||
1572 | fcf->vfid != first->vfid || | ||
1573 | fcf->fc_map != first->fc_map) { | ||
1574 | LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, " | ||
1575 | "or FC-MAP\n"); | ||
1576 | return NULL; | ||
1577 | } | ||
1578 | if (fcf->flogi_sent) | ||
1579 | continue; | ||
1580 | if (!best || fcf->pri < best->pri || best->flogi_sent) | 1580 | if (!best || fcf->pri < best->pri || best->flogi_sent) |
1581 | best = fcf; | 1581 | best = fcf; |
1582 | } | 1582 | } |