netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/4] ipv4: Namespacify IPv4 address hash table.
@ 2024-10-04 19:59 Kuniyuki Iwashima
  2024-10-04 19:59 ` [PATCH v2 net-next 1/4] ipv4: Link IPv4 address to per-netns " Kuniyuki Iwashima
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kuniyuki Iwashima @ 2024-10-04 19:59 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	David Ahern
  Cc: Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

This is a prep of per-net RTNL conversion for RTM_(NEW|DEL|SET)ADDR.

Currently, each IPv4 address is linked to the global hash table, and
this needs to be protected by another global lock or namespacified to
support per-net RTNL.

Adding a global lock will cause deadlock in the rtnetlink path and GC,

  rtnetlink                      check_lifetime
  |- rtnl_net_lock(net)          |- acquire the global lock
  |- acquire the global lock     |- check ifa's netns
  `- put ifa into hash table     `- rtnl_net_lock(net)

so we need to namespacify the hash table.

The IPv6 one is already namespacified, let's follow that.


Changes:
  v2:
    * Drop patch 5
    * Fix sparse warning in patch 4, (__force u32)

  v1: https://lore.kernel.org/netdev/20241001024837.96425-1-kuniyu@amazon.com/


Kuniyuki Iwashima (4):
  ipv4: Link IPv4 address to per-net hash table.
  ipv4: Use per-net hash table in inet_lookup_ifaddr_rcu().
  ipv4: Namespacify IPv4 address GC.
  ipv4: Retire global IPv4 hash table inet_addr_lst.

 include/linux/inetdevice.h |  2 +-
 include/net/netns/ipv4.h   |  2 ++
 net/ipv4/devinet.c         | 73 +++++++++++++++++++++-----------------
 3 files changed, 43 insertions(+), 34 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-08 17:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 19:59 [PATCH v2 net-next 0/4] ipv4: Namespacify IPv4 address hash table Kuniyuki Iwashima
2024-10-04 19:59 ` [PATCH v2 net-next 1/4] ipv4: Link IPv4 address to per-netns " Kuniyuki Iwashima
2024-10-04 19:59 ` [PATCH v2 net-next 2/4] ipv4: Use per-netns hash table in inet_lookup_ifaddr_rcu() Kuniyuki Iwashima
2024-10-04 19:59 ` [PATCH v2 net-next 3/4] ipv4: Namespacify IPv4 address GC Kuniyuki Iwashima
2024-10-04 19:59 ` [PATCH v2 net-next 4/4] ipv4: Retire global IPv4 hash table inet_addr_lst Kuniyuki Iwashima
2024-10-08 11:10   ` Paolo Abeni
2024-10-08 11:21     ` Eric Dumazet
2024-10-08 17:09       ` Kuniyuki Iwashima

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).