Skip to content

ipv4: Namespacify IPv4 address hash table.

Kuniyuki Iwashima netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 0 repliesApplied 4/4
  2. v24 patches 3 repliesSuperseded
  3. v15 patches 6 repliesSuperseded

Changes in v3 from the cover letter

* Patch 4
* Drop change in inet_addr_hash()

Patches in v3 All 4 applied

#Subject and filesSizeRepliesApplied
1/4ipv4: Link IPv4 address to per-netns hash table.include/linux/inetdevice.h include/net/netns/ipv4.h net/ipv4/devinet.c+21 -30 repliesApplied
2/4ipv4: Use per-netns hash table in inet_lookup_ifaddr_rcu().net/ipv4/devinet.c+2 -30 repliesApplied
3/4ipv4: Namespacify IPv4 address GC.include/net/netns/ipv4.h net/ipv4/devinet.c+19 -140 repliesApplied
4/4ipv4: Retire global IPv4 hash table inet_addr_lst.include/linux/inetdevice.h net/ipv4/devinet.c+0 -110 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchEric Dumazet
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/4] ipv4: Namespacify IPv4 address hash table.

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:
v3:
* Patch 4
* Drop change in inet_addr_hash()

v2: https://lore.kernel.org/netdev/[email protected]/
* Drop patch 5
* Patch 4
* Fix sparse warning (__force u32)

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (4):
ipv4: Link IPv4 address to per-netns hash table.
ipv4: Use per-netns 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         | 69 +++++++++++++++++++++-----------------
 3 files changed, 42 insertions(+), 31 deletions(-)
Signature · 1 line
2.30.2