From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: devel@linuxdriverproject.org, haiyangz@microsoft.com,
sthemmin@microsoft.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 0/1] netvsc: another VF datapath fix
Date: Tue, 08 Aug 2017 17:42:10 +0200 [thread overview]
Message-ID: <87mv7a9ict.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20170808082927.128362aa@xeon-e3> (Stephen Hemminger's message of "Tue, 8 Aug 2017 08:29:27 -0700")
Stephen Hemminger <stephen@networkplumber.org> writes:
> On Tue, 08 Aug 2017 17:24:03 +0200
> Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
>> Stephen Hemminger <stephen@networkplumber.org> writes:
>>
>> > On Tue, 08 Aug 2017 16:03:56 +0200
>> > Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>> >
>> >> Stephen Hemminger <stephen@networkplumber.org> writes:
>> >>
>> >> > Previous fix was incomplete.
>> >> >
>> >>
>> >> Not really related to this patch series (which btw fixes my issue,
>> >> thanks!), but I found one addition issue. Systemd fails to rename VF
>> >> interface:
>> >>
>> >> kernel: mlx4_core 0002:00:02.0 eth2: joined to eth1
>> >> kernel: hv_netvsc 33b7a6f9-6736-451f-8fce-b382eaa50bee eth1: VF registering: eth2
>> >> kernel: hv_netvsc 33b7a6f9-6736-451f-8fce-b382eaa50bee eth1: Data path switched to VF: eth2
>> >> kernel: mlx4_en: eth2: Link Up
>> >> NetworkManager[750]: <info> [1502200557.0821] device (eth2): link connected
>> >> NetworkManager[750]: <info> [1502200557.1004] manager: (eth2): new Ethernet device (/org/freedesktop/NetworkManager/Devices/6)
>> >> systemd-udevd[6942]: Error changing net interface name 'eth2' to 'enP2p0s2': Device or resource busy
>> >> systemd-udevd[6942]: could not rename interface '6' from 'eth2' to 'enP2p0s2': Device or resource busy
>> >>
>> >> With some debug added I figured out what's wrong: __netvsc_vf_setup()
>> >> does dev_open() which sets IFF_UP flag on the interface. When systemd
>> >> tries to rename the interface we get into dev_change_name() and this
>> >> fails with -EBUSY when (dev->flags & IFF_UP).
>> >>
>> >> The issue is of less importance as we're not supposed to configure VF
>> >> interface now. However, we may still want to get a stable name for it.
>> >>
>> >> Any idea how this can be fixed?
>> >
>> > The problem is Network Manager should ignore the VF device. I don't run NM on these
>> > interfaces because it causes more issues than it helps (dueling userspace).
>> >
>> > The driver needs to have slave track the master interface. Relying on userspace
>> > to bring interface up leads to all the issues the bonding script had.
>> >
>> > One option would be to delay the work of bringing up the slave device to allow
>> > small window for renaming to run.
>>
>> Actually, I tried removing 'if (dev->flags & IFF_UP)' check from
>> dev_change_name() and everything seems to work fine. The history of this
>> code predates git so I have no idea why it's forbiden to change names of
>> IFF_UP interfaces... I can send an RFC removing the check to figure out
>> the truth :-)
>
> That only works because NM by default brings everything up.
> Many users don't use NM on servers.
I'm not sure NetworkManager is related here: renaming is done by
systemd/udev according to the "predictable interface names" scheme:
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
Basically, systemd/udev tries to rename all new interfaces in the system
according to this scheme. And systemd/udev is ubiquitous nowdays.
I tried disabling NetworkManager in my VM and the behavior is not any
different:
kernel: mlx4_core 0002:00:02.0 eth2: joined to eth1
kernel: hv_netvsc 33b7a6f9-6736-451f-8fce-b382eaa50bee eth1: VF registering: eth2
kernel: mlx4_en: eth2: Link Up
kernel: hv_netvsc 33b7a6f9-6736-451f-8fce-b382eaa50bee eth1: Data path switched to VF: eth2
systemd-udevd[1785]: Error changing net interface name 'eth2' to 'enP2p0s2': Device or resource busy
systemd-udevd[1785]: could not rename interface '5' from 'eth2' to 'enP2p0s2': Device or resource busy
The 'if (dev->flags & IFF_UP)' check in dev_change_name() function
I mentioned prevents renaming interfaces which are already up but I
don't know an obvious reason for it to exist.
--
Vitaly
next prev parent reply other threads:[~2017-08-08 15:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 18:29 [PATCH net-next 0/1] netvsc: another VF datapath fix Stephen Hemminger
2017-08-07 18:30 ` [PATCH net-next 1/1] netvsc: make sure and unregister datapath Stephen Hemminger
2017-08-09 1:10 ` David Miller
2017-08-08 14:03 ` [PATCH net-next 0/1] netvsc: another VF datapath fix Vitaly Kuznetsov
2017-08-08 15:15 ` Stephen Hemminger
2017-08-08 15:24 ` Vitaly Kuznetsov
2017-08-08 15:29 ` Stephen Hemminger
2017-08-08 15:42 ` Vitaly Kuznetsov [this message]
2017-08-08 15:53 ` Stephen Hemminger
2017-08-09 9:03 ` Vitaly Kuznetsov
2017-08-09 14:41 ` Stephen Hemminger
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=87mv7a9ict.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=sthemmin@microsoft.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.