Re: [ovs-dev] [PATCH 1/4] dpif-netdev: Flush offload rules upon port deletion
On 12/4/2020 10:45 PM, Ilya Maximets wrote: External email: Use caution opening links or attachments 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 Reviewed-by: Gaetan Rivet --- 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. Thanks. Fixed in v2. Best regards, Ilya Maximets. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 1/4] dpif-netdev: Flush offload rules upon port deletion
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 > Reviewed-by: Gaetan Rivet > --- > 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. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev