From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>, Thomas Graf <tgraf@suug.ch>
Cc: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>, netdev@vger.kernel.org
Subject: [PATCH] net: neighbour table ABI problem
Date: Wed, 21 May 2008 10:40:19 -0700 [thread overview]
Message-ID: <20080521104019.22f9c712@extreme> (raw)
In-Reply-To: <4834544A.4010706@trash.net>
The neighbor table time of last use information is returned in the incorrect
unit. Kernel to user space ABI's need to use USER_HZ (or milliseconds), otherwise
the application has to try and discover the real system HZ value which is problematic.
Linux has standardized on keeping USER_HZ consistent (100hz) even when kernel is
running internally at some other value.
This change is small, but it breaks the ABI for older version of iproute2 utilities.
But these utilities are already broken since they are looking at the psched_hz values
which are completely different. So let's just go ahead and fix both kernel and user
space. Older utilities will just print wrong values.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/core/neighbour.c 2008-05-21 10:23:05.000000000 -0700
+++ b/net/core/neighbour.c 2008-05-21 10:28:09.000000000 -0700
@@ -2057,9 +2057,9 @@ static int neigh_fill_info(struct sk_buf
goto nla_put_failure;
}
- ci.ndm_used = now - neigh->used;
- ci.ndm_confirmed = now - neigh->confirmed;
- ci.ndm_updated = now - neigh->updated;
+ ci.ndm_used = jiffies_to_clock_t(now - neigh->used);
+ ci.ndm_confirmed = jiffies_to_clock_t(now - neigh->confirmed);
+ ci.ndm_updated = jiffies_to_clock_t(now - neigh->updated);
ci.ndm_refcnt = atomic_read(&neigh->refcnt) - 1;
read_unlock_bh(&neigh->lock);
next prev parent reply other threads:[~2008-05-21 18:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-21 16:38 [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS Stephane Chazelas
2008-05-21 16:56 ` Patrick McHardy
2008-05-21 17:40 ` Stephen Hemminger [this message]
2008-05-21 20:35 ` [PATCH] net: neighbour table ABI problem David Miller
2008-05-22 0:20 ` Thomas Graf
2008-06-03 23:03 ` David Miller
2008-05-21 17:10 ` [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS Stephen Hemminger
2008-05-21 18:43 ` route metrics in jiffies?? Stephen Hemminger
2008-05-21 20:31 ` David Miller
2008-05-22 10:36 ` rtt metric only for incoming connections? Stephane Chazelas
2008-05-27 18:43 ` Stephen Hemminger
2008-05-27 18:53 ` Rick Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080521104019.22f9c712@extreme \
--to=shemminger@vyatta.com \
--cc=Stephane_Chazelas@yahoo.fr \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).