Page MenuHomeFreeBSD

libpfctl: migrate to DIOCGETSTATESV2
ClosedPublic

Authored by kp on Jul 7 2021, 7:52 PM.
Tags
None
Referenced Files
F152321783: D31098.diff
Tue, Apr 14, 3:59 AM
F152292132: D31098.id91978.diff
Mon, Apr 13, 11:00 PM
Unknown Object (File)
Sat, Apr 11, 11:17 AM
Unknown Object (File)
Wed, Apr 8, 10:14 PM
Unknown Object (File)
Tue, Apr 7, 11:47 PM
Unknown Object (File)
Tue, Apr 7, 2:07 AM
Unknown Object (File)
Mon, Apr 6, 1:35 PM
Unknown Object (File)
Sun, Mar 29, 10:20 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.