Page MenuHomeFreeBSD

pf: rework anchor handling to recurse
ClosedPublic

Authored by kp on May 28 2025, 7:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 2:54 AM
Unknown Object (File)
Sun, Sep 14, 7:11 AM
Unknown Object (File)
Sep 11 2025, 2:39 PM
Unknown Object (File)
Sep 11 2025, 2:21 PM
Unknown Object (File)
Aug 30 2025, 7:53 AM
Unknown Object (File)
Aug 27 2025, 1:18 PM
Unknown Object (File)
Aug 25 2025, 1:02 PM
Unknown Object (File)
Aug 16 2025, 9:35 PM

Details

Reviewers
None
Group Reviewers
pfsense
Commits
rGfe96610ba943: pf: rework anchor handling to recurse
Summary
  • percpu anchor stacks we actually don't need to pre-allocate per_anchor_stack[], if we use a 'natural' recursion, when doing anchor tree traversal.

O.K. mikeb@, mpi@

Extended because FreeBSD pf still has separate NAT rules processing, which also
needed this change.

Obtained from: OpenBSD, sashan <sashan@openbsd.org>, e236f0fa7b
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, 5e4ad307dc
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.May 28 2025, 7:33 PM
sys/netpfil/pf/pf.c
5892–5895

One of benefits of pf_test_ctx is that it provides a central point to access all those variables from functions. So it would be better to only pass ctx to pf_create_state and other functions and modify those functions to access the members of ctx.

sys/netpfil/pf/pf.c
5892–5895

That is a good idea. In fact, I thought I had already done that, but I don't seem to have that in my stack of pending patches.
I would like to keep it out of this change though.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 2 2025, 3:31 PM
This revision was automatically updated to reflect the committed changes.