mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
netgraph/ng_bridge: Avoid cache thrashing
Hint the compiler, that this update is needed at most once per second.
Only in this case the memory line needs to be written. This will
reduce the amount of cache trashing during forward of most frames.
Suggested by: zec
Approved by: zec
Differential Revision: https://reviews.freebsd.org/D28601
(cherry picked from commit 4dfe70fdbd)
This commit is contained in:
parent
fb5e2f4d61
commit
7fd88ba72e
1 changed files with 2 additions and 1 deletions
|
|
@ -863,7 +863,8 @@ ng_bridge_rcvdata(hook_p hook, item_p item)
|
|||
* This is safe without locking, because it's
|
||||
* the only operation during shared access.
|
||||
*/
|
||||
host->staleness = 0;
|
||||
if (__predict_false(host->staleness > 0))
|
||||
host->staleness = 0;
|
||||
|
||||
if ((host == NULL && ctx.incoming->learnMac) ||
|
||||
(host != NULL && host->link != ctx.incoming)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue