Speed up iptables-nft-save
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nft: Simplify immediate parsingiptables/ iptables/ iptables/ +3 more | +14 | 1 reply | |
| 2/4 | nft: Speed up immediate parsingiptables/ iptables/ | +19 | 0 replies | |
| 3/4 | xshared: Prefer xtables_chain_protos lookup over getprotoentiptables/ libxtables/ | +10 | 3 replies | |
| 4/4 | nft: Don't pass command state opaque to family ops callbacksiptables/ iptables/ iptables/ +5 more | +84 | 1 reply |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Florian Westphal |
|---|---|
| 1/4 | R-b |
| 2/4 | |
| 3/4 | A-b |
| 4/4 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [iptables PATCH 0/4] Speed up iptables-nft-save
OpenShift tends to create huge rulesets[*] and consequently wonders why iptables is slow. Anyway, iptables-nft-save really does odd things:
* For each jump target, it checks if such extension exists, despite already knowing whether the target is a chain or not. This is solved in patch 2, with patch 1 preparing nft_parse_immediate() to make the change simpler.
* Every l4proto match causes a call to getprotobynumber() which in turn opens /etc/protocols. One could cache the lookups, but preferring the builtin fallback list of protocol names and numbers is much simpler. Do that in patch 3, aligning said list with /etc/protocols to not change output unexpectedly.
[*] I have a "real-life" dump adding 50k chains and 130k rules. Dumping
it to /dev/null took 45s on my testing VM, with these patches applied I'm down to 2.7s.
The last patch is fallout from the above, simplifying family ops callbacks a bit given that there is only a single *tables_command_state struct left.
Phil Sutter (4):
nft: Simplify immediate parsing
nft: Speed up immediate parsing
xshared: Prefer xtables_chain_protos lookup over getprotoent
nft: Don't pass command state opaque to family ops callbacks
iptables/nft-arp.c | 32 ++++++------------ iptables/nft-bridge.c | 55 +++++++++++++------------------ iptables/nft-ipv4.c | 40 ++++++++--------------- iptables/nft-ipv6.c | 40 ++++++++--------------- iptables/nft-shared.c | 75 ++++++++++++++++++++----------------------- iptables/nft-shared.h | 35 ++++++++++---------- iptables/nft.c | 4 +-- iptables/nft.h | 2 +- iptables/xshared.c | 8 ++--- libxtables/xtables.c | 19 ++++------- 10 files changed, 126 insertions(+), 184 deletions(-)
Signature · 1 line
2.34.1