Page MenuHomeFreeBSD

pf :Reduce number of hashing operations when handling source nodes
ClosedPublic

Authored by vegeta_tuxpowered.net on Apr 30 2023, 7:40 PM.
Tags
None
Referenced Files
F132467108: D39888.id121291.diff
Fri, Oct 17, 4:27 AM
F132467106: D39888.id121289.diff
Fri, Oct 17, 4:27 AM
F132467095: D39888.id121276.diff
Fri, Oct 17, 4:27 AM
F132377763: D39888.id121293.diff
Thu, Oct 16, 9:11 AM
F132377761: D39888.id121292.diff
Thu, Oct 16, 9:11 AM
F132377757: D39888.id121275.diff
Thu, Oct 16, 9:11 AM
F132377754: D39888.id.diff
Thu, Oct 16, 9:11 AM
Unknown Object (File)
Wed, Oct 15, 9:31 PM

Details

Summary

Reduce number of hashing operations when handling source nodes by always having a pointer to the hash row mutex in the source node. Provide macros for handling and asserting the mutex. Calculate the hash only once in pf_find_src_node() and then use this hash in subsequent operations.

Cherry-picked from development of D39880

Sponsored by: InnoGames GmbH

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Removed unnecessary state lock assertion.

sys/net/pfvar.h
396

That may want to be mtx_lock((sn)->lock), just for safety.

2160

Should we take the opportunity to turn that int returnlocked into bool returnlocked?

Updated pointer handing. Changed the flag to boolean.

I think this looks good, but I want to give Mateusz some time to take a look too.

This revision is now accepted and ready to land.May 1 2023, 1:40 PM
This revision now requires review to proceed.May 1 2023, 1:50 PM

The returnlocked flag is now a booelan.

This revision is now accepted and ready to land.May 1 2023, 1:58 PM