[ovs-dev] [PATCH v2] vswitchd: Always cleanup userspace datapath.

Ben Pfaff blp at ovn.org
Mon Jul 1 16:52:58 UTC 2019

On Thu, Jun 27, 2019 at 08:24:46PM +0300, Ilya Maximets wrote:
> On 26.06.2019 21:27, Ben Pfaff wrote:
> > On Tue, Jun 25, 2019 at 01:12:11PM +0300, Ilya Maximets wrote:
> >> '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.
> >>
> >> 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>
> > 
> > I'm having trouble figuring out what the critical step is in the
> > destruction process that this enables or disables.  It controls whether
> > dpif_port_del() gets called.  There's a lot of stuff under
> > dpif_port_del(), most of it indirect.  I'm not sure which bit is the
> > important one.  Would you mind explaining what it is as part of the
> > commit message?
> """
> 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.
> """
> Does above shed some light on the main goals of this patch?
> I could add this information to commit message while applying the
> patch.

Thanks.  It helps a lot.  Please add it to the commit message.

Acked-by: Ben Pfaff <blp at ovn.org>

More information about the dev mailing list