nf_tables: nft_rule_dump_ctx fits into netlink_callback
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | netfilter: nf_tables: Always allocate nft_rule_dump_ctxnet/ | +21 | 0 replies | |
| 2/5 | netfilter: nf_tables: Drop pointless memset when dumping rulesnet/ | +0 | 0 replies | |
| 3/5 | netfilter: nf_tables: Carry reset flag in nft_rule_dump_ctxnet/ | +9 | 0 replies | |
| 4/5 | netfilter: nf_tables: Carry s_idx in nft_rule_dump_ctxnet/ | +4 | 0 replies | |
| 5/5 | netfilter: nf_tables: Don't allocate nft_rule_dump_ctxnet/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [nf-next PATCH 0/5] nf_tables: nft_rule_dump_ctx fits into netlink_callback
Struct netlink_callback has a 48byte scratch area for use by dump callbacks to keep personal stuff.
In rule dumps set up by nf_tables_getrule(), this is used only to store a cursor into the list of rules being dumped. Other data is allocated and the pointer value assigned to struct netlink_callback::data.
Since the allocated data structure is small and fits into the scratch area even after adding some more fields, move it there.
Patch 1 "simplifies" nf_tables_dump_rules_start() a bit, but actually exists only to reduce patch 5's size.
Patch 2 is more or less fallout: The memset would mess things up after this series, but it was pointless in the first place.
Patches 3 and 4 extend struct nft_rule_dump_ctx and make struct netlink_callback's scratch area unused.
Patch 5 then finally eliminates the allocation.
All this is early preparation for reset command locking but unrelated enough to go alone.
Phil Sutter (5):
netfilter: nf_tables: Always allocate nft_rule_dump_ctx
netfilter: nf_tables: Drop pointless memset when dumping rules
netfilter: nf_tables: Carry reset flag in nft_rule_dump_ctx
netfilter: nf_tables: Carry s_idx in nft_rule_dump_ctx
netfilter: nf_tables: Don't allocate nft_rule_dump_ctx
net/netfilter/nf_tables_api.c | 80 ++++++++++++++--------------------- 1 file changed, 31 insertions(+), 49 deletions(-)
Signature · 1 line
2.41.0