be2net: Fix interval calculation in interrupt moderation
authorPadmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Wed, 3 Feb 2016 04:19:23 +0000 (09:49 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Feb 2016 18:55:23 +0000 (13:55 -0500)
Interrupt moderation parameters need to be recalculated only
after a time interval of 1 ms. Interval calculation is wrong
when there is a rollover of jiffies. Using recommended way of interval
calculation using jiffies to fix this.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index d5286d3c935632cf7f76b14e2f308dc6e65f9d82..9c1fc9dcea250e391526f6a9010985204244b1f5 100644 (file)
@@ -1917,8 +1917,7 @@ static u32 be_get_eq_delay_mult_enc(struct be_eq_obj *eqo)
        if (!aic->enable)
                return 0;
 
-       if (time_before_eq(now, aic->jiffies) ||
-           jiffies_to_msecs(now - aic->jiffies) < 1)
+       if (jiffies_to_msecs(now - aic->jiffies) < 1)
                eqd = aic->prev_eqd;
        else
                eqd = be_get_new_eqd(eqo);