Page MenuHomeFreeBSD

libpfctl: migrate to DIOCGETSTATESV2
ClosedPublic

Authored by kp on Jul 7 2021, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 7:36 AM
Unknown Object (File)
Sat, Apr 20, 7:36 AM
Unknown Object (File)
Sat, Apr 20, 7:32 AM
Unknown Object (File)
Sat, Apr 20, 7:31 AM
Unknown Object (File)
Wed, Apr 17, 9:23 PM
Unknown Object (File)
Mar 7 2024, 11:36 PM
Unknown Object (File)
Feb 12 2024, 8:51 AM
Unknown Object (File)
Feb 12 2024, 12:53 AM
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.