Page MenuHomeFreeBSD

pf: optimize state key comparison on amd4
Needs ReviewPublic

Authored by mjg on Tue, Oct 20, 12:37 PM.

Details

Reviewers
kp
Summary

commit 59a03936d9870b9ded61221a6f123eeaff36dfde
Author: Mateusz Guzik <mjg@FreeBSD.org>
Date: Tue Oct 20 11:20:26 2026 +0000

pf: optimize state key comparison on amd4

commit 5de43eb78ac906dc1caedfde2977cee38dc0ab55
Author: Mateusz Guzik <mjg@FreeBSD.org>
Date: Tue Oct 20 11:19:50 2026 +0000

pf: CTASSERT on relevant offsets between pf_state_key and pf_state_key_cmp

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mjg requested review of this revision.Tue, Oct 20, 12:37 PM
mjg edited the summary of this revision. (Show Details)

Do we have measurements of what difference this makes?

sys/net/pfvar.h
1032

This fails to build in userspace for me.

It probably just wants an #ifdef _KERNEL around it.

In file included from net_if_pfsync.c:1:
In file included from /usr/src/sys/net/if_pfsync.h:55:
/usr/src/sys/net/pfvar.h:1032:10: error: expected parameter declarator
 1032 | CTASSERT(offsetof(struct pf_state_key, addr) == offsetof(struct pf_state_key_cmp, addr));
      |          ^
/usr/src/sys/sys/_offsetof.h:16:32: note: expanded from macro 'offsetof'
   16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
      |                                ^