Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Revendor vishwananda netlink to support index specification #708

Closed
mcastelino opened this issue Oct 10, 2017 · 0 comments
Closed

Revendor vishwananda netlink to support index specification #708

mcastelino opened this issue Oct 10, 2017 · 0 comments
Assignees

Comments

@mcastelino
Copy link
Contributor

Description of problem

We need the ability to specify the index when creating the macvtap interfaces due to a kernel limitation
https://patchwork.ozlabs.org/patch/612683/

When creating macvtaps that are expected to have the same ifindex
in different network namespaces, only the first one will succeed.
The others will fail with a sysfs_warn_dup warning due to them trying
to create the following sysfs link (with 'NN' the ifindex of macvtapX):

/sys/class/macvtap/tapNN -> /sys/devices/virtual/net/macvtapX/tapNN

This is reproducible by running the following commands:

ip netns add ns1
ip netns add ns2
ip link add veth0 type veth peer name veth1
ip link set veth0 netns ns1
ip link set veth1 netns ns2
ip netns exec ns1 ip l add link veth0 macvtap0 type macvtap
ip netns exec ns2 ip l add link veth1 macvtap1 type macvtap

The last command will fail with "RTNETLINK answers: File exists" (along
with the kernel warning) but retrying it will work because the ifindex
was incremented.

The 'net' device class is isolated between network namespaces so each
one has its own hierarchy of net devices.
This isn't the case for the 'macvtap' device class.
The problem occurs half-way through the netdev registration, when
`macvtap_device_event` is called-back to create the 'tapNN' macvtap
class device under the 'macvtapX' net class device.

This patch adds namespace support the the 'macvtap' device class so
that /sys/class/macvtap is no longer shared between net namespaces.

However, doing this has the side effect of changing
/sys/devices/virtual/net/macvtapX/tapNN  into
/sys/devices/virtual/net/macvtapX/macvtap/tapNN

This is due to Commit 24b1442 ("Driver-core: Always create class
directories for classses that support namespaces.")

We need the following PR to land in netlink before we revendor
vishvananda/netlink#283

mcastelino added a commit to mcastelino/runtime that referenced this issue Oct 30, 2017
Revendor netlink and virtcontainers to switch the default
network connection method to use macvtap.

Fixes clearcontainers#708
Fixes clearcontainers#709

Signed-off-by: Manohar Castelino <[email protected]>
jcvenegas added a commit to jcvenegas/cc-runtime that referenced this issue Nov 15, 2017
- version: 18800
  - Changes in package clear-containers-agent (from
  1fa147836736824c32a46889d6fb59402d4e58bd-14 to
  9adc9d49378aa0a19b85d02c447b3eb1e2b87774-14):
    - Jose Carlos Venegas Munoz - new agent version 9adc9d

  https://download.clearlinux.org/releases/18800/clear/RELEASENOTES

- version: 19010
    - Changes in package systemd (from 234-153 to 234-154):
    Miguel Bernal Marin - version bump from 234-153 to 234-154
    Victor Rodriguez - Fix CVE-2017-15908

  https://download.clearlinux.org/releases/19010/clear/RELEASENOTES

  version: 19050
  - Changes in package systemd (from 234-154 to 234-157):
    - Arjan van de Ven - don't do transient hostnames; we set ours already
    - Arjan van de Ven - move vconsole to the console subpackage

  https://download.clearlinux.org/releases/19050/clear/RELEASENOTES

- version: 19060
  - Changes in package clear-containers-agent (from 9adc9d49378aa0a19b85d02c447b3eb1e2b87774-14 to
  243e2aefa4f9ff5a1bd32967a213e8533dab54df-15):
    - Jose Carlos Venegas Munoz - version bump from 243e2aefa4f9ff5a1bd32967a213e8533dab54df-14 to
      243e2aefa4f9ff5a1bd32967a213e8533dab54df-15
     Jose Carlos Venegas Munoz - New agent version 243e2ae

  - Changes in package systemd (from 234-154 to 234-157):
    -Arjan van de Ven - don't do transient hostnames;
      we set ours already Arjan van de Ven - move vconsole to the console subpackage

  https://download.clearlinux.org/releases/19060/clear/RELEASENOTES

Fixes: clearcontainers#708

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
mcastelino pushed a commit to mcastelino/runtime that referenced this issue Dec 6, 2018
Adds per-device VFIO ids allowing IOMMU groups with
multiple devices to be passed to qemu.

Fixes clearcontainers#708

Signed-off-by: Edward Guzman <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants