[ovs-git] [openvswitch/ovs] 61f4f7: in-band: use open_type when opening internal devic...

GitHub noreply at github.com
Wed Jul 27 21:48:17 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 61f4f76e6de1e73c09fed469f65eb5f8fbc0b165
      https://github.com/openvswitch/ovs/commit/61f4f76e6de1e73c09fed469f65eb5f8fbc0b165
  Author: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
  Date:   2016-07-27 (Wed, 27 Jul 2016)

  Changed paths:
    M ofproto/in-band.c

  Log Message:
  -----------
  in-band: use open_type when opening internal device

in-band code will open a device that it expects to be the main internal port of
the bridge. However, it's possible that the correct type is a different one. For
dpif-netdev, it might be a tap device, or a dummy device for dummy datapaths.
ofproto_port_open_type will give the correct type.

While this doesn't cause any problems right now, as the needed type would be
opened already, a later patch assumes netdev with different types cannot be
opened.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>


  Commit: 40baa1f5ebf8588a18870b79caf57e791527181e
      https://github.com/openvswitch/ovs/commit/40baa1f5ebf8588a18870b79caf57e791527181e
  Author: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
  Date:   2016-07-27 (Wed, 27 Jul 2016)

  Changed paths:
    M ofproto/in-band.c

  Log Message:
  -----------
  in-band: don't use system type when opening netdev

A netdev might be already opened with a different type and that can be used
instead. The system type is already the default type that will be used when
there is no netdev opened and the type is not specified.

And as long as the opened netdev supports the required operations, it doesn't
matter its type.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>


  Commit: 6c607a64aeff39b8c74fedad681d9f4a207b214e
      https://github.com/openvswitch/ovs/commit/6c607a64aeff39b8c74fedad681d9f4a207b214e
  Author: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
  Date:   2016-07-27 (Wed, 27 Jul 2016)

  Changed paths:
    M lib/netdev-vport.c

  Log Message:
  -----------
  netdev-vport: don't use system type when opening netdev

tunnel_check_status_change__ calls netdev_open with type system. Using NULL
instead will default to system in case the device is not opened yet, and allow a
different type in case it's already opened.

Any type should be fine, as netdev_get_carrier will work with any of them.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>


  Commit: a3e8437a1893413060c2e168f55fcd20f13bdf35
      https://github.com/openvswitch/ovs/commit/a3e8437a1893413060c2e168f55fcd20f13bdf35
  Author: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
  Date:   2016-07-27 (Wed, 27 Jul 2016)

  Changed paths:
    M lib/dpif-netdev.c
    M tests/dpctl.at

  Log Message:
  -----------
  dpif-netdev: use the open_type when creating the local port

Instead of using the internal type, use the port_open_type when creating the
local port. That makes sure that whenever dpif_port_query is used, the netdev
open_type is returned instead of the "internal" type.

For other ports, that is already the case, as the netdev type is used when
creating the dp_netdev_port.

That changes the output of dpctl when showing the local port, and also when
trying to change its type. So, corresponding tests are fixed.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>


  Commit: d2fa6c676a13e86acc7f17261b2d87484f625d45
      https://github.com/openvswitch/ovs/commit/d2fa6c676a13e86acc7f17261b2d87484f625d45
  Author: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
  Date:   2016-07-27 (Wed, 27 Jul 2016)

  Changed paths:
    M lib/netdev.c

  Log Message:
  -----------
  netdev: do not allow devices to be opened with conflicting types

When a device is already opened, netdev_open should verify that the types match,
or else return an error.

Otherwise, users might expect to open a device with a certain type and get a
handle belonging to a different type.

This also prevents certain conflicting configurations that would have a port of
a certain type in the database and one of a different type on the system.

For example, when adding an interface with a type other than system, and there
is already a system interface with the same name, as the routing table will hold
a reference to that system interface, some conflicts will arise. The netdev will
be opened with the incorrect type and that will make vswitchd remove it, but
adding it again will fail as it already exists. Failing earlier prevents some
vswitchd loops in reconfiguring the interface.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at redhat.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>


Compare: https://github.com/openvswitch/ovs/compare/fb5b3c22128c...d2fa6c676a13


More information about the git mailing list