Skip to content

netfilter: make nf_flowtable lifetime differ from container struct

Florian Westphal netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8netfilter: flowtable: move nf_flowtable out of container structuresinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nft_flow_offload.c +1 more+66 -484 replies
2/8netfilter: nf_flowtable: replace init callback with a create oneinclude/net/netfilter/nf_flow_table.h net/netfilter/nf_flow_table_core.c net/netfilter/nf_flow_table_inet.c +2 more+25 -250 replies
3/8netfilter: nf_flowtable: make free a real free functionnet/netfilter/nf_flow_table_core.c net/netfilter/nf_tables_api.c net/sched/act_ct.c+8 -120 replies
4/8netfilter: nf_flowtable: delay flowtable release a second timeinclude/net/netfilter/nf_flow_table.h net/netfilter/nf_flow_table_core.c+16 -40 replies
5/8netfilter: nf_tables: reject flowtable hw offload for same devicenet/netfilter/nf_tables_api.c+36 -00 replies
6/8netfilter: nf_tables: add xdp offload flaginclude/net/netfilter/nf_flow_table.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+17 -30 replies
7/8netfilter: nf_tables: add flowtable map for xdp offloadinclude/net/netfilter/nf_flow_table.h net/netfilter/nf_flow_table_offload.c net/netfilter/nf_tables_api.c+139 -24 replies
8/8netfilter: nf_tables: permit duplicate flowtable mappingsnet/netfilter/nf_flow_table_offload.c+31 -50 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by.

PatchLorenzo Bianconi
1/8
2/8
3/8
4/8
5/8
6/8
7/8T-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH nf-next 0/8] netfilter: make nf_flowtable lifetime differ from container struct

This series detaches nf_flowtable from the two existing container structures.

Allocation and freeing is moved to the flowtable core. Then, memory release is changed so it passes through another synchronize_rcu() call.

Next, a new nftables flowtable flag is introduced to mark a flowtable for explicit XDP-based offload.

Such flowtables have more restrictions,
in particular, if two flowtables are tagged as 'xdp offloaded', they cannot share any net devices.

It would be possible to avoid such new 'xdp flag', but I see no way to do so without breaking backwards compatbility: at this time the same net_device can be part of any number of flowtables, this is very inefficient from an XDP point of view: it would have to perform lookups in all associated flowtables in a loop until a match is found.

This is hardly desirable.

Last two patches expose the hash table mapping and make utility function available for XDP.

The XDP kfunc will be added in a followup patch.

Florian Westphal (8):
netfilter: flowtable: move nf_flowtable out of container structures
netfilter: nf_flowtable: replace init callback with a create one
netfilter: nf_flowtable: make free a real free function
netfilter: nf_flowtable: delay flowtable release a second time
netfilter: nf_tables: reject flowtable hw offload for same device
netfilter: nf_tables: add xdp offload flag
netfilter: nf_tables: add flowtable map for xdp offload
netfilter: nf_tables: permit duplicate flowtable mappings

 include/net/netfilter/nf_flow_table.h    |  15 ++-
 include/net/netfilter/nf_tables.h        |  15 ++-
 include/uapi/linux/netfilter/nf_tables.h |   5 +-
 net/netfilter/nf_flow_table_core.c       |  39 ++++--
 net/netfilter/nf_flow_table_inet.c       |   6 +-
 net/netfilter/nf_flow_table_offload.c    | 157 ++++++++++++++++++++++-
 net/netfilter/nf_tables_api.c            | 113 +++++++++++-----
 net/netfilter/nft_flow_offload.c         |   4 +-
 net/sched/act_ct.c                       |  37 +++---
 9 files changed, 315 insertions(+), 76 deletions(-)
Signature · 1 line
2.41.0