From: Zhang Changzhong <zhangchangzhong@huawei.com>
To: Network Development <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Cc: Julian Anastasov <ja@ssi.bg>,
"David S. Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"Denis V. Lunev" <den@openvz.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Zhang Changzhong <zhangchangzhong@huawei.com>,
YueHaibing <yuehaibing@huawei.com>
Subject: [Question] neighbor entry doesn't switch to the STALE state after the reachable timer expires
Date: Sun, 29 Jan 2023 11:08:38 +0800 [thread overview]
Message-ID: <b1d8722e-5660-c38e-848f-3220d642889d@huawei.com> (raw)
Hi,
We got the following weird neighbor cache entry on a machine that's been running for over a year:
172.16.1.18 dev bond0 lladdr 0a:0e:0f:01:12:01 ref 1 used 350521/15994171/350520 probes 4 REACHABLE
350520 seconds have elapsed since this entry was last updated, but it is still in the REACHABLE
state (base_reachable_time_ms is 30000), preventing lladdr from being updated through probe.
After some analysis, we found a scenario that may cause such a neighbor entry:
Entry used DELAY_PROBE_TIME expired
NUD_STALE ------------> NUD_DELAY ------------------------> NUD_PROBE
|
| DELAY_PROBE_TIME not expired
v
NUD_REACHABLE
The neigh_timer_handler() use time_before_eq() to compare 'now' with 'neigh->confirmed +
NEIGH_VAR(neigh->parms, DELAY_PROBE_TIME)', but time_before_eq() only works if delta < ULONG_MAX/2.
This means that if an entry stays in the NUD_STALE state for more than ULONG_MAX/2 ticks, it enters
the NUD_RACHABLE state directly when it is used again and cannot be switched to the NUD_STALE state
(the timer is set too long).
On 64-bit machines, ULONG_MAX/2 ticks are a extremely long time, but in my case (32-bit machine and
kernel compiled with CONFIG_HZ=250), ULONG_MAX/2 ticks are about 99.42 days, which is possible in
reality.
Does anyone have a good idea to solve this problem? Or are there other scenarios that might cause
such a neighbor entry?
-----
Best Regards,
Changzhong Zhang
next reply other threads:[~2023-01-29 3:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 3:08 Zhang Changzhong [this message]
2023-01-29 19:43 ` Julian Anastasov
2023-01-30 3:19 ` Zhang Changzhong
2023-01-30 11:01 ` Julian Anastasov
2023-01-31 11:52 ` Zhang Changzhong
2023-01-31 16:13 ` Julian Anastasov
2023-02-02 8:27 ` Zhang Changzhong
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=b1d8722e-5660-c38e-848f-3220d642889d@huawei.com \
--to=zhangchangzhong@huawei.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=den@openvz.org \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=ja@ssi.bg \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=yoshfuji@linux-ipv6.org \
--cc=yuehaibing@huawei.com \
/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
all inboxes | Powered by JetHome®