]> www.infradead.org Git - users/dwmw2/linux.git/commit
ipv4: Namespacify IPv4 address GC.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 8 Oct 2024 17:29:05 +0000 (10:29 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Oct 2024 03:08:08 +0000 (20:08 -0700)
commit1675f385213edc14ed849e079d6866b48e552252
tree658da29158f3867b0f547cafc283c14b6e23ac25
parent49e613194292ff7750a3f889cd2db012da16f68e
ipv4: Namespacify IPv4 address GC.

Each IPv4 address could have a lifetime, which is useful for DHCP,
and GC is periodically executed as check_lifetime_work.

check_lifetime() does the actual GC under RTNL.

  1. Acquire RTNL
  2. Iterate inet_addr_lst
  3. Remove IPv4 address if expired
  4. Release RTNL

Namespacifying the GC is required for per-netns RTNL, but using the
per-netns hash table will shorten the time on the hash bucket iteration
under RTNL.

Let's add per-netns GC work and use the per-netns hash table.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20241008172906.1326-4-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/netns/ipv4.h
net/ipv4/devinet.c