bridge: inherit slave devices needed_headroom
Subsystems (3)
PATCH 1/1 bridge: inherit slave devices needed_headroom
Some slave devices may have set a dev->needed_headroom value which is different than the default one, most likely in order to prepend a hardware descriptor in front of the Ethernet frame to send. Whenever a new slave is added to a bridge, ensure that we update the needed_headroom value accordingly to account for the slave needed_headroom value.
--- net/bridge/br_if.c | 3 +++ 1 file changed, 3 insertions(+)
net/bridge/br_if.c +3 -0
@@ -383,6 +383,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)netdev_update_features (br->dev); +if (br->dev->needed_headroom < dev->needed_headroom) + br->dev->needed_headroom = dev->needed_headroom; +spin_lock_bh (&br->lock); changed_addr =br_stp_recalculate_bridge_id (br);
Signature · 1 line
1.8.1.2
David Miller
maintainerFrom: "Florian Fainelli" <[email protected]>
Date: Tue, 27 Aug 2013 12:03:53 +0100
Quoted 8 lines
Some slave devices may have set a
dev->needed_headroomvalue which is different than the default one, most likely in order to prepend a hardware descriptor in front of the Ethernet frame to send. Whenever a new slave is added to a bridge, ensure that we update theneeded_headroomvalue accordingly to account for the slaveneeded_headroomvalue.Signed-off-by Florian Fainelli <[email protected]>
Since this is a performance optimization I've applied this to net-next.
Thanks!