]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_en: fix overflow in mlx4_en_init_timestamp()
authorEric Dumazet <edumazet@google.com>
Thu, 23 Feb 2017 23:22:43 +0000 (15:22 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Feb 2017 20:39:43 +0000 (15:39 -0500)
commit06648a45d23b0e8bf2a9b8820f3cf7cbba60e089
tree3b76e771fa632c766ec0b4b25a6fdbbb01fa2ce1
parentc9059eb22afdce8791ad1b127336fd1e71e80f43
net/mlx4_en: fix overflow in mlx4_en_init_timestamp()

The cited commit makes a great job of finding optimal shift/multiplier
values assuming a 10 seconds wrap around, but forgot to change the
overflow_period computation.

It overflows in cyclecounter_cyc2ns(), and the final result is 804 ms,
which is silly.

Lets simply use 5 seconds, no need to recompute this, given how it is
supposed to work.

Later, we will use a timer instead of a work queue, since the new RX
allocation schem will no longer need mlx4_en_recover_from_oom() and the
service_task firing every 250 ms.

Fixes: 95ab31a07037 ("net/mlx4_en: Choose time-stamping shift value according to HW frequency")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Eugenia Emantayev <eugenia@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_clock.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h