HomeFreeBSD

bridge: store a bridge_iflist pointer in ifnet

Description

bridge: store a bridge_iflist pointer in ifnet

currently, bridge stores a pointer to its softc in ifnet. this means
that when processing a packet, it needs to walk the bridge's member list
to find the bridge_iflist for the interface the packet came from.

instead, store a pointer to the bridge_iflist in ifnet, and add a
pointer from bridge_iflist back to the bridge_softc. this means given
an ifnet, we always have both the softc and the bridge_iflist without a
list walk.

there are two places outside if_bridge that treat ifnet->if_bridge as
something other than an opaque pointer: bridgestp, and netinet. add two
function pointers exported from if_bridge to handle those cases.

bump __FreeBSD_version as this is technically a KABI break.

Reviewed by: kp

Details

Provenance
ivyAuthored on Apr 5 2025, 2:04 PM
kpCommitted on Apr 9 2025, 7:39 AM
Parents
rGdd49816b0d66: bpf: avoid panic on multiple readers
Branches
Unknown
Tags
Unknown