netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>
Subject: [PATCH v4 net-next 0/5] udp: Introduce optional per-netns hash table.
Date: Mon, 14 Nov 2022 13:57:52 -0800	[thread overview]
Message-ID: <20221114215757.37455-1-kuniyu@amazon.com> (raw)

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 and the min
size is 128.  This is because the possible hash range by udp_hashfn()
always fits in 64K within the same netns and because we want to keep a
bitmap in udp_lib_get_port() on the stack.  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: add per-netns hash table

[0]: https://lore.kernel.org/netdev/20220908011022.45342-1-kuniyu@amazon.com/
[1]: https://lore.kernel.org/netdev/20220826000445.46552-1-kuniyu@amazon.com/


Changes:
  v4:
    * Drop a change to allcate bitmaps dynamically
    * Patch 5
      * Set the min size to 128 and keep the bitmap on stack (Paolo Abeni)
      * Add memset() in the proc handler (Paolo Abeni)

  v3: https://lore.kernel.org/netdev/20221111040034.29736-1-kuniyu@amazon.com/
    * Drop get_port() fix (posted separately later)
    * Patch 3
      * Fix CONFIG_PROC_FS=n build failure
    * Patch 5
      * Allocate bitmap when creating netns (Paolo Abeni)

  v2: https://lore.kernel.org/netdev/20221104190612.24206-1-kuniyu@amazon.com/

  v1: [1]


Kuniyuki Iwashima (5):
  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: Introduce optional per-netns hash table.

 Documentation/networking/ip-sysctl.rst |  27 ++++
 include/linux/udp.h                    |   2 +
 include/net/netns/ipv4.h               |   3 +
 net/core/filter.c                      |   4 +-
 net/ipv4/sysctl_net_ipv4.c             |  40 +++++
 net/ipv4/udp.c                         | 196 ++++++++++++++++++++-----
 net/ipv4/udp_diag.c                    |   6 +-
 net/ipv4/udp_offload.c                 |   5 +-
 net/ipv6/udp.c                         |  31 ++--
 net/ipv6/udp_offload.c                 |   5 +-
 10 files changed, 261 insertions(+), 58 deletions(-)

-- 
2.30.2


             reply	other threads:[~2022-11-14 21:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 21:57 Kuniyuki Iwashima [this message]
2022-11-14 21:57 ` [PATCH v4 net-next 1/5] udp: Clean up some functions Kuniyuki Iwashima
2022-11-14 21:57 ` [PATCH v4 net-next 2/5] udp: Set NULL to sk->sk_prot->h.udp_table Kuniyuki Iwashima
2022-11-14 21:57 ` [PATCH v4 net-next 3/5] udp: Set NULL to udp_seq_afinfo.udp_table Kuniyuki Iwashima
2022-11-14 21:57 ` [PATCH v4 net-next 4/5] udp: Access &udp_table via net Kuniyuki Iwashima
2022-11-14 21:57 ` [PATCH v4 net-next 5/5] udp: Introduce optional per-netns hash table Kuniyuki Iwashima
2022-11-16 10:00 ` [PATCH v4 net-next 0/5] " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114215757.37455-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).