Commit 3c0d49aa authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

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: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 972f37b4
...@@ -1917,8 +1917,7 @@ static u32 be_get_eq_delay_mult_enc(struct be_eq_obj *eqo) ...@@ -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);
......
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