All of lore.kernel.org
 help / color / mirror / Atom feed
From: Veaceslav Falico <vfalico@redhat.com>
To: Nikolay Aleksandrov <nikolay@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, fubar@us.ibm.com,
	jhs@mojatatu.com
Subject: Re: [PATCH net 1/2] vlan: make vlan_dev_real_dev work over stacked vlans
Date: Sat, 3 Aug 2013 22:11:54 +0200	[thread overview]
Message-ID: <20130803201154.GC12638@redhat.com> (raw)
In-Reply-To: <1375560467-1604-1-git-send-email-nikolay@redhat.com>

On Sat, Aug 03, 2013 at 10:07:46PM +0200, Nikolay Aleksandrov wrote:
>From: Nikolay Aleksandrov <Nikolay Aleksandrov nikolay@redhat.com>
>
>Sometimes we might have stacked vlans on top of each other, and we're
>interested in the first non-vlan real device on the path, so transform
>vlan_dev_real_dev to go over the stacked vlans and extract the first
>non-vlan device.
>
>Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>

>---
> net/8021q/vlan_core.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
>index 4a78c4d..6ee48aa 100644
>--- a/net/8021q/vlan_core.c
>+++ b/net/8021q/vlan_core.c
>@@ -91,7 +91,12 @@ EXPORT_SYMBOL(__vlan_find_dev_deep);
>
> struct net_device *vlan_dev_real_dev(const struct net_device *dev)
> {
>-	return vlan_dev_priv(dev)->real_dev;
>+	struct net_device *ret = vlan_dev_priv(dev)->real_dev;
>+
>+	while (is_vlan_dev(ret))
>+		ret = vlan_dev_priv(ret)->real_dev;
>+
>+	return ret;
> }
> EXPORT_SYMBOL(vlan_dev_real_dev);
>
>-- 
>1.8.1.4
>

  parent reply	other threads:[~2013-08-03 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03 20:07 [PATCH net 1/2] vlan: make vlan_dev_real_dev work over stacked vlans Nikolay Aleksandrov
2013-08-03 20:07 ` [PATCH net v2 2/2] net_sched: make dev_trans_start return vlan's real dev trans_start Nikolay Aleksandrov
2013-08-03 20:12   ` Veaceslav Falico
2013-08-05 19:18   ` David Miller
2013-08-03 20:11 ` Veaceslav Falico [this message]
2013-08-04  2:17 ` [PATCH net 1/2] vlan: make vlan_dev_real_dev work over stacked vlans Nikolay Aleksandrov
2013-08-05  6:58   ` Veaceslav Falico
2013-08-05  8:12     ` Nikolay Aleksandrov
2013-08-05 19:18 ` 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=20130803201154.GC12638@redhat.com \
    --to=vfalico@redhat.com \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.