Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226803
b: refs/heads/master
c: 69316ee
h: refs/heads/master
i:
  226801: eed0858
  226799: 2bd6269
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Dec 21, 2010
1 parent e0d8d49 commit 7446034
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 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: b5fe5e953c65cd0ec4e9ffd001072700e5b89317
refs/heads/master: 69316ee2e375c5af0cf1f8d2d30f9aa277f0b454
40 changes: 29 additions & 11 deletions trunk/drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,33 @@ void fcoe_ctlr_destroy(struct fcoe_ctlr *fip)
}
EXPORT_SYMBOL(fcoe_ctlr_destroy);

/**
* fcoe_ctlr_announce() - announce new selection
* @fip: The FCoE controller
*
* Also sets the destination MAC for FCoE and control packets
*/
static void fcoe_ctlr_announce(struct fcoe_ctlr *fip)
{
struct fcoe_fcf *sel = fip->sel_fcf;

if (sel && !compare_ether_addr(sel->fcf_mac, fip->dest_addr))
return;
if (!is_zero_ether_addr(fip->dest_addr)) {
printk(KERN_NOTICE "libfcoe: host%d: "
"FIP Fibre-Channel Forwarder MAC %pM deselected\n",
fip->lp->host->host_no, fip->dest_addr);
memset(fip->dest_addr, 0, ETH_ALEN);
}
if (sel) {
printk(KERN_INFO "libfcoe: host%d: FIP selected "
"Fibre-Channel Forwarder MAC %pM\n",
fip->lp->host->host_no, sel->fcf_mac);
memcpy(fip->dest_addr, sel->fcf_mac, ETH_ALEN);
fip->map_dest = 0;
}
}

/**
* fcoe_ctlr_fcoe_size() - Return the maximum FCoE size required for VN_Port
* @fip: The FCoE controller to get the maximum FCoE size from
Expand Down Expand Up @@ -1420,24 +1447,15 @@ static void fcoe_ctlr_timer_work(struct work_struct *work)

if (sel != fcf) {
fcf = sel; /* the old FCF may have been freed */
fcoe_ctlr_announce(fip);
if (sel) {
printk(KERN_INFO "libfcoe: host%d: FIP selected "
"Fibre-Channel Forwarder MAC %pM\n",
fip->lp->host->host_no, sel->fcf_mac);
memcpy(fip->dest_addr, sel->fcf_mac, ETH_ALEN);
fip->map_dest = 0;
fip->port_ka_time = jiffies +
msecs_to_jiffies(FIP_VN_KA_PERIOD);
fip->ctlr_ka_time = jiffies + sel->fka_period;
if (time_after(next_timer, fip->ctlr_ka_time))
next_timer = fip->ctlr_ka_time;
} else {
printk(KERN_NOTICE "libfcoe: host%d: "
"FIP Fibre-Channel Forwarder timed out. "
"Starting FCF discovery.\n",
fip->lp->host->host_no);
} else
reset = 1;
}
}

if (sel && !sel->fd_flags) {
Expand Down

0 comments on commit 7446034

Please sign in to comment.