[ovs-git] [openvswitch/ovs] f87c13: vswitchd: Always cleanup userspace datapath.

Ilya Maximets noreply at github.com
Tue Jul 2 09:28:06 UTC 2019

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f87c1357067e1f67087eab4af42e5aaf7bf6cc8e
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2019-07-02 (Tue, 02 Jul 2019)

  Changed paths:
    M NEWS
    M lib/dpif-netdev.c
    M lib/dpif-netlink.c
    M lib/dpif-provider.h
    M lib/dpif.c
    M lib/dpif.h
    M ofproto/ofproto-dpif.c
    M vswitchd/ovs-vswitchd.8.in

  Log Message:
  vswitchd: Always cleanup userspace datapath.

'netdev' datapath is implemented within ovs-vswitchd process and can
not exist without it, so it should be gracefully terminated with a
full cleanup of resources upon ovs-vswitchd exit.

This change forces dpif cleanup for 'netdev' datapath regardless of
passing '--cleanup' to 'ovs-appctl exit'. Such solution allowes to
not pass this additional option everytime for userspace datapath
installations and also allowes to not terminate system datapath in
setups where both datapaths runs at the same time.

The main part is that dpif_port_del() will lead to netdev_close()
and subsequent netdev_class->destroy(dev) which will stop HW NICs
and free their resources. For vhost-user interfaces it will invoke
vhost driver unregistering with a properly closed vhost-user
connection. For upcoming AF_XDP netdev this will allow to gracefully
destroy xdp sockets and unload xdp programs from linux interfaces.
Another important thing is that port deletion will also trigger
flushing of flows offloaded to HW NICs.

Exception made for 'internal' ports that could have user ip/route
configuration. These ports will not be removed without '--cleanup'.

This change fixes OVS disappearing from the DPDK point of view
(keeping HW NICs improperly configured, sudden closing of vhost-user
connections) and will help with linux devices clearing with upcoming
AF_XDP netdev support.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Tested-by: William Tu <u9012063 at gmail.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>
Acked-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list