Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1707263 > unrolled thread
| Started by | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| First post | 2017-08-09 12:50 +0200 |
| Last post | 2017-08-10 16:20 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH RFC net-next] net: Allow name change of IFF_UP interfaces Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-08-09 12:50 +0200
Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces 吉藤英明 <hideaki.yoshifuji@miraclelinux.com> - 2017-08-09 14:40 +0200
Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-08-09 17:10 +0200
Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces Andrew Lunn <andrew@lunn.ch> - 2017-08-09 18:20 +0200
Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-08-10 10:50 +0200
Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces Andrew Lunn <andrew@lunn.ch> - 2017-08-10 16:20 +0200
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Date | 2017-08-09 12:50 +0200 |
| Subject | [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces |
| Message-ID | <ucwIN-5WY-3@gated-at.bofh.it> |
Recent 'transparenf VF' changes to netvsc driver made VF interfaces register as netvsc interface slaves upon appearance. This led to udev not being able to rename the interface according to the 'predictable interface names' scheme: 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 What happens is: __netvsc_vf_setup() does dev_open() for the VF device and the consecutive dev_change_name() fails with -EBUSY because of the (dev->flags & IFF_UP) check. The history of this code predates git so I wasn't able to figure out when and why the check was added, everything seems to work fine without it. dev_change_name() has only two call sites, both hold rtnl_lock. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- RFC: I'm probably miossing something obvious and the check can't be just dropped. Stephen suggested a different solution to the isuue: https://www.spinics.net/lists/netdev/msg448243.html but it has its own drawbacks. --- net/core/dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 1d75499add72..c608e233a78a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1186,8 +1186,6 @@ int dev_change_name(struct net_device *dev, const char *newname) BUG_ON(!dev_net(dev)); net = dev_net(dev); - if (dev->flags & IFF_UP) - return -EBUSY; write_seqcount_begin(&devnet_rename_seq); -- 2.13.4
[toc] | [next] | [standalone]
| From | 吉藤英明 <hideaki.yoshifuji@miraclelinux.com> |
|---|---|
| Date | 2017-08-09 14:40 +0200 |
| Message-ID | <ucyrf-733-13@gated-at.bofh.it> |
| In reply to | #1707263 |
2017-08-09 19:42 GMT+09:00 Vitaly Kuznetsov <vkuznets@redhat.com>: > What happens is: __netvsc_vf_setup() does dev_open() for the VF device and > the consecutive dev_change_name() fails with -EBUSY because of the > (dev->flags & IFF_UP) check. The history of this code predates git so I > wasn't able to figure out when and why the check was added, everything > seems to work fine without it. dev_change_name() has only two call sites, > both hold rtnl_lock. > > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> > --- > RFC: I'm probably miossing something obvious and the check can't be just > dropped. Stephen suggested a different solution to the isuue: > https://www.spinics.net/lists/netdev/msg448243.html but it has its own > drawbacks. > --- > net/core/dev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 1d75499add72..c608e233a78a 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1186,8 +1186,6 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > - return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); I think people expect the name won't change while up and I don't think it is a good idea to allow changing the name while the interface is up. --yoshfuji > > -- > 2.13.4 >
[toc] | [prev] | [next] | [standalone]
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Date | 2017-08-09 17:10 +0200 |
| Message-ID | <ucAMr-D4-33@gated-at.bofh.it> |
| In reply to | #1707312 |
吉藤英明 <hideaki.yoshifuji@miraclelinux.com> writes: > 2017-08-09 19:42 GMT+09:00 Vitaly Kuznetsov <vkuznets@redhat.com>: >> What happens is: __netvsc_vf_setup() does dev_open() for the VF device and >> the consecutive dev_change_name() fails with -EBUSY because of the >> (dev->flags & IFF_UP) check. The history of this code predates git so I >> wasn't able to figure out when and why the check was added, everything >> seems to work fine without it. dev_change_name() has only two call sites, >> both hold rtnl_lock. >> >> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> >> --- >> RFC: I'm probably miossing something obvious and the check can't be just >> dropped. Stephen suggested a different solution to the isuue: >> https://www.spinics.net/lists/netdev/msg448243.html but it has its own >> drawbacks. >> --- >> net/core/dev.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/net/core/dev.c b/net/core/dev.c >> index 1d75499add72..c608e233a78a 100644 >> --- a/net/core/dev.c >> +++ b/net/core/dev.c >> @@ -1186,8 +1186,6 @@ int dev_change_name(struct net_device *dev, const char *newname) >> BUG_ON(!dev_net(dev)); >> >> net = dev_net(dev); >> - if (dev->flags & IFF_UP) >> - return -EBUSY; >> >> write_seqcount_begin(&devnet_rename_seq); > > I think people expect the name won't change while up > and I don't think it is a good idea to allow changing the > name while the interface is up. I understand the 'legacy' concern but at the same time we don't want to have aftificial limitations too. Name change, in particular, doesn't happen 'under the hood' -- someone privileged enough needs to request the change. Can you think of any particular real world scenarios which are broken by the change? -- Vitaly
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-08-09 18:20 +0200 |
| Message-ID | <ucBSa-1ep-15@gated-at.bofh.it> |
| In reply to | #1707403 |
> I understand the 'legacy' concern but at the same time we don't want to
> have aftificial limitations too. Name change, in particular, doesn't
> happen 'under the hood' -- someone privileged enough needs to request
> the change.
>
> Can you think of any particular real world scenarios which are broken by
> the change?
How about:
man 8 dhclient-script
The interface name is passed in $interface to the scripts. Do we get
the old name or the new name? I suspect scripts are going to break if
they are given the old name, which no longer exists.
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Date | 2017-08-10 10:50 +0200 |
| Message-ID | <ucRke-2YH-7@gated-at.bofh.it> |
| In reply to | #1707450 |
Andrew Lunn <andrew@lunn.ch> writes: >> I understand the 'legacy' concern but at the same time we don't want to >> have aftificial limitations too. Name change, in particular, doesn't >> happen 'under the hood' -- someone privileged enough needs to request >> the change. >> >> Can you think of any particular real world scenarios which are broken by >> the change? > > How about: > > man 8 dhclient-script > > The interface name is passed in $interface to the scripts. Do we get > the old name or the new name? I suspect scripts are going to break if > they are given the old name, which no longer exists. Yes but why would anyone change interface name while dhclient-script is running? Things will also go wrong if you try bringing interface down during the run or do some other configuration, right? Running multiple configuration tools at the same moment is a bad idea, you never know what you're gonna end up with. As I see it, checks in kernel we have are meant to protect kernel itself, not to disallow all user<->kernel interactions leading to imperfect result. (AFAIU) If we remove the check nothing is going to change: udev will still be renaming interfaces before bringing them up. In netvsc case users are not supposed to configure the VF interface at all, it just becomes a slave of netvsc interface. -- Vitaly
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-08-10 16:20 +0200 |
| Message-ID | <ucWtz-6Ow-1@gated-at.bofh.it> |
| In reply to | #1708325 |
> >> Can you think of any particular real world scenarios which are broken by > >> the change? > > > > How about: > > > > man 8 dhclient-script > > > > The interface name is passed in $interface to the scripts. Do we get > > the old name or the new name? I suspect scripts are going to break if > > they are given the old name, which no longer exists. > > Yes but why would anyone change interface name while dhclient-script is > running? Things will also go wrong if you try bringing interface down > during the run or do some other configuration, right? dhclient already handles the interface going down. sendto/recvfrom fails and returns an error code. As far as i remember, dhclient then exits. > Running multiple configuration tools at the same moment is a bad > idea, you never know what you're gonna end up with. It could be argued that configuring an interface vs renaming an interface are at different levels. Andrew
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web