netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Ding Tianhong <dingtianhong@huawei.com>
Cc: Patrick McHardy <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>,
	Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] macvlan: Propagate lowerdev MTU changes
Date: Tue, 13 May 2014 14:29:06 +0200	[thread overview]
Message-ID: <20140513122906.GD2910@minipsycho.orion> (raw)
In-Reply-To: <5371BE1F.7030508@huawei.com>

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>

  reply	other threads:[~2014-05-13 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  6:39 [PATCH net-next] macvlan: Propagate lowerdev MTU changes Ding Tianhong
2014-05-13 12:29 ` Jiri Pirko [this message]
2014-05-14 19:37 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140513122906.GD2910@minipsycho.orion \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).