From: Veaceslav Falico <vfalico@redhat.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: nhorman@tuxdriver.com, netdev@vger.kernel.org
Subject: Re: [net-next PATCH] macvlan: resolve ENOENT errors on creation
Date: Mon, 21 Oct 2013 23:34:41 +0200 [thread overview]
Message-ID: <20131021213441.GB18170@redhat.com> (raw)
In-Reply-To: <20131021212801.19330.69659.stgit@nitbit.x32>
On Mon, Oct 21, 2013 at 02:28:02PM -0700, John Fastabend wrote:
>After the commit below attempting to create macvlan devices was
>resulting in ENOENT errors,
>
># ip link add link p3p2 type macvlan
>RTNETLINK answers: Invalid argument
>
>This happens because netdev_upper_dev_link() is called before
>register_netdevice() in the macvlan code. Through a call chain
>this results in a call to __netdev_adjacent_dev_insert() and
>finally a sysfs_create_link(). This requires the kobject of
>the macvlan to be registered which is done in register_netdevice().
>If there is no kobject which is the case here the ENOENT error
>is seen on the command line.
>
>To resolve this move the netdev_upper_dev_link() call below
>the register_netdevice() call. This aligns with vlan driver
>flow.
Yep, changed the vlan code, but didn't see the macvlan. My cscope didn't
catch it for some reason :-/.
I've also checked - there are no users except bonding, vlan (both are ok),
and macvlan.
Acked-by: Veaceslav Falico <vfalico@redhat.com>
>
>Regression introduced here,
>
>commit 5831d66e8097aedfa3bc35941cf265ada2352317
>Author: Veaceslav Falico <vfalico@redhat.com>
>Date: Wed Sep 25 09:20:32 2013 +0200
>
> net: create sysfs symlinks for neighbour devices
>
>CC: Veaceslav Falico <vfalico@redhat.com>
>CC: Neil Horman <nhorman@tuxdriver.com>
>Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>---
> drivers/net/macvlan.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
>index 9bf46bd..cc9845e 100644
>--- a/drivers/net/macvlan.c
>+++ b/drivers/net/macvlan.c
>@@ -828,22 +828,21 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
> eth_hw_addr_inherit(dev, lowerdev);
> }
>
>+ port->count += 1;
>+ err = register_netdevice(dev);
>+ if (err < 0)
>+ goto destroy_port;
>+
> err = netdev_upper_dev_link(lowerdev, dev);
> if (err)
> goto destroy_port;
>
>- port->count += 1;
>- err = register_netdevice(dev);
>- if (err < 0)
>- goto upper_dev_unlink;
>
> list_add_tail_rcu(&vlan->list, &port->vlans);
> netif_stacked_transfer_operstate(lowerdev, dev);
>
> return 0;
>
>-upper_dev_unlink:
>- netdev_upper_dev_unlink(lowerdev, dev);
> destroy_port:
> port->count -= 1;
> if (!port->count)
>
next prev parent reply other threads:[~2013-10-21 21:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 21:28 [net-next PATCH] macvlan: resolve ENOENT errors on creation John Fastabend
2013-10-21 21:34 ` Veaceslav Falico [this message]
2013-10-21 21:48 ` John Fastabend
2013-10-21 22:05 ` Veaceslav Falico
2013-10-21 21:54 ` Neil Horman
2013-10-22 23:23 ` 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=20131021213441.GB18170@redhat.com \
--to=vfalico@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox