Skip to content
Commit 0c0dca3a authored by Alex Maftei (amaftei)'s avatar Alex Maftei (amaftei) Committed by Greg Kroah-Hartman
Browse files

sfc: fix timestamp reconstruction at 16-bit rollover points

[ Upstream commit 23797b98

 ]

We can't just use the top bits of the last sync event as they could be
off-by-one every 65,536 seconds, giving an error in reconstruction of
65,536 seconds.

This patch uses the difference in the bottom 16 bits (mod 2^16) to
calculate an offset that needs to be applied to the last sync event to
get to the current time.

Signed-off-by: default avatarAlexandru-Mihai Maftei <amaftei@solarflare.com>
Acked-by: default avatarMartin Habets <mhabets@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5e505d10
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