From: Alexander H Duyck <alexander.duyck@gmail.com>
To: David Decotigny <decot+git@google.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Nikolay Aleksandrov <razor@blackwall.org>,
David Ahern <dsahern@kernel.org>,
"Denis V. Lunev" <den@openvz.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Chen Zhongjin <chenzhongjin@huawei.com>,
David Decotigny <ddecotig@google.com>,
Yuwei Wang <wangyuweihx@gmail.com>,
Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>,
Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
Subject: Re: [PATCH net-next v2 1/1] net: neigh: persist proxy config across link flaps
Date: Thu, 15 Dec 2022 08:24:15 -0800 [thread overview]
Message-ID: <7211782676442c6679d8a016813fd62d44cbebad.camel@gmail.com> (raw)
In-Reply-To: <20221214232059.760233-1-decot+git@google.com>
On Wed, 2022-12-14 at 15:20 -0800, David Decotigny wrote:
> From: David Decotigny <ddecotig@google.com>
>
> Without this patch, the 'ip neigh add proxy' config is lost when the
> cable or peer disappear, ie. when the link goes down while staying
> admin up. When the link comes back, the config is never recovered.
>
> This patch makes sure that such an nd proxy config survives a switch
> or cable issue.
>
> Signed-off-by: David Decotigny <ddecotig@google.com>
>
>
> ---
> v1: initial revision
> v2: same as v1, except rebased on top of latest net-next, and includes "net-next" in the description
>
> net/core/neighbour.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index f00a79fc301b..f4b65bbbdc32 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -426,7 +426,10 @@ static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev,
> {
> write_lock_bh(&tbl->lock);
> neigh_flush_dev(tbl, dev, skip_perm);
> - pneigh_ifdown_and_unlock(tbl, dev);
> + if (skip_perm)
> + write_unlock_bh(&tbl->lock);
> + else
> + pneigh_ifdown_and_unlock(tbl, dev);
> pneigh_queue_purge(&tbl->proxy_queue, dev ? dev_net(dev) : NULL,
> tbl->family);
> if (skb_queue_empty_lockless(&tbl->proxy_queue))
This seems like an agressive approach since it applies to all entries
in the table, not just the permenant ones like occurs in
neigh_flush_dev.
I don't have much experience in this area of the code but it seems like
you would specifically be wanting to keep only the permanant entries.
Would it make sense ot look at rearranging pneigh_ifdown_and_unlock so
that the code functioned more like neigh_flush_dev where it only
skipped the permanant entries when skip_perm was set?
next prev parent reply other threads:[~2022-12-15 16:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 23:20 David Decotigny
2022-12-15 16:24 ` Alexander H Duyck [this message]
[not found] ` <CAG88wWZNaKqDXWrXanfSpM_h6LP7s3F5PppyWqwWRyA7g=+p_g@mail.gmail.com>
2022-12-15 20:08 ` Alexander Duyck
2022-12-15 23:00 ` David Ahern
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=7211782676442c6679d8a016813fd62d44cbebad.camel@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=alexander.mikhalitsyn@virtuozzo.com \
--cc=chenzhongjin@huawei.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ddecotig@google.com \
--cc=decot+git@google.com \
--cc=den@openvz.org \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=thomas.zeitlhofer+lkml@ze-it.at \
--cc=wangyuweihx@gmail.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®