Page MenuHomeFreeBSD

libpfctl: migrate to DIOCGETSTATESV2
ClosedPublic

Authored by kp on Jul 7 2021, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 23, 4:23 AM
Unknown Object (File)
Fri, Oct 11, 12:29 AM
Unknown Object (File)
Sep 21 2024, 5:03 PM
Unknown Object (File)
Sep 21 2024, 2:16 AM
Unknown Object (File)
Sep 19 2024, 4:27 PM
Unknown Object (File)
Sep 17 2024, 6:08 PM
Unknown Object (File)
Sep 17 2024, 3:21 PM
Unknown Object (File)
Sep 16 2024, 4:14 PM
Subscribers

Details

Summary

Stop using the *NV version to retrieve states, as its performance is
unacceptably bad.

MFC after: 1 week
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.Jul 7 2021, 7:52 PM
mjg added a subscriber: mjg.

Commit message should include perf numbers.

This revision is now accepted and ready to land.Jul 7 2021, 8:10 PM
mjg requested changes to this revision.Jul 7 2021, 8:11 PM
mjg added inline comments.
lib/libpfctl/libpfctl.c
716–718

version check should be performed here -- if lower than PF_STATE_VERSION then error out

This revision now requires changes to proceed.Jul 7 2021, 8:11 PM
lib/libpfctl/libpfctl.c
716–718

alternatively you can extend the request struct to include version number you expect, then the kernel can tell if you if it supports it to begin with

lib/libpfctl/libpfctl.c
716–718

now that I wrote it that's way better, in particular it can reduce the spare set -- worst case, should the struct run out of spares, a dedicated export func can be created to accomodate older userspace

Tell the kernel what version we expect

mjg added inline comments.
lib/libpfctl/libpfctl.c
702

this should bzero for consistency with code below

This revision is now accepted and ready to land.Jul 8 2021, 6:50 PM
This revision was automatically updated to reflect the committed changes.