be2net: Fix interval calculation in interrupt moderation

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>
This commit is contained in:
Padmanabh Ratnakar 2016-02-03 09:49:23 +05:30 committed by David S. Miller
parent 972f37b424
commit 3c0d49aaa6

View File

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