diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2010-06-11 19:44:20 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:01:48 -0400 |
commit | c600fea2d813e8734748202970722c3b6a76b9a1 (patch) | |
tree | af04fbcfa7c37afda99ee1ff4cf7df187969e7e0 | |
parent | d99ee45b7cb89803b79745dc3014ba64bfd02b7d (diff) |
[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: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 4893098b3d3f..27c21ca802b2 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
@@ -769,18 +769,21 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
769 | list_add(&fcf->list, &fip->fcfs); | 769 | list_add(&fcf->list, &fip->fcfs); |
770 | } else { | 770 | } else { |
771 | /* | 771 | /* |
772 | * Flags in advertisements are ignored once the FCF is | 772 | * Update the FCF's keep-alive descriptor flags. |
773 | * selected. Flags in unsolicited advertisements are | 773 | * Other flag changes from new advertisements are |
774 | * ignored after a usable solicited advertisement | 774 | * ignored after a solicited advertisement is |
775 | * has been received. | 775 | * received and the FCF is selectable (usable). |
776 | */ | 776 | */ |
777 | fcf->fd_flags = new.fd_flags; | ||
778 | if (!fcoe_ctlr_fcf_usable(fcf)) | ||
779 | fcf->flags = new.flags; | ||
780 | |||
777 | if (fcf == fip->sel_fcf && !fcf->fd_flags) { | 781 | if (fcf == fip->sel_fcf && !fcf->fd_flags) { |
778 | fip->ctlr_ka_time -= fcf->fka_period; | 782 | fip->ctlr_ka_time -= fcf->fka_period; |
779 | fip->ctlr_ka_time += new.fka_period; | 783 | fip->ctlr_ka_time += new.fka_period; |
780 | if (time_before(fip->ctlr_ka_time, fip->timer.expires)) | 784 | if (time_before(fip->ctlr_ka_time, fip->timer.expires)) |
781 | mod_timer(&fip->timer, fip->ctlr_ka_time); | 785 | mod_timer(&fip->timer, fip->ctlr_ka_time); |
782 | } else if (!fcoe_ctlr_fcf_usable(fcf)) | 786 | } |
783 | fcf->flags = new.flags; | ||
784 | fcf->fka_period = new.fka_period; | 787 | fcf->fka_period = new.fka_period; |
785 | memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN); | 788 | memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN); |
786 | } | 789 | } |