Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226809
b: refs/heads/master
c: ba9cd5d
h: refs/heads/master
i:
  226807: cce2da4
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Dec 21, 2010
1 parent bcdc43c commit ece985d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 981c1154b240ee77133a478fcd3853ac18111672
refs/heads/master: ba9cd5d095b42271588c20ccd6ddd561d0e4cc1e
18 changes: 8 additions & 10 deletions trunk/drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static void fcoe_ctlr_timeout(unsigned long);
static void fcoe_ctlr_timer_work(struct work_struct *);
static void fcoe_ctlr_recv_work(struct work_struct *);
static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *);
static void fcoe_ctlr_select(struct fcoe_ctlr *);

static void fcoe_ctlr_vn_start(struct fcoe_ctlr *);
static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *, struct sk_buff *);
Expand Down Expand Up @@ -1398,14 +1397,16 @@ static int fcoe_ctlr_recv_handler(struct fcoe_ctlr *fip, struct sk_buff *skb)
* fcoe_ctlr_select() - Select the best FCF (if possible)
* @fip: The FCoE controller
*
* Returns the selected FCF, or NULL if none are usable.
*
* If there are conflicting advertisements, no FCF can be chosen.
*
* If there is already a selected FCF, this will choose a better one or
* an equivalent one that hasn't already been sent a FLOGI.
*
* Called with lock held.
*/
static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
static struct fcoe_fcf *fcoe_ctlr_select(struct fcoe_ctlr *fip)
{
struct fcoe_fcf *fcf;
struct fcoe_fcf *best = fip->sel_fcf;
Expand Down Expand Up @@ -1450,6 +1451,7 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
if (time_before(fip->ctlr_ka_time, fip->timer.expires))
mod_timer(&fip->timer, fip->ctlr_ka_time);
}
return best;
}

/**
Expand Down Expand Up @@ -1507,8 +1509,7 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip)
mutex_lock(&fip->ctlr_mutex);
spin_lock_bh(&fip->ctlr_lock);
LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n");
fcoe_ctlr_select(fip);
fcf = fip->sel_fcf;
fcf = fcoe_ctlr_select(fip);
if (!fcf || fcf->flogi_sent) {
kfree_skb(fip->flogi_req);
fip->flogi_req = NULL;
Expand Down Expand Up @@ -1548,14 +1549,12 @@ static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip)
*/
if (fcf->flogi_sent) {
LIBFCOE_FIP_DBG(fip, "sending FLOGI - reselect\n");
fcoe_ctlr_select(fip);
fcf = fip->sel_fcf;
fcf = fcoe_ctlr_select(fip);
if (!fcf || fcf->flogi_sent) {
LIBFCOE_FIP_DBG(fip, "sending FLOGI - clearing\n");
list_for_each_entry(fcf, &fip->fcfs, list)
fcf->flogi_sent = 0;
fcoe_ctlr_select(fip);
fcf = fip->sel_fcf;
fcf = fcoe_ctlr_select(fip);
}
}
if (fcf) {
Expand Down Expand Up @@ -1612,8 +1611,7 @@ static void fcoe_ctlr_timer_work(struct work_struct *work)
sel = fip->sel_fcf;
if (!sel && fip->sel_time) {
if (time_after_eq(jiffies, fip->sel_time)) {
fcoe_ctlr_select(fip);
sel = fip->sel_fcf;
sel = fcoe_ctlr_select(fip);
fip->sel_time = 0;
} else if (time_after(next_timer, fip->sel_time))
next_timer = fip->sel_time;
Expand Down

0 comments on commit ece985d

Please sign in to comment.