public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse•cz>
To: Vlad Yasevich <vyasevich@gmail•com>
Cc: Kevin Wallace <kevin@pentabarf•net>, netdev@vger•kernel.org
Subject: Re: [PATCH v2] macvlan: Support creating macvtaps from macvlans
Date: Tue, 3 Dec 2013 20:47:07 +0100	[thread overview]
Message-ID: <20131203194707.GA32367@lion.mk-sys.cz> (raw)
In-Reply-To: <529E0421.2090504@gmail.com>

On Tue, Dec 03, 2013 at 11:17:37AM -0500, Vlad Yasevich wrote:
> > diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> > index acf9379..cfb9157 100644
> > --- a/drivers/net/macvlan.c
> > +++ b/drivers/net/macvlan.c
> > @@ -820,13 +820,11 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
> >  	if (lowerdev == NULL)
> >  		return -ENODEV;
> >  
> > -	/* When creating macvlans on top of other macvlans - use
> > +	/* When creating macvlans or macvtaps on top of other macvlans - use
> >  	 * the real device as the lowerdev.
> >  	 */
> > -	if (lowerdev->rtnl_link_ops == dev->rtnl_link_ops) {
> > -		struct macvlan_dev *lowervlan = netdev_priv(lowerdev);
> > -		lowerdev = lowervlan->lowerdev;
> > -	}
> > +	if (netif_is_macvlan(lowerdev))
> > +		lowerdev = macvlan_dev_real_dev(lowerdev);
> >  
> >  	if (!tb[IFLA_MTU])
> >  		dev->mtu = lowerdev->mtu;
> > 
> 
> the other question is should this be done in a loop?  What happens if
> you have nested namespaces?

Nested namespaces are not a problem, what would be a problem, would be
having a macvlan (macvtap) device on top of another macvlan. But the
purpose of this particular code is to prevent it and use the underlying
"real" device instead. That's why unlike vlan_dev_real_dev(),
macvlan_dev_real_dev() doesn't need to recurse.

                                                         Michal Kubecek

  parent reply	other threads:[~2013-12-03 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  4:13 [PATCH] macvlan: Support creating macvtaps from macvlans Kevin Wallace
2013-12-03  8:24 ` Michal Kubecek
2013-12-03  9:58   ` Kevin Wallace
2013-12-03 10:55 ` [PATCH v2] " Kevin Wallace
2013-12-03 16:17   ` Vlad Yasevich
2013-12-03 17:46     ` Kevin Wallace
2013-12-03 19:47     ` Michal Kubecek [this message]
2013-12-04 13:59       ` Vlad Yasevich
2013-12-04 14:23         ` Michal Kubecek
2013-12-04 14:57           ` Vlad Yasevich
2013-12-06  0:59   ` 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=20131203194707.GA32367@lion.mk-sys.cz \
    --to=mkubecek@suse$(echo .)cz \
    --cc=kevin@pentabarf$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vyasevich@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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