Skip to content

net: add a flowtable fast-path page - #885

Merged
laveeshb merged 22 commits into
mainfrom
net-flowtable
Nov 29, 2026
Merged

laveeshb merged 22 commits into
mainfrom
net-flowtable

Conversation

@laveeshb

@laveeshb laveeshb commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Adds net/flowtable.md, linked from the net README and the nav.

Flowtable is the fast path that lets forwarded flows already in a flow table skip most of the netfilter hook path. Searching docs/ for it found nothing. Every behaviour claim links to the function or line at Linux v7.4-rc3, every statement about nf_flowtable.rst links to the line it paraphrases, and every history claim links to its commit or to the 2017 netfilter-devel cover letters. Behaviour that changed recently is marked with the release that introduced it. The page covers:

  • what it does, with a diagram, and which hooks a software hit still passes (tc ingress, netdev egress, tc egress) and how an IPsec direction differs;
  • turning it on: the example ruleset, rule evaluation, the counter flag, priority, the device list and the v7.2 change, missing devices, the counter and flags offload options, and the Kconfig symbols;
  • how a flow is added: eligible protocols, what is skipped, path resolution and the one-direction IPsec rule, and the "be liberal" TCP flag;
  • transmit modes (neighbour, direct, xfrm) and which keep a route;
  • what a hit does, in the IPv4 and IPv6 hooks, including tunnel handling;
  • how a flow leaves, with a lifecycle diagram: timeouts, stale route, device down, FIN and RST, adding again, the conntrack timeout table and the hand-back to conntrack;
  • hardware offload: the TC_SETUP_FT and TC_SETUP_CLSFLOWER driver interface, in-tree users, what fails when a device can't offload, and the XDP lookup;
  • inspecting a flow, and what offloaded entries omit from conntrack listings;
  • limits: rule changes, the cache warning, IPsec, ip6gre;
  • where it came from, quoting the 2017 cover letters, with the commits that shaped the hardware interface and the GRE timeout history;
  • the places where Documentation/networking/nf_flowtable.rst no longer matches the source, each with the commit that changed it.

mkdocs build --strict passes.

Closes #884
Part of #881

Explain how established forwarded flows are added to a flowtable, how the fast path handles a hit, how flows time out or are torn down, and hardware offload. Notes where the in-tree documentation no longer matches the source.
@laveeshb laveeshb self-assigned this Nov 29, 2026
Link each behaviour claim to the function or line at v7.4-rc3, each doc claim to nf_flowtable.rst, and each history claim to its commit. Make IPsec handling per direction, mark the v7.2 device-list change, and move the GRE timeout history into its own note.
Correct the stable-tag count, the postrouting and NFT_BREAK statements, closing-flow and neighbour behaviour, and the v7.2 device-list scope. Cite the remaining claims and pin all links to v7.4-rc3.
Cover the encapsulated-packet hooks, cite the one-direction IPsec claim, show the flowtable counter and offload options, fix the direct-mode and device-registration statements, and attribute the GRE timeout history.
Add a lifecycle diagram, state which drop rules and devices the statements cover, record the notifier and hook-allocation behaviour, and split the dense hand-back and GRE history paragraphs.
… page

Fix the drop-rule and tag statements, qualify hardware removal timing and device-down matching, correct the GRE initializer wording, cite IPv6 equivalents and add the XDP lookup build condition.
State IPsec, route caching and postrouting per direction, correct the hook-registration and XDP commit attributions, note that a flow with an IPsec direction is not added in hardware, and fix the lifecycle diagram.
Scope the route check to the packet's direction, correct the hardware removal timing on device down, split the rule-change bullets, and cite the local-out hooks and the tag bits.
Scope the NF_STOLEN, tag and conntrack-refresh statements, drop an uncited stale-route sentence, split the dense timeout bullet and reuse one reference id.
State that a failed rename is rolled back, scope the conntrack refresh to packets treated as valid, fix a dangling reference after the bullet split, and extend the tag citation range.
Say that the TCP tracker normally sets a timeout and that packets returning earlier set none, and anchor the notifier citation at its first line.
Say that the TCP tracker can set the timeout again when conntrack processes another packet, and keep the fixed-timeout exception.
Say the TCP tracker can set the timeout again, for example at the refresh, and scope the fixed-timeout exception to that refresh.
@laveeshb
laveeshb merged commit 46e7f4b into main Nov 29, 2026
1 check passed
@laveeshb
laveeshb deleted the net-flowtable branch November 29, 2026 04:58
@laveeshb laveeshb mentioned this pull request Nov 29, 2026
1 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net: add a flowtable (flow offload) page

1 participant