mbox series

[ovs-dev,0/8] Add minimum network namespace support.

Message ID 20171102190509.2688-1-fbl@redhat.com
Headers show
Series Add minimum network namespace support. | expand

Message

Flavio Leitner Nov. 2, 2017, 7:05 p.m. UTC
Today Open vSwitch doesn't know about network namespaces (netns), but
users are moving internal ports to other namespaces.  Although packets
are still flowing, the daemon fails to find out basic port information,
like if it is UP or DOWN, for instance.

This patchset rely on a new kernel vport API being proposed to netdev to
find out the new network namespace ID of a bridge's port. This information
along with the port's name recorded in the database is used to match the
corresponding netlink messages.

This patchset also leverages another kernel API that allows the daemon
to listen to all netlink messages from all netns which has an ID assigned
into it.  This and the previous change allows the userspace to track ports
in other network namespaces.

If any of the APIs aren't available, it falls back to the older APIs to
not break backwards compatibility.

Flavio Leitner (8):
  netlink: provide network namespace id from a msg.
  netdev-linux: initialize netns as invalid.
  vport: retrieve the netnsid if available.
  netdev: update device info only if netns matches.
  netdev-linux: use netlink to update netdev.
  netlink linux: enable listening to all nsids
  nlmon: added netns support.
  netdev-linux: fail ops not supporting remote netns.

 configure.ac                                      |   3 +-
 datapath/linux/compat/include/linux/openvswitch.h |   2 +
 lib/automake.mk                                   |   1 +
 lib/daemon-unix.c                                 |   3 +-
 lib/daemon.man                                    |   6 +-
 lib/daemon.xml                                    |   8 +-
 lib/dpif-netlink.c                                |  12 +-
 lib/dpif-netlink.h                                |   2 +
 lib/netdev-linux.c                                | 314 ++++++++++++++++++++--
 lib/netlink-notifier.c                            |   2 +-
 lib/netlink-protocol.h                            |   6 +
 lib/netlink-socket.c                              |  64 ++++-
 lib/netlink-socket.h                              |   6 +-
 lib/netns.h                                       | 119 ++++++++
 tests/ofproto-macros.at                           |   1 +
 tests/ovn-controller-vtep.at                      |   1 +
 utilities/nlmon.c                                 |   9 +-
 17 files changed, 515 insertions(+), 44 deletions(-)
 create mode 100644 lib/netns.h

Comments

Ben Pfaff Nov. 3, 2017, 7:17 p.m. UTC | #1
On Thu, Nov 02, 2017 at 05:05:01PM -0200, Flavio Leitner wrote:
> Today Open vSwitch doesn't know about network namespaces (netns), but
> users are moving internal ports to other namespaces.  Although packets
> are still flowing, the daemon fails to find out basic port information,
> like if it is UP or DOWN, for instance.
> 
> This patchset rely on a new kernel vport API being proposed to netdev to
> find out the new network namespace ID of a bridge's port. This information
> along with the port's name recorded in the database is used to match the
> corresponding netlink messages.
> 
> This patchset also leverages another kernel API that allows the daemon
> to listen to all netlink messages from all netns which has an ID assigned
> into it.  This and the previous change allows the userspace to track ports
> in other network namespaces.
> 
> If any of the APIs aren't available, it falls back to the older APIs to
> not break backwards compatibility.

This seems like a very reasonable series to me, although I have not
reviewed it in detail.  Thank you for doing this work.

I'm hoping that Jiri or another Linux networking expert will take a look
at this series before me.  Jiri, are you planning to do that?