Skip to contentSkip to conversation

mnl: Increase BATCH_PAGE_SIZE to support huge rulesets

PATCH New Phil Sutter 1 participant 1 message Apr 14, 2021 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 mnl: Increase BATCH_PAGE_SIZE to support huge rulesets

Apply the same change from iptables-nft to nftables to keep them in sync with regards to max supported transaction sizes.

---
 src/mnl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
src/mnl.c +4 -4
index c7ff728204502..284484fca77bc 100644
@@ -160,11 +160,11 @@ static int check_genid(const struct nlmsghdr *nlh)
  * Batching
  */
 
-/* selected batch page is 256 Kbytes long to load ruleset of
- * half a million rules without hitting -EMSGSIZE due to large
- * iovec.
+/* Selected batch page is 2 Mbytes long to support loading a ruleset of 3.5M
+ * rules matching on source and destination address as well as input and output
+ * interfaces. This is what legacy iptables supports.
  */
-#define BATCH_PAGE_SIZE getpagesize() * 32
+#define BATCH_PAGE_SIZE 2 * 1024 * 1024
 
 struct nftnl_batch *mnl_batch_init(void)
 {
Signature · 1 line
2.31.0