Skip to content

dynamic device updates for flowtables

Pablo Neira Ayuso netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7netfilter: nf_tables: generalise flowtable hook parsingnet/netfilter/nf_tables_api.c+25 -110 replies
2/7netfilter: nf_tables: pass hook list to nft_{un,}register_flowtable_net_hooks()net/netfilter/nf_tables_api.c+10 -70 replies
3/7netfilter: nf_tables: add nft_flowtable_hooks_destroy()net/netfilter/nf_tables_api.c+11 -40 replies
4/7netfilter: nf_tables: pass hook list to flowtable event notifiernet/netfilter/nf_tables_api.c+11 -50 replies
5/7netfilter: nf_tables: add devices to existing flowtableinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+92 -110 replies
6/7netfilter: nf_tables: delete devices from flowtableinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+98 -160 replies
7/7netfilter: nf_tables: allow to register flowtable with no devicesnet/netfilter/nf_tables_api.c+11 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/7] dynamic device updates for flowtables

Hi,

Flowtable allows you to enable a fast forwarding path (packets bypass the classic forwarding path), eg.

table inet filter {
        flowtable fastpath {
                hook ingress priority 0
                devices = { eth0, eth1 }
        }

        chain forward {
                type filter hook forward priority 0; policy accept;
                ip protocol { tcp , udp } flow offload @fastpath;
        }
}

This ruleset above places TCP and UDP flows in the "fastpath" flowtable. Flowtables integrate nicely with NAT and lightweight tunnels.

This patchset implements dynamic device updates for flowtables:

Patch #1 generalises the flowtable hook parser to take a hook list. Patch #2 passes a hook list to the flowtable hook registration/unregistration. Patch #3 adds a helper function to release the flowtable hook list. Patch #4 updates the flowtable event notifier to pass a flowtable hook list. Patch #5 allows users to add new devices to an existing flowtables. Patch #6 allows users to remove devices to an existing flowtables. Patch #7 allows to register a flowtable with no initial devices.

This allows users to register a flowtable with no devices:

	nft add flowtable x y { hook ingress priority 0\; }

then, add dynamic devices as they show up:

	nft add flowtable x y { devices = { ppp0, eth1 } \; }

Devices that go away are automagically removed from the flowtable.

Pablo Neira Ayuso (7):
netfilter: nf_tables: generalise flowtable hook parsing
netfilter: nf_tables: pass hook list to nft_{un,}register_flowtable_net_hooks()
netfilter: nf_tables: add nft_flowtable_hooks_destroy()
netfilter: nf_tables: pass hook list to flowtable event notifier
netfilter: nf_tables: add devices to existing flowtable
netfilter: nf_tables: delete devices from flowtable
netfilter: nf_tables: allow to register flowtable with no devices

 include/net/netfilter/nf_tables.h |   7 +
 net/netfilter/nf_tables_api.c     | 304 ++++++++++++++++++++++++------
 2 files changed, 253 insertions(+), 58 deletions(-)
Signature · 1 line
2.20.1