netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] macvlan: Propagate lowerdev MTU changes
@ 2014-05-13  6:39 Ding Tianhong
  2014-05-13 12:29 ` Jiri Pirko
  2014-05-14 19:37 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ding Tianhong @ 2014-05-13  6:39 UTC (permalink / raw)
  To: Patrick McHardy, David S. Miller, Netdev

When the physical MTU changes we should ensure that all existing MACVLAN
dev MTU do not exceed the new lowerdev MTU. This patch adds that
propagation.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/macvlan.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index f0118d1..e03707d 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1091,6 +1091,13 @@ static int macvlan_device_event(struct notifier_block *unused,
 			netdev_update_features(vlan->dev);
 		}
 		break;
+	case NETDEV_CHANGEMTU:
+		list_for_each_entry(vlan, &port->vlans, list) {
+			if (vlan->dev->mtu <= dev->mtu)
+				continue;
+			dev_set_mtu(vlan->dev, dev->mtu);
+		}
+		break;
 	case NETDEV_UNREGISTER:
 		/* twiddle thumbs on netns device moves */
 		if (dev->reg_state != NETREG_UNREGISTERING)
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] macvlan: Propagate lowerdev MTU changes
  2014-05-13  6:39 [PATCH net-next] macvlan: Propagate lowerdev MTU changes Ding Tianhong
@ 2014-05-13 12:29 ` Jiri Pirko
  2014-05-14 19:37 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2014-05-13 12:29 UTC (permalink / raw)
  To: Ding Tianhong; +Cc: Patrick McHardy, David S. Miller, Netdev

Tue, May 13, 2014 at 08:39:27AM CEST, dingtianhong@huawei.com wrote:
>When the physical MTU changes we should ensure that all existing MACVLAN
>dev MTU do not exceed the new lowerdev MTU. This patch adds that
>propagation.
>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>---
> drivers/net/macvlan.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
>index f0118d1..e03707d 100644
>--- a/drivers/net/macvlan.c
>+++ b/drivers/net/macvlan.c
>@@ -1091,6 +1091,13 @@ static int macvlan_device_event(struct notifier_block *unused,
> 			netdev_update_features(vlan->dev);
> 		}
> 		break;
>+	case NETDEV_CHANGEMTU:
>+		list_for_each_entry(vlan, &port->vlans, list) {
>+			if (vlan->dev->mtu <= dev->mtu)
>+				continue;
>+			dev_set_mtu(vlan->dev, dev->mtu);
>+		}
>+		break;
> 	case NETDEV_UNREGISTER:
> 		/* twiddle thumbs on netns device moves */
> 		if (dev->reg_state != NETREG_UNREGISTERING)
>-- 
>1.8.0

Reviewed-by: Jiri Pirko <jiri@resnulli.us>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] macvlan: Propagate lowerdev MTU changes
  2014-05-13  6:39 [PATCH net-next] macvlan: Propagate lowerdev MTU changes Ding Tianhong
  2014-05-13 12:29 ` Jiri Pirko
@ 2014-05-14 19:37 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-05-14 19:37 UTC (permalink / raw)
  To: dingtianhong; +Cc: kaber, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Tue, 13 May 2014 14:39:27 +0800

> When the physical MTU changes we should ensure that all existing MACVLAN
> dev MTU do not exceed the new lowerdev MTU. This patch adds that
> propagation.
> 
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-14 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13  6:39 [PATCH net-next] macvlan: Propagate lowerdev MTU changes Ding Tianhong
2014-05-13 12:29 ` Jiri Pirko
2014-05-14 19:37 ` 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).