Skip to content

ipset: replace internal hash table with rhashtable

Florian Westphal netfilter-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest6 patches 7 repliesIn review
  2. v96 patches 0 repliesSuperseded
  3. v86 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v76 patches1 replySuperseded
v66 patches2 repliesSuperseded
v56 patches4 repliesSuperseded
v413 patches14 repliesSuperseded

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6rhashtable: Add rhashtable_flush_and_free helperinclude/linux/rhashtable.h lib/rhashtable.c+171 -550 replies
2/6netfilter: ipset: add rhashtable boilerplate stubsnet/netfilter/ipset/ip_set_hash_gen.h+109 -50 replies
3/6netfilter: ipset: replace internal hash table with rhashtablenet/netfilter/ipset/ip_set_hash_gen.h+396 -9860 replies
4/6netfilter: ipset: also report mem size for cidr storage to userspacenet/netfilter/ipset/ip_set_hash_gen.h+17 -00 replies
5/6netfilter: ipset: re-add IP_SET_HASH_WITH_MULTI supportnet/netfilter/ipset/ip_set_hash_gen.h net/netfilter/ipset/ip_set_hash_ip.c net/netfilter/ipset/ip_set_hash_ipmac.c +10 more+728 -770 replies
6/6netfilter: ipset: re-add forceadd supportnet/netfilter/ipset/ip_set_hash_gen.h+92 -10 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJozsef Kadlecsik
SeriesA-b
1/6
2/6
3/6
4/6
5/6
6/6

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

Read the v10 thread

Cover letter [PATCH nf-next v10 0/6] ipset: replace internal hash table with rhashtable

v10: No changes except dropped mention of rhltable in patch 3 commit message.

I did extensive LLM reviews of this thing, but by now noise outweights the signal by far, with successive rounds often giving contradicting hints. This passes ipset tests, like previous versions of this patchset.

1) Add rhashtable_flush_and_free, From Herbert Xu. The initial user of this function is added in patch 3.

2) Add rhashtable boilerplate stubs to ipset. Implement its initialization and destruction logic.

3) Replace ipset internal hash tables with rhashtables. This drops functionality, in particular, MULTI sets will not work correctly. This is restored in patch 5.

4) Report dynamic CIDR storage memory size to userspace.

5) Reimplement hash:net,iface (IP_SET_HASH_WITH_MULTI) using a group-of-elements structure with explicit exact-over-wildcard match priority. Update gc, list, flush, and destroy paths for the extra group level.

6) Restore SET_WITH_FORCEADD eviction support to netfilter ipset. Add mtype_remove_random() helper to facilitate element eviction during additions.

Florian Westphal (5):
netfilter: ipset: add rhashtable boilerplate stubs
netfilter: ipset: replace internal hash table with rhashtable
netfilter: ipset: also report mem size for cidr storage to userspace
netfilter: ipset: re-add IP_SET_HASH_WITH_MULTI support
netfilter: ipset: re-add forceadd support

Herbert Xu (1):
rhashtable: Add rhashtable_flush_and_free helper

 include/linux/rhashtable.h                   |   40 +-
 lib/rhashtable.c                             |  186 +-
 net/netfilter/ipset/ip_set_hash_gen.h        | 2176 ++++++++++--------
 net/netfilter/ipset/ip_set_hash_ip.c         |    6 +-
 net/netfilter/ipset/ip_set_hash_ipmac.c      |    6 +-
 net/netfilter/ipset/ip_set_hash_ipmark.c     |    6 +-
 net/netfilter/ipset/ip_set_hash_ipport.c     |    6 +-
 net/netfilter/ipset/ip_set_hash_ipportip.c   |    6 +-
 net/netfilter/ipset/ip_set_hash_ipportnet.c  |    6 +-
 net/netfilter/ipset/ip_set_hash_mac.c        |    3 +-
 net/netfilter/ipset/ip_set_hash_net.c        |    6 +-
 net/netfilter/ipset/ip_set_hash_netiface.c   |   74 +-
 net/netfilter/ipset/ip_set_hash_netnet.c     |    6 +-
 net/netfilter/ipset/ip_set_hash_netport.c    |    6 +-
 net/netfilter/ipset/ip_set_hash_netportnet.c |    6 +-
 15 files changed, 1464 insertions(+), 1075 deletions(-)
Signature · 1 line
2.56.1