Patchwork [Open-FCoE] fcoe: fix reset of fip selection time.

login
register
mail settings
Submitter Usha Ketineni
Date Feb. 29, 2016, 11:36 a.m.
Message ID <20160229113652.2680.73280.stgit@ukketine.jf.intel.com>
Download mbox | patch
Permalink /patch/308/
State Awaiting Upstream
Headers show

Comments

Usha Ketineni - Feb. 29, 2016, 11:36 a.m.
Do not reset fip selection time for every advertisement
in fcoe_ctlr_recv_adv() but set it only once for the first
validated FCF. Otherwise FCF selection won't happen when the
advertisements consistently arrive with sub FCOE_CTLR_START_DELAY
periodicity.

Tested-by: Narendra K <narendra_k@dell.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
---
 drivers/scsi/fcoe/fcoe_ctlr.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Neil Horman - Feb. 29, 2016, 8:16 p.m.
On Mon, Feb 29, 2016 at 03:36:52AM -0800, Usha Ketineni wrote:
> Do not reset fip selection time for every advertisement
> in fcoe_ctlr_recv_adv() but set it only once for the first
> validated FCF. Otherwise FCF selection won't happen when the
> advertisements consistently arrive with sub FCOE_CTLR_START_DELAY
> periodicity.
> 
> Tested-by: Narendra K <narendra_k@dell.com>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> Acked-by: Vasu Dev <vasu.dev@intel.com>
> Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com>
> ---
>  drivers/scsi/fcoe/fcoe_ctlr.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
> index d68d572..0c85ef6 100644
> --- a/drivers/scsi/fcoe/fcoe_ctlr.c
> +++ b/drivers/scsi/fcoe/fcoe_ctlr.c
> @@ -1079,7 +1079,8 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
>  	 * If this is the first validated FCF, note the time and
>  	 * set a timer to trigger selection.
>  	 */
> -	if (mtu_valid && !fip->sel_fcf && fcoe_ctlr_fcf_usable(fcf)) {
> +	if (mtu_valid && !fip->sel_fcf && !fip->sel_time &&
> +	    fcoe_ctlr_fcf_usable(fcf)) {
>  		fip->sel_time = jiffies +
>  			msecs_to_jiffies(FCOE_CTLR_START_DELAY);
>  		if (!timer_pending(&fip->timer) ||
> 
> _______________________________________________
> fcoe-devel mailing list
> fcoe-devel@open-fcoe.org
> http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

Patch

diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index d68d572..0c85ef6 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -1079,7 +1079,8 @@  static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
 	 * If this is the first validated FCF, note the time and
 	 * set a timer to trigger selection.
 	 */
-	if (mtu_valid && !fip->sel_fcf && fcoe_ctlr_fcf_usable(fcf)) {
+	if (mtu_valid && !fip->sel_fcf && !fip->sel_time &&
+	    fcoe_ctlr_fcf_usable(fcf)) {
 		fip->sel_time = jiffies +
 			msecs_to_jiffies(FCOE_CTLR_START_DELAY);
 		if (!timer_pending(&fip->timer) ||