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
96 IPSET_ATTR_HASHSIZE,96 IPSET_ATTR_HASHSIZE,
97 IPSET_ATTR_MAXELEM,97 IPSET_ATTR_MAXELEM,
98 IPSET_ATTR_NETMASK,98 IPSET_ATTR_NETMASK,
99 IPSET_ATTR_PROBES,99 IPSET_ATTR_BUCKETSIZE, /* was unused IPSET_ATTR_PROBES */
100 IPSET_ATTR_RESIZE,100 IPSET_ATTR_RESIZE,
101 IPSET_ATTR_SIZE,101 IPSET_ATTR_SIZE,
102 /* Kernel-only */102 /* Kernel-only */
@@ -214,6 +214,8 @@ enum ipset_cadt_flags { · 111 unmodified lines
214enum ipset_create_flags {214enum ipset_create_flags {
215 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,215 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,
216 IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),216 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),
217 IPSET_CREATE_FLAG_BIT_MAX = 7,219 IPSET_CREATE_FLAG_BIT_MAX = 7,
218};220};
219 221