Patchwork [2/2] macvlan: propogate mtu changes

login
register
mail settings
Submitter stephen hemminger
Date Oct. 29, 2008, 7:59 p.m.
Message ID <20081029125912.002dbe9d@extreme>
Download mbox | patch
Permalink /patch/6302/
State Deferred
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Oct. 29, 2008, 7:59 p.m.
If MTU of underlying real device is changed, propogate up to macvlan
pseudo devices.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Patrick McHardy - Oct. 29, 2008, 9:02 p.m.
Stephen Hemminger wrote:
> If MTU of underlying real device is changed, propogate up to macvlan
> pseudo devices.

I'm going to do a similar patch for macvlan as I did for VLAN for
the MTU settings (desired MTU/operational MTU).

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Patrick McHardy - Oct. 29, 2008, 9:05 p.m.
Patrick McHardy wrote:
> Stephen Hemminger wrote:
>   
>> If MTU of underlying real device is changed, propogate up to macvlan
>> pseudo devices.
>>     
>
> I'm going to do a similar patch for macvlan as I did for VLAN for
> the MTU settings (desired MTU/operational MTU).

... and add the rollback part from your patch to VLAN as well.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 29, 2008, 9:05 p.m.
From: Patrick McHardy <kaber@trash.net>
Date: Wed, 29 Oct 2008 22:05:02 +0100

> Patrick McHardy wrote:
> > Stephen Hemminger wrote:
> >   
> >> If MTU of underlying real device is changed, propogate up to macvlan
> >> pseudo devices.
> >>     
> >
> > I'm going to do a similar patch for macvlan as I did for VLAN for
> > the MTU settings (desired MTU/operational MTU).
> 
> ... and add the rollback part from your patch to VLAN as well.

So you want me to drop this second patch from Stephen from now?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Patrick McHardy - Oct. 29, 2008, 9:06 p.m.
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Wed, 29 Oct 2008 22:05:02 +0100
>
>   
>> Patrick McHardy wrote:
>>     
>>> Stephen Hemminger wrote:
>>>   
>>>       
>>>> If MTU of underlying real device is changed, propogate up to macvlan
>>>> pseudo devices.
>>>>     
>>>>         
>>> I'm going to do a similar patch for macvlan as I did for VLAN for
>>> the MTU settings (desired MTU/operational MTU).
>>>       
>> ... and add the rollback part from your patch to VLAN as well.
>>     
>
> So you want me to drop this second patch from Stephen from now?

Yes please, I'll send patches for both VLAN and macvlan MTU settings
later.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/macvlan.c	2008-10-29 09:53:00.000000000 -0700
+++ b/drivers/net/macvlan.c	2008-10-29 12:58:40.000000000 -0700
@@ -537,6 +537,19 @@  static int macvlan_device_event(struct n
 		list_for_each_entry_safe(vlan, next, &port->vlans, list)
 			macvlan_dellink(vlan->dev);
 		break;
+	case NETDEV_CHANGEMTU:
+		list_for_each_entry(vlan, &port->vlans, list) {
+			int err, oldmtu = vlan->dev->mtu;
+
+			err = dev_set_mtu(vlan->dev, dev->mtu);
+			if (err) {
+				list_for_each_entry_continue_reverse(vlan,
+								     &port->vlans,
+								     list)
+					dev_set_mtu(vlan->dev, oldmtu);
+				return notifier_from_errno(err);
+			}
+		}
 	}
 	return NOTIFY_DONE;
 }