netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Zheng Li <lizheng043@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<nhorman@tuxdriver.com>, <davem@davemloft.net>,
	<jmorris@namei.org>, <James.Z.Li@Dell.com>
Subject: Re: [PATCH] neighbour: guarantee the localhost connections be established successfully even the ARP table is full
Date: Mon, 11 Mar 2024 19:21:17 +0530	[thread overview]
Message-ID: <20240311135117.GA1244788@maili.marvell.com> (raw)
In-Reply-To: <20240311122401.6549-1-lizheng043@gmail.com>

On 2024-03-11 at 17:54:01, Zheng Li (lizheng043@gmail.com) wrote:
>
> Inter-process communication on localhost should be established successfully even the ARP table is full,
> many processes on server machine use the localhost to communicate such as command-line interface (CLI),
> servers hope all CLI commands can be executed successfully even the arp table is full.
> Right now CLI commands got timeout when the arp table is full.
> Set the parameter of exempt_from_gc to be true for LOOPBACK net device to
> keep localhost neigh in arp table, not removed by gc.
>
> the steps of reproduced:
> server with "gc_thresh3 = 1024" setting, ping server from more than 1024 IPv4 addresses,
> run "ssh localhost" on console interface, then the command will get timeout.
it does not look correct to me. why gc has to behave differently for loopback devices.
why can't a higher gc_thresh3 value (fine tuned to your use case) wont solve the issue ?
can't you add localhost arp entry statically and get rid of gc issue ?

>
> Signed-off-by: Zheng Li <James.Z.Li@Dell.com>
> ---
>  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 552719c3bbc3..d96dee3d4af6 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -734,7 +734,10 @@ ___neigh_create(struct neigh_table *tbl, const void *pkey,
>  struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
>  				 struct net_device *dev, bool want_ref)
>  {
> -	return ___neigh_create(tbl, pkey, dev, 0, false, want_ref);
> +	if (dev->flags & IFF_LOOPBACK)
> +		return ___neigh_create(tbl, pkey, dev, 0, true, want_ref);
> +	else
> +		return ___neigh_create(tbl, pkey, dev, 0, false, want_ref);
>  }
>  EXPORT_SYMBOL(__neigh_create);
>
> --
> 2.17.1
>

  reply	other threads:[~2024-03-11 13:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 12:24 [PATCH] neighbour: guarantee the localhost connections be established successfully even the ARP table is full Zheng Li
2024-03-11 13:51 ` Ratheesh Kannoth [this message]
2024-03-18  8:39   ` James Lee
2024-03-18 15:36     ` [EXTERNAL] " Ratheesh Kannoth
2024-03-19  9:42       ` James Lee
2024-03-22  3:37         ` Ratheesh Kannoth
2024-03-28  8:41           ` James Lee
2024-03-28  8:55             ` Ratheesh Kannoth
2024-04-12 12:25 Zheng Li
2024-04-15 18:07 ` Jakub Kicinski
2024-04-15 18:15 ` Simon Horman
2024-04-16  9:53 Zheng Li
2024-04-16 10:02 ` Eric Dumazet
2024-04-16 10:36   ` Li, James Zheng
2024-04-18  9:33     ` Paolo Abeni
2024-04-18  9:45       ` Eric Dumazet
2024-04-18 10:20 ` patchwork-bot+netdevbpf

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=20240311135117.GA1244788@maili.marvell.com \
    --to=rkannoth@marvell.com \
    --cc=James.Z.Li@Dell.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizheng043@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).