* [PATCH next] ipvlan: inherit MTU from master device
@ 2016-01-28 7:33 Mahesh Bandewar
2016-01-28 13:13 ` Eric Dumazet
2016-02-05 0:22 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Mahesh Bandewar @ 2016-01-28 7:33 UTC (permalink / raw)
To: David Miller
Cc: Mahesh Bandewar, Eric Dumazet, Tim Hockin, netdev, Eric Dumazet,
Tim Hockins
From: Mahesh Bandewar <maheshb@google.com>
When we create IPvlan slave; we use ether_setup() and that
sets up default MTU to 1500 while the master device may have
lower / different MTU. Any subsequent changes to the masters'
MTU are reflected into the slaves' MTU setting. However if those
don't happen (most likely scenario), the slaves' MTU stays at
1500 which could be bad.
This change adds code to inherit MTU from the master device
instead of using the default value during the link initialization
phase.
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tim Hockins <thockins@google.com>
---
drivers/net/ipvlan/ipvlan_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index f94392d07126..7a3b41468a55 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -468,6 +468,7 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev,
ipvlan->dev = dev;
ipvlan->port = port;
ipvlan->sfeatures = IPVLAN_FEATURES;
+ ipvlan_adjust_mtu(ipvlan, phy_dev);
INIT_LIST_HEAD(&ipvlan->addrs);
/* TODO Probably put random address here to be presented to the
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH next] ipvlan: inherit MTU from master device
2016-01-28 7:33 [PATCH next] ipvlan: inherit MTU from master device Mahesh Bandewar
@ 2016-01-28 13:13 ` Eric Dumazet
2016-01-28 17:04 ` Mahesh Bandewar
2016-02-05 0:22 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2016-01-28 13:13 UTC (permalink / raw)
To: Mahesh Bandewar
Cc: David Miller, Mahesh Bandewar, Tim Hockin, netdev, Eric Dumazet,
Tim Hockins
On Wed, Jan 27, 2016 at 11:33 PM, Mahesh Bandewar <mahesh@bandewar.net> wrote:
> From: Mahesh Bandewar <maheshb@google.com>
>
> When we create IPvlan slave; we use ether_setup() and that
> sets up default MTU to 1500 while the master device may have
> lower / different MTU. Any subsequent changes to the masters'
> MTU are reflected into the slaves' MTU setting. However if those
> don't happen (most likely scenario), the slaves' MTU stays at
> 1500 which could be bad.
>
> This change adds code to inherit MTU from the master device
> instead of using the default value during the link initialization
> phase.
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> CC: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Tim Hockins <thockins@google.com>
>
Acked-by: Eric Dumazet <edumazet@google.com>
Two points Mahesh :
1) ipvlan_adjust_mtu() could be static, it is only used from
drivers/net/ipvlan/ipvlan_main.c
2) mtu_adj does not seem to be used ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH next] ipvlan: inherit MTU from master device
2016-01-28 13:13 ` Eric Dumazet
@ 2016-01-28 17:04 ` Mahesh Bandewar
0 siblings, 0 replies; 4+ messages in thread
From: Mahesh Bandewar @ 2016-01-28 17:04 UTC (permalink / raw)
To: Eric Dumazet
Cc: Mahesh Bandewar, David Miller, Tim Hockin, netdev, Eric Dumazet,
Tim Hockins
On Thu, Jan 28, 2016 at 5:13 AM, Eric Dumazet <edumazet@google.com> wrote:
> On Wed, Jan 27, 2016 at 11:33 PM, Mahesh Bandewar <mahesh@bandewar.net> wrote:
>> From: Mahesh Bandewar <maheshb@google.com>
>>
>> When we create IPvlan slave; we use ether_setup() and that
>> sets up default MTU to 1500 while the master device may have
>> lower / different MTU. Any subsequent changes to the masters'
>> MTU are reflected into the slaves' MTU setting. However if those
>> don't happen (most likely scenario), the slaves' MTU stays at
>> 1500 which could be bad.
>>
>> This change adds code to inherit MTU from the master device
>> instead of using the default value during the link initialization
>> phase.
>>
>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>> CC: Eric Dumazet <eric.dumazet@gmail.com>
>> CC: Tim Hockins <thockins@google.com>
>>
>
> Acked-by: Eric Dumazet <edumazet@google.com>
>
> Two points Mahesh :
>
> 1) ipvlan_adjust_mtu() could be static, it is only used from
> drivers/net/ipvlan/ipvlan_main.c
>
Correct, I'm working on a some other (generic) changes and I could
include this suggestion as part of that / later patch or do you
prefer it to be part of this change?
> 2) mtu_adj does not seem to be used ?
mtu_adj is set to zero so that it follows the master. The idea behind
this field was that if enhancements / changes to the IPvlan driver
(some sort of built-in encapsulation etc.) is added, this can be set
to that magic value so that changes to master will still allow slaves
to follow it without compromising the built-in mechanism.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH next] ipvlan: inherit MTU from master device
2016-01-28 7:33 [PATCH next] ipvlan: inherit MTU from master device Mahesh Bandewar
2016-01-28 13:13 ` Eric Dumazet
@ 2016-02-05 0:22 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-02-05 0:22 UTC (permalink / raw)
To: mahesh; +Cc: maheshb, edumazet, thockin, netdev, eric.dumazet, thockins
From: Mahesh Bandewar <mahesh@bandewar.net>
Date: Wed, 27 Jan 2016 23:33:28 -0800
> From: Mahesh Bandewar <maheshb@google.com>
>
> When we create IPvlan slave; we use ether_setup() and that
> sets up default MTU to 1500 while the master device may have
> lower / different MTU. Any subsequent changes to the masters'
> MTU are reflected into the slaves' MTU setting. However if those
> don't happen (most likely scenario), the slaves' MTU stays at
> 1500 which could be bad.
>
> This change adds code to inherit MTU from the master device
> instead of using the default value during the link initialization
> phase.
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-05 0:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-28 7:33 [PATCH next] ipvlan: inherit MTU from master device Mahesh Bandewar
2016-01-28 13:13 ` Eric Dumazet
2016-01-28 17:04 ` Mahesh Bandewar
2016-02-05 0:22 ` 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).