[ovs-dev] [PATCH 1/4] dpif-netdev: Flush offload rules upon port deletion
Ilya Maximets
i.maximets at ovn.org
Fri Dec 4 20:45:26 UTC 2020
On 12/2/20 8:23 AM, Eli Britstein wrote:
> 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 to fix it.
>
> Signed-off-by: Eli Britstein <elibr at nvidia.com>
> Reviewed-by: Gaetan Rivet <gaetanr at nvidia.com>
> ---
> lib/dpif-netdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 300861ca5..3645479ad 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -2281,6 +2281,7 @@ static void
> do_del_port(struct dp_netdev *dp, struct dp_netdev_port *port)
> OVS_REQUIRES(dp->port_mutex)
> {
> + netdev_flow_flush(port->netdev);
But offload thread is up and running at this point and could have full queue
of offloading requests for this port or already sleeping on port_mutex waiting
to offload some flow. So, we're leaking memory anyway.
Best regards, Ilya Maximets.
More information about the dev
mailing list