Page MenuHomeFreeBSD

bridge: Further decompose GRAB_OUR_PACKETS
Needs ReviewPublic

Authored by markj on Feb 7 2023, 7:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 4:06 AM
Unknown Object (File)
Wed, Apr 3, 11:29 AM
Unknown Object (File)
Wed, Apr 3, 11:27 AM
Unknown Object (File)
Sat, Mar 30, 10:02 AM
Unknown Object (File)
Jan 10 2024, 8:23 PM
Unknown Object (File)
Dec 20 2023, 7:19 AM
Unknown Object (File)
Dec 10 2023, 9:12 PM
Unknown Object (File)
Oct 27 2023, 10:02 AM
Subscribers

Details

Reviewers
melifaro
kp
Group Reviewers
network
Summary

Introduce an inline function which consumes a packet known to be
destined for a particular interface. Generally, avoid introducing
macros with side effects.

Add a bridge_learn() helper instead of having the same code duplicated
into the local and forwarding cases.

Simplify some conditionals in bridge_forward().

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49612
Build 46502: arc lint + arc unit

Event Timeline

markj requested review of this revision.Feb 7 2023, 7:24 PM
sys/net/if_bridge.c
2636

One small benefit of this approach is that we don't need to test the bridge interface type. There might be some other simplifications that are possible.

zlei added inline comments.
sys/net/if_bridge.c
2646

I wonder if we can have a hash map lladdr -> ifp to speed up lookups for bridge which have large quantity members.

I'm not really looking at if_bridge anymore, so I'll drop this patch. If anyone wants to take it and change/improve it, please feel free.

sys/net/if_bridge.c
2646

Yes, that's probably a good idea. Even a flat array would be better than the linked list; now that the data path is protected by an epoch section, it should be pretty easy to implement resizing.