[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB0104872@AcuExch.aculab.com>
Date: Tue, 20 Sep 2016 12:59:42 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Nikolay Aleksandrov' <nikolay@...ulusnetworks.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "roopa@...ulusnetworks.com" <roopa@...ulusnetworks.com>,
"sashok@...ulusnetworks.com" <sashok@...ulusnetworks.com>,
"davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [PATCH net] ipmr, ip6mr: return lastuse relative to now
From: Nikolay Aleksandrov
> Sent: 20 September 2016 10:06
> When I introduced the lastuse member I made a subtle error because it was
> returned as an absolute value but that is meaningless to user-space as it
> doesn't allow to see how old exactly an entry is. Let's make it similar to
> how the bridge returns such values and make it relative to "now" (jiffies).
> This allows us to show the actual age of the entries and is much more
> useful (e.g. user-space daemons can age out entries, iproute2 can display
> the lastuse properly).
>
...
> + jiffies_to_clock_t(jiffies -
> + c->mfc_un.res.lastuse),
You probably need to ensure the 'age' isn't negative because
'lastuse' got updated after 'jiffies' was read and there was
a clock interrupt in the gap.
David
Powered by blists - more mailing lists