* Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
@ 2013-12-06 20:05 Stephen Hemminger
[not found] ` <CAGXs5wXC+eTZD3sXD4zFtkpY8tcU14Kr6AiA9=kugHups_KCHA@mail.gmail.com>
2013-12-16 10:38 ` Helmut Schaa
0 siblings, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2013-12-06 20:05 UTC (permalink / raw)
To: netdev
This isn't a iproute2 bug, it is only reporting what the kernel tells it
Begin forwarded message:
Date: Fri, 6 Dec 2013 00:07:15 -0800
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
https://bugzilla.kernel.org/show_bug.cgi?id=66691
Bug ID: 66691
Summary: iproute2: macvlan: Wrong root device shown if in
different netns
Product: Networking
Version: 2.5
Kernel Version: 3.10
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Other
Assignee: shemminger@linux-foundation.org
Reporter: helmut.schaa@googlemail.com
Regression: No
In the root net namespace if have the following devices:
> ip link
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
link/gre 0.0.0.0 brd 0.0.0.0
[...]
Let's add a macvlan on top of eth0:
> ip link
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
link/gre 0.0.0.0 brd 0.0.0.0
[...]
17: mac0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT group default
link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff
And now lets move it into its own net namespace and list the devices in the new
namespace.
> ip link set mac0 netns myns
> ip netns exec myns ip link
[...]
2: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
link/gre 0.0.0.0 brd 0.0.0.0
[...]
17: mac0@gre0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode
DEFAULT group default
link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff
mac0 shows gre0 as its base device which is not correct. However gre0 has the
same ifindex in the new namespace as eth0 in the root namespace and the ifindex
is used for finding the base device.
commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make ifindex generation
per-net namespace" changed the ifindex generation to only be unique within a
namespace.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
[not found] ` <CAGXs5wXC+eTZD3sXD4zFtkpY8tcU14Kr6AiA9=kugHups_KCHA@mail.gmail.com>
@ 2013-12-07 9:18 ` Kevin Wilson
2013-12-09 8:02 ` Michal Kubecek
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wilson @ 2013-12-07 9:18 UTC (permalink / raw)
To: netdev@vger.kernel.org
Hi,
Shouldn't the macvlan be network nsmespace local device, like the vlan
and VXLAN device (which have NETIF_F_NETNS set)?
When a nework device has the NETIF_F_NETNS flag set, it cannot be
moved from one network namespace to another.
Kevin W.
On Sat, Dec 7, 2013 at 1:38 AM, Kevin Wilson <wkevils@gmail.com> wrote:
> Hi,
> Shouldnt the macvlan be network nsmespace local device, like the vlan and
> vxlan device (which have NETIF_F_NETNS set)?
>
>
> On Friday, December 6, 2013, Stephen Hemminger <stephen@networkplumber.org>
> wrote:
>> This isn't a iproute2 bug, it is only reporting what the kernel tells it
>>
>> Begin forwarded message:
>>
>> Date: Fri, 6 Dec 2013 00:07:15 -0800
>> From: "bugzilla-daemon@bugzilla.kernel.org"
>> <bugzilla-daemon@bugzilla.kernel.org>
>> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
>> Subject: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in
>> different netns
>>
>>
>> https://bugzilla.kernel.org/show_bug.cgi?id=66691
>>
>> Bug ID: 66691
>> Summary: iproute2: macvlan: Wrong root device shown if in
>> different netns
>> Product: Networking
>> Version: 2.5
>> Kernel Version: 3.10
>> Hardware: All
>> OS: Linux
>> Tree: Mainline
>> Status: NEW
>> Severity: normal
>> Priority: P1
>> Component: Other
>> Assignee: shemminger@linux-foundation.org
>> Reporter: helmut.schaa@googlemail.com
>> Regression: No
>>
>> In the root net namespace if have the following devices:
>>
>>> ip link
>> [...]
>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
>> UP
>> mode DEFAULT group default qlen 1000
>> link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>> 3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
>> link/gre 0.0.0.0 brd 0.0.0.0
>> [...]
>>
>> Let's add a macvlan on top of eth0:
>>
>>> ip link
>> [...]
>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
>> UP
>> mode DEFAULT group default qlen 1000
>> link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>> 3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
>> link/gre 0.0.0.0 brd 0.0.0.0
>> [...]
>> 17: mac0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
>> DEFAULT group default
>> link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff
>>
>> And now lets move it into its own net namespace and list the devices in
>> the new
>> namespace.
>>
>>> ip link set mac0 netns myns
>>> ip netns exec myns ip link
>> [...]
>> 2: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default
>> link/gre 0.0.0.0 brd 0.0.0.0
>> [...]
>> 17: mac0@gre0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
>> mode
>> DEFAULT group default
>> link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff
>>
>> mac0 shows gre0 as its base device which is not correct. However gre0 has
>> the
>> same ifindex in the new namespace as eth0 in the root namespace and the
>> ifindex
>> is used for finding the base device.
>>
>> commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make ifindex
>> generation
>> per-net namespace" changed the ifindex generation to only be unique within
>> a
>> namespace.
>>
>> --
>> You are receiving this mail because:
>> You are the assignee for the bug.
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
2013-12-07 9:18 ` Kevin Wilson
@ 2013-12-09 8:02 ` Michal Kubecek
0 siblings, 0 replies; 7+ messages in thread
From: Michal Kubecek @ 2013-12-09 8:02 UTC (permalink / raw)
To: Kevin Wilson; +Cc: netdev@vger.kernel.org
On Sat, Dec 07, 2013 at 11:18:52AM +0200, Kevin Wilson wrote:
> Shouldn't the macvlan be network nsmespace local device, like the vlan
> and VXLAN device (which have NETIF_F_NETNS set)?
> When a nework device has the NETIF_F_NETNS flag set, it cannot be
> moved from one network namespace to another.
I don't think so. A setup where a macvlan is in a different namespace is
used quite often, e.g. to provide a network device to an LXC container.
Michal Kubecek
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
2013-12-06 20:05 Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns Stephen Hemminger
[not found] ` <CAGXs5wXC+eTZD3sXD4zFtkpY8tcU14Kr6AiA9=kugHups_KCHA@mail.gmail.com>
@ 2013-12-16 10:38 ` Helmut Schaa
2013-12-16 10:41 ` Pavel Emelyanov
1 sibling, 1 reply; 7+ messages in thread
From: Helmut Schaa @ 2013-12-16 10:38 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Pavel Emelyanov
On Fri, Dec 6, 2013 at 9:05 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> This isn't a iproute2 bug, it is only reporting what the kernel tells it
But iproute2 assumes that the ifindex is unique within all net
namespaces. This isn't true anymore
after commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make
ifindex generation
per-net namespace".
However, in order to do the right thing iproute2 would have to know
the ifindex of the
link device _and_ its associated netns.
Not sure how to deal with that ...
Helmut
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
2013-12-16 10:38 ` Helmut Schaa
@ 2013-12-16 10:41 ` Pavel Emelyanov
2013-12-16 10:47 ` Helmut Schaa
0 siblings, 1 reply; 7+ messages in thread
From: Pavel Emelyanov @ 2013-12-16 10:41 UTC (permalink / raw)
To: Helmut Schaa; +Cc: Stephen Hemminger, netdev
On 12/16/2013 02:38 PM, Helmut Schaa wrote:
> On Fri, Dec 6, 2013 at 9:05 PM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
>> This isn't a iproute2 bug, it is only reporting what the kernel tells it
>
> But iproute2 assumes that the ifindex is unique within all net
> namespaces. This isn't true anymore
> after commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make
> ifindex generation
> per-net namespace".
>
> However, in order to do the right thing iproute2 would have to know
> the ifindex of the
> link device _and_ its associated netns.
>
> Not sure how to deal with that ...
Helmut, what would you expect to see from "ip netns exec myns ip link"
in case there were no device with ifindex 2 in the myns netns?
> Helmut
> .
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
2013-12-16 10:41 ` Pavel Emelyanov
@ 2013-12-16 10:47 ` Helmut Schaa
2013-12-16 11:01 ` Pavel Emelyanov
0 siblings, 1 reply; 7+ messages in thread
From: Helmut Schaa @ 2013-12-16 10:47 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: Stephen Hemminger, netdev
On Mon, Dec 16, 2013 at 11:41 AM, Pavel Emelyanov <xemul@parallels.com> wrote:
> On 12/16/2013 02:38 PM, Helmut Schaa wrote:
>> On Fri, Dec 6, 2013 at 9:05 PM, Stephen Hemminger
>> <stephen@networkplumber.org> wrote:
>>> This isn't a iproute2 bug, it is only reporting what the kernel tells it
>>
>> But iproute2 assumes that the ifindex is unique within all net
>> namespaces. This isn't true anymore
>> after commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make
>> ifindex generation
>> per-net namespace".
>>
>> However, in order to do the right thing iproute2 would have to know
>> the ifindex of the
>> link device _and_ its associated netns.
>>
>> Not sure how to deal with that ...
>
> Helmut, what would you expect to see from "ip netns exec myns ip link"
> in case there were no device with ifindex 2 in the myns netns?
No idea, maybe something like "mac0@unknown" would be enough to express
that the link dev is not available within this netns.
My point was that it is confusing to show a clearly wrong link device.
Helmut
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
2013-12-16 10:47 ` Helmut Schaa
@ 2013-12-16 11:01 ` Pavel Emelyanov
0 siblings, 0 replies; 7+ messages in thread
From: Pavel Emelyanov @ 2013-12-16 11:01 UTC (permalink / raw)
To: Helmut Schaa, Eric W. Biederman; +Cc: Stephen Hemminger, netdev
On 12/16/2013 02:47 PM, Helmut Schaa wrote:
> On Mon, Dec 16, 2013 at 11:41 AM, Pavel Emelyanov <xemul@parallels.com> wrote:
>> On 12/16/2013 02:38 PM, Helmut Schaa wrote:
>>> On Fri, Dec 6, 2013 at 9:05 PM, Stephen Hemminger
>>> <stephen@networkplumber.org> wrote:
>>>> This isn't a iproute2 bug, it is only reporting what the kernel tells it
>>>
>>> But iproute2 assumes that the ifindex is unique within all net
>>> namespaces. This isn't true anymore
>>> after commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make
>>> ifindex generation
>>> per-net namespace".
>>>
>>> However, in order to do the right thing iproute2 would have to know
>>> the ifindex of the
>>> link device _and_ its associated netns.
>>>
>>> Not sure how to deal with that ...
>>
>> Helmut, what would you expect to see from "ip netns exec myns ip link"
>> in case there were no device with ifindex 2 in the myns netns?
>
> No idea, maybe something like "mac0@unknown" would be enough to express
> that the link dev is not available within this netns.
Actually, I think the problem is deeper. For example, we have a veth device
driver, the devices of that kind always exist in pairs, and one device typically
sits in one namespaces, while the other device -- in another namespace.
Right now, given one veth device, there's no way to find out where its peer is.
This creates certain difficulties for the checkpoint-restore project (CRIU)
I'm working on.
Let me add Eric in a loop to ask for his thoughts about the issue.
> My point was that it is confusing to show a clearly wrong link device.
I totally agree.
> Helmut
Thanks,
Pavel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-16 11:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06 20:05 Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns Stephen Hemminger
[not found] ` <CAGXs5wXC+eTZD3sXD4zFtkpY8tcU14Kr6AiA9=kugHups_KCHA@mail.gmail.com>
2013-12-07 9:18 ` Kevin Wilson
2013-12-09 8:02 ` Michal Kubecek
2013-12-16 10:38 ` Helmut Schaa
2013-12-16 10:41 ` Pavel Emelyanov
2013-12-16 10:47 ` Helmut Schaa
2013-12-16 11:01 ` Pavel Emelyanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).