* [PATCH] bridge: inherit slave devices needed_headroom
@ 2013-08-27 11:03 Florian Fainelli
2013-08-29 19:17 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2013-08-27 11:03 UTC (permalink / raw)
To: netdev; +Cc: stephen, davem, vyasevic, eric.dumazet, Florian Fainelli
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.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/bridge/br_if.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index aa6c9a8..c41d5fb 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -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);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bridge: inherit slave devices needed_headroom
2013-08-27 11:03 [PATCH] bridge: inherit slave devices needed_headroom Florian Fainelli
@ 2013-08-29 19:17 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-29 19:17 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, stephen, vyasevic, eric.dumazet
From: "Florian Fainelli" <f.fainelli@gmail.com>
Date: Tue, 27 Aug 2013 12:03:53 +0100
> 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.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Since this is a performance optimization I've applied this to net-next.
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-29 19:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 11:03 [PATCH] bridge: inherit slave devices needed_headroom Florian Fainelli
2013-08-29 19:17 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).