History

netfilter: ipset: Add bucketsize parameter to all hash types

The parameter defines the upper limit in any hash bucket at adding new entries from userspace - if the limit would be exceeded, ipset doubles the hash size and rehashes. It means the set may consume more memory but gives faster evaluation at matching in the set.

Jozsef Kadlecsik committed 6 years ago

Commit ccf0a4b1 parent a304ea716 files · +79 −40Browse files

Showing the changes to include/uapi/linux (1 of 16 files). Show all

Unified · Split

include/uapi/linux/netfilter/ipset/ip_set.h+3−1
@@ -96,7 +96,7 @@ enum { · 95 unmodified lines
9696 IPSET_ATTR_HASHSIZE,
9797 IPSET_ATTR_MAXELEM,
9898 IPSET_ATTR_NETMASK,
99− IPSET_ATTR_PROBES,
99+ IPSET_ATTR_BUCKETSIZE, /* was unused IPSET_ATTR_PROBES */
100100 IPSET_ATTR_RESIZE,
101101 IPSET_ATTR_SIZE,
102102 /* Kernel-only */
@@ -214,6 +214,8 @@ enum ipset_cadt_flags { · 111 unmodified lines
214214 enum ipset_create_flags {
215215 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,
216216 IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),
217+ IPSET_CREATE_FLAG_BIT_BUCKETSIZE = 1,
218+ IPSET_CREATE_FLAG_BUCKETSIZE = (1 << IPSET_CREATE_FLAG_BIT_BUCKETSIZE),
217219 IPSET_CREATE_FLAG_BIT_MAX = 7,
218220 };
219221