Commit c600fea2 authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley

[SCSI] libfcoe: update FIP FCF D flag from advertisments

Allow the D flag (indicating that keep-alives are not needed) to
be updated dynamically from received FIP advertisements.
Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent d99ee45b
...@@ -769,18 +769,21 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb) ...@@ -769,18 +769,21 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
list_add(&fcf->list, &fip->fcfs); list_add(&fcf->list, &fip->fcfs);
} else { } else {
/* /*
* Flags in advertisements are ignored once the FCF is * Update the FCF's keep-alive descriptor flags.
* selected. Flags in unsolicited advertisements are * Other flag changes from new advertisements are
* ignored after a usable solicited advertisement * ignored after a solicited advertisement is
* has been received. * received and the FCF is selectable (usable).
*/ */
fcf->fd_flags = new.fd_flags;
if (!fcoe_ctlr_fcf_usable(fcf))
fcf->flags = new.flags;
if (fcf == fip->sel_fcf && !fcf->fd_flags) { if (fcf == fip->sel_fcf && !fcf->fd_flags) {
fip->ctlr_ka_time -= fcf->fka_period; fip->ctlr_ka_time -= fcf->fka_period;
fip->ctlr_ka_time += new.fka_period; fip->ctlr_ka_time += new.fka_period;
if (time_before(fip->ctlr_ka_time, fip->timer.expires)) if (time_before(fip->ctlr_ka_time, fip->timer.expires))
mod_timer(&fip->timer, fip->ctlr_ka_time); mod_timer(&fip->timer, fip->ctlr_ka_time);
} else if (!fcoe_ctlr_fcf_usable(fcf)) }
fcf->flags = new.flags;
fcf->fka_period = new.fka_period; fcf->fka_period = new.fka_period;
memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN); memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment