summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>2016-02-03 09:49:23 +0530
committerDavid S. Miller <davem@davemloft.net>2016-02-07 13:55:23 -0500
commit3c0d49aaa67e1990f4c081892e9bb69070853919 (patch)
treeb499fad5d9d25f7bca76dafe6d3539cd5edabcd9
parent972f37b424e65f9ef1ce143b8658d9ed50db9f42 (diff)
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>
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index d5286d3c9356..9c1fc9dcea25 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -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);