Page MenuHomeFreeBSD

pf: postpone clearing of struct pf_pdesc
ClosedPublic

Authored by kp on Jan 10 2022, 9:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 18, 6:49 AM
Unknown Object (File)
Tue, Oct 7, 7:49 AM
Unknown Object (File)
Sep 17 2025, 11:06 PM
Unknown Object (File)
Sep 9 2025, 9:57 PM
Unknown Object (File)
Sep 9 2025, 9:34 AM
Unknown Object (File)
Sep 8 2025, 9:29 AM
Unknown Object (File)
Sep 4 2025, 10:10 AM
Unknown Object (File)
Sep 3 2025, 3:15 PM

Details

Summary

Postpone zeroing out pd until after the PFI_IFLAG_SKIP/M_SKIP_FIREWALL
checks. We don't need it until then, and it saves us a few CPU cycles in
some cases.
This isn't expected to make a measurable performance change though.

Pointed out by: markj
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.Jan 10 2022, 9:20 PM
mjg added a subscriber: mjg.

The thing to do in the long run is to stop zeroing it upfront to begin with. KMSAN, if operational, can be used to validate there are no uninitialized uses. I tried to do it few weeks back but ran into bugs.

This revision is now accepted and ready to land.Jan 10 2022, 9:44 PM
This revision was automatically updated to reflect the committed changes.