Skip to content

udp: Introduce optional per-netns hash table.

Kuniyuki Iwashima netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 4 repliesIn review
  2. v16 patches 5 repliesSuperseded

v3 from the cover letter

* Drop get_port() fix (posted separately later)
* Patch 3
* Fix CONFIG_PROC_FS=n build failure (kernel test robot)
* Patch 5
* Allocate bitmap when creating netns (Paolo Abeni)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6udp: Clean up some functions.net/ipv4/udp.c net/ipv6/udp.c+31 -200 replies
2/6udp: Set NULL to sk->sk_prot->h.udp_table.include/net/netns/ipv4.h net/ipv4/udp.c net/ipv6/udp.c+13 -50 replies
3/6udp: Set NULL to udp_seq_afinfo.udp_table.net/ipv4/udp.c net/ipv6/udp.c+25 -90 replies
4/6udp: Access &udp_table via net.net/core/filter.c net/ipv4/udp.c net/ipv4/udp_diag.c +3 more+35 -270 replies
5/6udp: Add bitmap in udp_table.include/linux/udp.h include/net/udp.h net/ipv4/udp.c+30 -30 replies
6/6udp: Introduce optional per-netns hash table.Documentation/networking/ip-sysctl.rst include/linux/udp.h include/net/netns/ipv4.h +2 more+163 -54 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/6] udp: Introduce optional per-netns hash table.

This series is the UDP version of the per-netns ehash series [0], which were initially in the same patch set. [1]

The notable difference with TCP is the max table size is 64K. This is because the possible hash range by udp_hashfn() always fits in 64K within the same netns. Also, the UDP per-netns table isolates both 1-tuple and 2-tuple tables.

For details, please see the last patch.

patch 1 - 4: prep for per-netns hash table
patch 5: allocate bitmap beforehand for udp_lib_get_port() and smaller
hash table
patch 6: add per-netns hash table

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

Changes:
v3:
* Drop get_port() fix (posted separately later)
* Patch 3
* Fix CONFIG_PROC_FS=n build failure (kernel test robot)
* Patch 5
* Allocate bitmap when creating netns (Paolo Abeni)

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

v1: [1]

Kuniyuki Iwashima (6):
udp: Clean up some functions.
udp: Set NULL to sk->sk_prot->h.udp_table.
udp: Set NULL to udp_seq_afinfo.udp_table.
udp: Access &udp_table via net.
udp: Add bitmap in udp_table.
udp: Introduce optional per-netns hash table.

 Documentation/networking/ip-sysctl.rst |  27 ++++
 include/linux/udp.h                    |   2 +
 include/net/netns/ipv4.h               |   3 +
 include/net/udp.h                      |  20 +++
 net/core/filter.c                      |   4 +-
 net/ipv4/sysctl_net_ipv4.c             |  38 +++++
 net/ipv4/udp.c                         | 205 ++++++++++++++++++++-----
 net/ipv4/udp_diag.c                    |   6 +-
 net/ipv4/udp_offload.c                 |   5 +-
 net/ipv6/udp.c                         |  31 ++--
 net/ipv6/udp_offload.c                 |   5 +-
 11 files changed, 287 insertions(+), 59 deletions(-)
Signature · 1 line
2.30.2