Skip to content

Dynamic hook interface binding part 2

Phil Sutter netfilter-devel 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest posting 2/213 patches 3 repliesIn review
  2. v6 posting 2/212 patches 8 repliesSuperseded
  3. v7 posting 1/26 patches 1 replySuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v6 posting 1/27 patches5 repliesSuperseded
v518 patches3 repliesSuperseded
v416 patches7 repliesSuperseded
v316 patches21 repliesSuperseded
v27 patches6 repliesSuperseded
v15 patches4 repliesSuperseded

Changes in v7 from the cover letter

- Misc changes in patch 5 (described in there)
- New patch 10
- Patch 11 adjusted to new patch 10
- Patch 12 adds new NFNLGRP_NFT_DEV for the new notifications
- Fix typo in patch 12's subject line

Patches in v7 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13netfilter: nf_tables: Introduce functions freeing nft_hook objectsnet/netfilter/nf_tables_api.c+24 -140 replies
2/13netfilter: nf_tables: Introduce nft_hook_find_ops{,_rcu}()include/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nf_tables_offload.c +2 more+31 -50 replies
3/13netfilter: nf_tables: Introduce nft_register_flowtable_ops()net/netfilter/nf_tables_api.c+21 -110 replies
4/13netfilter: nf_tables: Pass nf_hook_ops to nft_unregister_flowtable_hook()net/netfilter/nf_tables_api.c+9 -110 replies
5/13netfilter: nf_tables: Have a list of nf_hook_ops in nft_hookinclude/linux/netfilter.h include/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c +2 more+137 -630 replies
6/13netfilter: nf_tables: Prepare for handling NETDEV_REGISTER eventsnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+24 -140 replies
7/13netfilter: nf_tables: Respect NETDEV_REGISTER eventsnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+60 -90 replies
8/13netfilter: nf_tables: Wrap netdev notifiersnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+46 -260 replies
9/13netfilter: nf_tables: Handle NETDEV_CHANGENAME eventsnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+48 -180 replies
10/13netfilter: nf_tables: Sort labels in nft_netdev_hook_alloc()net/netfilter/nf_tables_api.c+7 -90 replies
11/13netfilter: nf_tables: Support wildcard netdev hook specsnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+15 -160 replies
12/13netfilter: nf_tables: Add notifications for hook changesinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h include/uapi/linux/netfilter/nfnetlink.h +3 more+79 -03 replies
13/13selftests: netfilter: Torture nftables netdev hookstools/testing/selftests/net/netfilter/Makefile tools/testing/selftests/net/netfilter/nft_interface_stress.sh+152 -00 replies

Reviews trailers per patch

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

Read the v7 thread

Cover letter [nf-next PATCH v7 00/13] Dynamic hook interface binding part 2

Changes since v6:
- Misc changes in patch 5 (described in there)
- New patch 10
- Patch 11 adjusted to new patch 10
- Patch 12 adds new NFNLGRP_NFT_DEV for the new notifications
- Fix typo in patch 12's subject line

Patches 1-5 prepare for and implement nf_hook_ops lists in nft_hook objects. This is crucial for wildcard interface specs and convenient with dynamic netdev hook registration upon NETDEV_REGISTER events.

Patches 6-9 leverage the new infrastructure to correctly handle NETDEV_REGISTER and NETDEV_CHANGENAME events.

Patch 11 prepares the code for non-NUL-terminated interface names passed by user space which resemble prefixes to match on. As a side-effect, hook allocation code becomes tolerant to non-matching interface specs.

The final two patches implement netlink notifications for netdev add/remove events and add a kselftest.

Phil Sutter (13):
netfilter: nf_tables: Introduce functions freeing nft_hook objects
netfilter: nf_tables: Introduce nft_hook_find_ops{,_rcu}()
netfilter: nf_tables: Introduce nft_register_flowtable_ops()
netfilter: nf_tables: Pass nf_hook_ops to
nft_unregister_flowtable_hook()
netfilter: nf_tables: Have a list of nf_hook_ops in nft_hook
netfilter: nf_tables: Prepare for handling NETDEV_REGISTER events
netfilter: nf_tables: Respect NETDEV_REGISTER events
netfilter: nf_tables: Wrap netdev notifiers
netfilter: nf_tables: Handle NETDEV_CHANGENAME events
netfilter: nf_tables: Sort labels in nft_netdev_hook_alloc()
netfilter: nf_tables: Support wildcard netdev hook specs
netfilter: nf_tables: Add notifications for hook changes
selftests: netfilter: Torture nftables netdev hooks

 include/linux/netfilter.h                     |   3 +
 include/net/netfilter/nf_tables.h             |  12 +-
 include/uapi/linux/netfilter/nf_tables.h      |  10 +
 include/uapi/linux/netfilter/nfnetlink.h      |   2 +
 net/netfilter/nf_tables_api.c                 | 402 ++++++++++++++----
 net/netfilter/nf_tables_offload.c             |  51 ++-
 net/netfilter/nfnetlink.c                     |   1 +
 net/netfilter/nft_chain_filter.c              |  94 +++-
 net/netfilter/nft_flow_offload.c              |   2 +-
 .../testing/selftests/net/netfilter/Makefile  |   1 +
 .../net/netfilter/nft_interface_stress.sh     | 151 +++++++
 11 files changed, 593 insertions(+), 136 deletions(-)
 create mode 100755 tools/testing/selftests/net/netfilter/nft_interface_stress.sh
Signature · 1 line
2.49.0