Commit eabf425b authored by Zheng Li's avatar Zheng Li Committed by Paolo Abeni

neighbour: guarantee the localhost connections be established successfully...

neighbour: guarantee the localhost connections be established successfully even the ARP table is full

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
same netmask Lan IPv4 addresses, run "ssh localhost" on console interface,
then the command will get timeout.
Signed-off-by: default avatarZheng Li <James.Z.Li@Dell.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240416095343.540-1-lizheng043@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent ba3de6d8
......@@ -734,7 +734,9 @@ ___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);
bool exempt_from_gc = !!(dev->flags & IFF_LOOPBACK);
return ___neigh_create(tbl, pkey, dev, 0, exempt_from_gc, want_ref);
}
EXPORT_SYMBOL(__neigh_create);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment