Skip to contentSkip to conversation

Net containers config and usage

DISCUSSION [email protected] 5 participants 22 messages Jan 12, 2009 – Jan 16, 2009 17 messages not in the archive

lore
Share & tools
lore
#0 lore raw

All,

I'm new to linux containers and am interested in the network containers
support, but am having some troubles getting it working & could use some help.

I saw that the code released to 2.6.26 was incompatible with sysfs, but
that 2.6.29 should have support for both.

So, I built:

    linux-2.6.29-rc1
    iproute2.2.6.25 plus the patch for containers support
    lxc-0.5.2

I can now run lxc-unshare -n /bin/tcsh And, as expected, that process only sees loopback.

But I'm having trouble assigning an interface over to that container.

I tried doing:

     # echo <pid> > /sys/class/net/eth4/new_ns_pid

But there are no entries in sysfs called new_ns_pid.

I also tried doing ip link set eth4 newns <pid>
but I get a netlink error:
RTNETLINK answers: Invalid argument

Any tips on what I might be doing wrong, or how to get this working? Since I can do the lxc-unshare, it seems like I'm part way there, but can't move network devices between namespaces.

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · Quoting [email protected]…

All,

I'm new to linux containers and am interested in the network containers
support, but am having some troubles getting it working & could use some help.

I saw that the code released to 2.6.26 was incompatible with sysfs, but
that 2.6.29 should have support for both.

Quoted 7 lines

So, I built:

    linux-2.6.29-rc1
    iproute2.2.6.25 plus the patch for containers support
    lxc-0.5.2

I can now run lxc-unshare -n /bin/tcsh And, as expected, that process only sees loopback.

Since you're using the liblxc tools, can you just use one of the configs it comes with which sets up networking for you?

Quoted 6 lines

But I'm having trouble assigning an interface over to that container.

I tried doing:

     # echo <pid> > /sys/class/net/eth4/new_ns_pid

But there are no entries in sysfs called new_ns_pid.

Yeah I'm not sure where that command came from. To move eth4 into a new netns, you'd want to do

ip link set eth4 netns $pid_of_shell_in_ns

See http://lxc.sourceforge.net/network/configuration.php for more info.

Quoted 8 lines

I also tried doing ip link set eth4 newns <pid>
but I get a netlink error:
RTNETLINK answers: Invalid argument

Any tips on what I might be doing wrong, or how to get this working? Since I can do the lxc-unshare, it seems like I'm part way there, but can't move network devices between namespaces.

-serge

A message that is not in the archive (sent off-list or not yet received): 20090112225140.GA29834-r/[email protected]

#4 lore raw
Quoted 9 lines · Serge E. Hallyn
Quoted 7 lines

But I'm having trouble assigning an interface over to that container.

I tried doing:

     # echo <pid> > /sys/class/net/eth4/new_ns_pid

But there are no entries in sysfs called new_ns_pid.

Yeah I'm not sure where that command came from.

OK - just FYI, I got that command from http://lxc.sourceforge.net/network.php

Quoted 8 lines

To move eth4 into a new
netns, you'd want to do

ip link set eth4 netns $pid_of_shell_in_ns

See http://lxc.sourceforge.net/network/configuration.php for more info.

Trying to use the "ip link set" command, I get a different problem - it reports an RTNETLINK error:

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Any idea what could cause that error?

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Serge E. Hallyn
Quoted 5 lines

But I'm having trouble assigning an interface over to that container.

I tried doing:

     # echo <pid> > /sys/class/net/eth4/new_ns_pid
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

But there are no entries in sysfs called new_ns_pid.

Yeah I'm not sure where that command came from.

OK - just FYI, I got that command from http://lxc.sourceforge.net/network.php

You are right, it is not up-to-date.

Quoted 14 lines
Quoted 10 lines

To move eth4 into a new
netns, you'd want to do

ip link set eth4 netns $pid_of_shell_in_ns

See http://lxc.sourceforge.net/network/configuration.php for more info.

Trying to use the "ip link set" command, I get a different problem - it reports an RTNETLINK error:

Quoted 8 lines

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Any idea what could cause that error?

Assuming your prompt is showing the right version, try a version of iproute2 >= 2.6.26

Regards
-- Daniel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 36 lines · Daniel Lezcano
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Serge E. Hallyn
Quoted 5 lines

But I'm having trouble assigning an interface over to that container.

I tried doing:

     # echo <pid> > /sys/class/net/eth4/new_ns_pid
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

But there are no entries in sysfs called new_ns_pid.

Yeah I'm not sure where that command came from.

OK - just FYI, I got that command from http://lxc.sourceforge.net/network.php

You are right, it is not up-to-date.

Quoted 20 lines
Quoted 10 lines

To move eth4 into a new
netns, you'd want to do

ip link set eth4 netns $pid_of_shell_in_ns

See http://lxc.sourceforge.net/network/configuration.php for more info.

Trying to use the "ip link set" command, I get a different problem - it reports an RTNETLINK error:

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Quoted 4 lines
Quoted 2 lines

Any idea what could cause that error?

Assuming your prompt is showing the right version, try a version of iproute2 >= 2.6.26

Right, this was a bit of a pain for me - when you install iproute, by default it goes into another location, so you probably have to specify /usr/local/sbin/ip or something. Just a guess, but that may be your problem here :)

-serge

A message that is not in the archive (sent off-list or not yet received): 20090113142925.GA11767-r/[email protected]

#10 lore raw
Quoted 12 lines
Quoted 11 lines
Quoted 9 lines

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Any idea what could cause that error?

Assuming your prompt is showing the right version, try a version of iproute2 >= 2.6.26

Quoted 6 lines

Right, this was a bit of a pain for me - when you install iproute, by default it goes into another location, so you probably have to specify /usr/local/sbin/ip or something. Just a guess, but that may be your problem here :)

-serge

I was running 2.6.25 plus the patch from here:

    http://marc.info/?l=linux-netdev&m=120905226611742&q=raw

But I tried getting 2.6.26 and I have the same problem:

[root@C100273 iproute2-2.6.26]# ip/ip link set eth4 netns 24755 RTNETLINK answers: Invalid argument

I'm pretty certain I'm running the right "version" of the command. It does install it to /usr/sbin/ip, but if I run the version that came with the distribution (in /sbin/ip), I get a different error reporting netns as garbage. So.. since it at least parses the netns argument and sends the netlink request, it at least seems to be making it to the kernel.

Does the kernel.org version of 2.6.29-rc1 have everything I need?

Any other ideas?

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Works for me in 2.6.27.
Did you enable network namespace support in the kernel ?

Guenter

Quoted 43 lines · On Tue, 2009-01-13 at 11:18 -0800, [email protected]…
Quoted 12 lines
Quoted 11 lines
Quoted 9 lines

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Any idea what could cause that error?

Assuming your prompt is showing the right version, try a version of iproute2 >= 2.6.26

Quoted 6 lines

Right, this was a bit of a pain for me - when you install iproute, by default it goes into another location, so you probably have to specify /usr/local/sbin/ip or something. Just a guess, but that may be your problem here :)

-serge

I was running 2.6.25 plus the patch from here:

    http://marc.info/?l=linux-netdev&m=120905226611742&q=raw

But I tried getting 2.6.26 and I have the same problem:

[root@C100273 iproute2-2.6.26]# ip/ip link set eth4 netns 24755 RTNETLINK answers: Invalid argument

I'm pretty certain I'm running the right "version" of the command. It does install it to /usr/sbin/ip, but if I run the version that came with the distribution (in /sbin/ip), I get a different error reporting netns as garbage. So.. since it at least parses the netns argument and sends the netlink request, it at least seems to be making it to the kernel.

Does the kernel.org version of 2.6.29-rc1 have everything I need?

Any other ideas?

Thanks,
Chris
_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

#13 lore raw
Quoted 4 lines · Guenter Roeck

Works for me in 2.6.27.
Did you enable network namespace support in the kernel ?

Guenter

Yes, and I'm able to do an "lxc-unshare -n /bin/tcsh", so I guess that's proof that network namespace support is there in the kernel. But then when I go to re-assign an interface, I get the error.

Chris

#14 lore raw
In reply to a message not in the archive
Quoted 34 lines · [email protected] wrote:
Quoted 12 lines
Quoted 6 lines
Quoted 6 lines

[root@C100273 iproute2-2.6.25]# ps aux | grep tcsh

 root     21918  0.0  0.0  71036  2084 pts/1    S+   16:47   0:00 -bin/tcsh
 root     22008  0.0  0.0  61144   716 pts/2    R+   16:57   0:00 grep tcsh

[root@C100273 iproute2-2.6.25]# ip/ip link set eth4 netns 21918 RTNETLINK answers: Invalid argument

Quoted 6 lines
Quoted 3 lines

Any idea what could cause that error?

Assuming your prompt is showing the right version, try a version of iproute2 >= 2.6.26

Quoted 7 lines

Right, this was a bit of a pain for me - when you install iproute, by default it goes into another location, so you probably have to specify /usr/local/sbin/ip or something. Just a guess, but that may be your problem here :)

-serge

I was running 2.6.25 plus the patch from here:

    http://marc.info/?l=linux-netdev&m=120905226611742&q=raw

But I tried getting 2.6.26 and I have the same problem:

[root@C100273 iproute2-2.6.26]# ip/ip link set eth4 netns 24755 RTNETLINK answers: Invalid argument

I'm pretty certain I'm running the right "version" of the command. It does install it to /usr/sbin/ip, but if I run the version that came with the distribution (in /sbin/ip), I get a different error reporting netns as garbage. So.. since it at least parses the netns argument and sends the netlink request, it at least seems to be making it to the kernel.

Quoted 4 lines

Does the kernel.org version of 2.6.29-rc1 have everything I need?

Any other ideas?

Is eth4 a physical network device or a virtual device (like a tunnel) renamed eth4 ?

Can you send the output of the "ip link" command and the value of /sys/class/net/eth4/features to check if the network device is not flagged as a non-movable.

thanks.
-- Daniel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 21 lines · Daniel Lezcano
Quoted 14 lines

I tried getting 2.6.26 and I have the same problem:

[root@C100273 iproute2-2.6.26]# ip/ip link set eth4 netns 24755 RTNETLINK answers: Invalid argument

I'm pretty certain I'm running the right "version" of the command. It does install it to /usr/sbin/ip, but if I run the version that came with the
distribution (in /sbin/ip), I get a different error reporting netns as garbage.
So.. since it at least parses the netns argument and sends the netlink request,
it at least seems to be making it to the kernel.

Quoted 4 lines

Does the kernel.org version of 2.6.29-rc1 have everything I need?

Any other ideas?

Is eth4 a physical network device or a virtual device (like a tunnel) renamed eth4 ?

Quoted 6 lines

Can you send the output of the "ip link" command and the value of /sys/class/net/eth4/features to check if the network device is not flagged as a non-movable.

thanks.
-- Daniel

It's a physical device - uses the e1000e driver.
Here's the output of both commands.

[root@C100273 iproute2-2.6.26]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1c:c4:dc:44:b2 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f5 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:dc:44:b0 brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f4 brd ff:ff:ff:ff:ff:ff
6: eth4: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1c:c4:48:35:f7 brd ff:ff:ff:ff:ff:ff
7: eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f6 brd ff:ff:ff:ff:ff:ff
8: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue 
    link/ether 66:f4:32:9f:12:df brd ff:ff:ff:ff:ff:ff

[root@C100273 iproute2-2.6.26]# cat /sys/class/net/eth4/features 0x111ba9

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#18 lore raw

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Quoted 59 lines · On Tue, 2009-01-13 at 13:47 -0800, [email protected]…
Quoted 21 lines · Daniel Lezcano
Quoted 14 lines

I tried getting 2.6.26 and I have the same problem:

[root@C100273 iproute2-2.6.26]# ip/ip link set eth4 netns 24755 RTNETLINK answers: Invalid argument

I'm pretty certain I'm running the right "version" of the command. It does install it to /usr/sbin/ip, but if I run the version that came with the
distribution (in /sbin/ip), I get a different error reporting netns as garbage.
So.. since it at least parses the netns argument and sends the netlink request,
it at least seems to be making it to the kernel.

Quoted 4 lines

Does the kernel.org version of 2.6.29-rc1 have everything I need?

Any other ideas?

Is eth4 a physical network device or a virtual device (like a tunnel) renamed eth4 ?

Quoted 6 lines

Can you send the output of the "ip link" command and the value of /sys/class/net/eth4/features to check if the network device is not flagged as a non-movable.

thanks.
-- Daniel

It's a physical device - uses the e1000e driver.
Here's the output of both commands.

[root@C100273 iproute2-2.6.26]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1c:c4:dc:44:b2 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f5 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:dc:44:b0 brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f4 brd ff:ff:ff:ff:ff:ff
6: eth4: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1c:c4:48:35:f7 brd ff:ff:ff:ff:ff:ff
7: eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1c:c4:48:35:f6 brd ff:ff:ff:ff:ff:ff
8: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
    link/ether 66:f4:32:9f:12:df brd ff:ff:ff:ff:ff:ff

[root@C100273 iproute2-2.6.26]# cat /sys/class/net/eth4/features 0x111ba9

Thanks,
Chris
_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

#19 lore raw
Quoted 6 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw
Quoted 16 lines · Daniel Lezcano
Quoted 6 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

Quoted 5 lines

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will be added in the upstream?

Thanks again,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw
Quoted 23 lines · [email protected] wrote:
Quoted 21 lines · Daniel Lezcano
Quoted 7 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

Quoted 7 lines
Quoted 3 lines

-- Daniel

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will

The sysfs per namespace has been rejected because of some design problems related with the sysfs itself.
Perhaps Eric can tell more about that...

A message that is not in the archive (sent off-list or not yet received): [email protected]

#25 lore raw
Quoted 28 lines · Daniel Lezcano
Quoted 27 lines · [email protected] wrote:
Quoted 24 lines · Daniel Lezcano
Quoted 7 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

Quoted 6 lines
Quoted 3 lines

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will

The sysfs per namespace has been rejected because of some design problems related with the sysfs itself.
Perhaps Eric can tell more about that...

Chris, in the meantime, is using the physical device an absolute necessity, or could you work around it for now using a veth tunnel?

Even if Eric has been working on the sysfs locking rework quietly the last few months, i'd expect several months of back-and-forth trying to prove that the rework is correct...

-serge

A message that is not in the archive (sent off-list or not yet received): 20090114192633.GA8572-r/[email protected]

#27 lore raw
Quoted 36 lines · Serge E. Hallyn
Quoted 28 lines · Daniel Lezcano
Quoted 27 lines · [email protected] wrote:
Quoted 24 lines · Daniel Lezcano
Quoted 7 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

Quoted 6 lines
Quoted 3 lines

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will

The sysfs per namespace has been rejected because of some design problems related with the sysfs itself.
Perhaps Eric can tell more about that...

Quoted 8 lines

Chris, in the meantime, is using the physical device an absolute necessity, or could you work around it for now using a veth tunnel?

Even if Eric has been working on the sysfs locking rework quietly the last few months, i'd expect several months of back-and-forth trying to prove that the rework is correct...

-serge

Yes, ultimately we'll need the physical device inside the same namespace as our application. Our application does a lot of management on the interface, monitoring things like the interface's link-pulse and such, and that wouldn't be available through a virtual interface. We can always redesign things to have the management portion run in the namespace with the physical interface, but for performance reasons we'd eventually want the physical interface to be directly inside the namespace anyway - so that would probably be wasted effort.

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#29 lore raw
Quoted 54 lines · [email protected] wrote:
Quoted 42 lines · Serge E. Hallyn
Quoted 32 lines · Daniel Lezcano
Quoted 30 lines · [email protected] wrote:
Quoted 27 lines · Daniel Lezcano
Quoted 8 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel. This restriction will be set until the sysfs per namespace is fully supported.

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

Quoted 8 lines
Quoted 4 lines

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will

The sysfs per namespace has been rejected because of some design problems related with the sysfs itself.
Perhaps Eric can tell more about that...

Quoted 9 lines

Chris, in the meantime, is using the physical device an absolute necessity, or could you work around it for now using a veth tunnel?

Even if Eric has been working on the sysfs locking rework quietly the last few months, i'd expect several months of back-and-forth trying to prove that the rework is correct...

-serge

Quoted 8 lines

Yes, ultimately we'll need the physical device inside the same namespace as our application. Our application does a lot of management on the interface, monitoring things like the interface's link-pulse and such, and that wouldn't be available through a virtual interface. We can always redesign things to have the management portion run in the namespace with the physical interface, but for performance reasons we'd eventually want the physical interface to be directly inside the namespace anyway - so that would probably be wasted effort.

Did you tried with the macvlan ?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#31 lore raw
Quoted 14 lines
Quoted 14 lines

Yes, ultimately we'll need the physical device inside the same namespace as our application. Our application does a lot of management on the interface,
monitoring things like the interface's link-pulse and such, and that wouldn't
be available through a virtual interface. We can always redesign things to have the management portion run in the namespace with the physical interface,
but for performance reasons we'd eventually want the physical interface to be
directly inside the namespace anyway - so that would probably be wasted effort.

Quoted 1 line

Did you tried with the macvlan ?

I just tried it - and it does work - I can move the vlan interfaces into the
namespace. But that's not a solution for us - we really need to support
communications out to other nodes on the network that we can't count on using vlan.

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#33 lore raw
Quoted 14 lines · [email protected] wrote:
Quoted 14 lines
Quoted 14 lines

Yes, ultimately we'll need the physical device inside the same namespace as our application. Our application does a lot of management on the interface,
monitoring things like the interface's link-pulse and such, and that wouldn't
be available through a virtual interface. We can always redesign things to have the management portion run in the namespace with the physical interface,
but for performance reasons we'd eventually want the physical interface to be
directly inside the namespace anyway - so that would probably be wasted effort.

Quoted 8 lines
Quoted 2 lines

Did you tried with the macvlan ?

I just tried it - and it does work - I can move the vlan interfaces into the
namespace. But that's not a solution for us - we really need to support
communications out to other nodes on the network that we can't count on using vlan.

Perhaps I am misunderstand but the macvlan is just an "eth aliased" interface, so you should but able to communicate with the outside world and keep the same performances as the physical device, no ? The only drawback with the macvlan is you can not communicate on the same host between different namespaces. We did some benchmark last year wih the macvlan and we got very good results.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#35 lore raw
Quoted 11 lines · Daniel Lezcano
Quoted 10 lines · [email protected] wrote:
Quoted 2 lines

Did you tried with the macvlan ?

I just tried it - and it does work - I can move the vlan interfaces into the
namespace. But that's not a solution for us - we really need to support
communications out to other nodes on the network that we can't count on using
vlan.

Quoted 6 lines

Perhaps I am misunderstand but the macvlan is just an "eth aliased" interface, so you should but able to communicate with the outside world and keep the same performances as the physical device, no ? The only drawback with the macvlan is you can not communicate on the same host between different namespaces. We did some benchmark last year wih the macvlan and we got very good results.

Oh great, I confused the macvlan support with 802.1q vlan interfaces (as added through vconfig). macvlan does look very promising - I was able to create a macvlan interface and assign it to my namespace - looks pretty good!

Thanks,
Chris

A message that is not in the archive (sent off-list or not yet received): [email protected]

#37 lore raw
Quoted 12 lines · Chris R. Jones
Quoted 11 lines · Daniel Lezcano
Quoted 10 lines · [email protected] wrote:
Quoted 2 lines

Did you tried with the macvlan ?

I just tried it - and it does work - I can move the vlan interfaces into the
namespace. But that's not a solution for us - we really need to support
communications out to other nodes on the network that we can't count on using
vlan.

Quoted 5 lines
Quoted 5 lines

Perhaps I am misunderstand but the macvlan is just an "eth aliased" interface, so you should but able to communicate with the outside world and keep the same performances as the physical device, no ? The only drawback with the macvlan is you can not communicate on the same host between different namespaces.

And that drawback (when all the macvlan are off of the same network device is actually a bug).

Quoted 6 lines

We did some benchmark last year wih the

Quoted 1 line

macvlan and we got very good results.

Oh great, I confused the macvlan support with 802.1q vlan interfaces (as added through vconfig). macvlan does look very promising - I was able to create a macvlan interface and assign it to my namespace - looks pretty good!

Good to hear you have a solution. Putting physical hardware devices in network namespaces is definitely on the todo. But it looks to be a while before we get all of the details sorted out.

Eric

#38 lore raw
In reply to a message not in the archive
Quoted 27 lines · Daniel Lezcano
Quoted 10 lines · [email protected] wrote:
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Guenter Roeck

As far as I recall, if you have sysfs active and use the sysfs patch to let you configure both sysfs and network namespaces, you can only move virtual interfaces into a network namespace.

Guenter

Quoted 7 lines
Quoted 7 lines

Ah ! yes, you are right :)

The current upstream implementation allowing sysfs and netns to coexist together has one restriction, the physical network devices can not be moved if sysfs is enabled in the kernel. This is why Chris can not move the physical network device with this version of the kernel.
This restriction will be set until the sysfs per namespace is fully

supported.

Quoted 8 lines
Quoted 7 lines

This restriction does not exist with with the previous kernel version with the sysfs per namespace patchset.

-- Daniel

Quoted 6 lines
Quoted 3 lines

Ah, great, thanks to all for your help on this.
Do you have any rough estimate when the support for sysfs per namespace will

The sysfs per namespace has been rejected because of some design problems related with the sysfs itself.
Perhaps Eric can tell more about that...

Short version. Before you can change code that is a mess you get the pleasure of cleaning up someone else's mess.

I have seen no viable alternative to sysfs per namespace.

I have something like 22 patches that I hope to start pushing in the next day or two to clean up sysfs, and then when that is done I will come back and see what can be done about the kobject layer and sysfs.

To do all of this right I need to step back and see reworking the sysfs and the kobject layers as worthy goals in and of themselves. Instead of just some barrier in the way of getting network namespaces to work properly.

Eric