[ovs-dev] [PATCH ovn] controller: Free the qos hmap built in binding_run().

Numan Siddique numans at ovn.org
Fri May 15 15:51:46 UTC 2020


On Fri, May 15, 2020 at 5:22 PM Dumitru Ceara <dceara at redhat.com> wrote:

> On 5/15/20 12:17 PM, numans at ovn.org wrote:
> > From: Numan Siddique <numans at ovn.org>
> >
> > Fixes the memory leak because of this.
> >
> > Signed-off-by: Numan Siddique <numans at ovn.org>
>
> Looks good to me.
>
> Acked-by: Dumitru Ceara <dceara at redhat.com>
>

Thanks Dumitru.

I applied this patch to master and branch-20.03.

Thanks
Numan


>
> Thanks,
> Dumitru
>
> > ---
> >  controller/binding.c | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/controller/binding.c b/controller/binding.c
> > index 9d37a23cc..a5525a310 100644
> > --- a/controller/binding.c
> > +++ b/controller/binding.c
> > @@ -390,6 +390,17 @@ setup_qos(const char *egress_iface, struct hmap
> *queue_map)
> >      netdev_close(netdev_phy);
> >  }
> >
> > +static void
> > +destroy_qos_map(struct hmap *qos_map)
> > +{
> > +    struct qos_queue *qos_queue;
> > +    HMAP_FOR_EACH_POP (qos_queue, node, qos_map) {
> > +        free(qos_queue);
> > +    }
> > +
> > +    hmap_destroy(qos_map);
> > +}
> > +
> >  static void
> >  update_local_lport_ids(struct sset *local_lport_ids,
> >                         const struct sbrec_port_binding *binding_rec)
> > @@ -792,7 +803,7 @@ binding_run(struct binding_ctx_in *b_ctx_in, struct
> binding_ctx_out *b_ctx_out)
> >
> >      shash_destroy(&lport_to_iface);
> >      sset_destroy(&egress_ifaces);
> > -    hmap_destroy(&qos_map);
> > +    destroy_qos_map(&qos_map);
> >  }
> >
> >  /* Returns true if port-binding changes potentially require flow
> changes on
> >
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>


More information about the dev mailing list