]> git.proxmox.com Git - mirror_ovs.git/commitdiff
dpif-netdev: Flush offload rules upon port deletion.
authorEli Britstein <elibr@nvidia.com>
Mon, 28 Dec 2020 10:19:00 +0000 (10:19 +0000)
committerIlya Maximets <i.maximets@ovn.org>
Fri, 15 Jan 2021 18:01:00 +0000 (19:01 +0100)
When a port is deleted, flow deletion requests are posted, and the netdev
is removed from offload netdevs map. Following flow deletion handling may
be done after the netdev has already been removed from the offload
netdevs map, so the HW rule is not removed and the data object is not
freed (memory leak). Flush offload rules upon port deletion, and disable
pending handling of offloads to fix it.

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr@nvidia.com>
Acked-by: Emma Finn <emma.finn@intel.com>
Tested-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
lib/dpif-netdev.c

index 9dc07d804c2a84b6a1e525b62b6ef348c577dba8..e3fd0a07fd5b79152135bdbc800a5c815784a2a1 100644 (file)
@@ -2283,6 +2283,8 @@ static void
 do_del_port(struct dp_netdev *dp, struct dp_netdev_port *port)
     OVS_REQUIRES(dp->port_mutex)
 {
+    netdev_flow_flush(port->netdev);
+    netdev_uninit_flow_api(port->netdev);
     hmap_remove(&dp->ports, &port->node);
     seq_change(dp->port_seq);