On Fri, Apr 21, 2023 at 6:11 PM Simon Horman <[email protected]> wrote:
>
> Perhaps it's just me, but I'd have written this as:
>
>        struct pollfd pfd = {0};
>

Got it. I will update this in the next patch version.

>
> I was wondering if we could move the assert inside sflAlloc.
> And also have sflAlloc zero the memory, perhaps only in the callback
> case to allow xzalloc to do it's thing.
>

Sure thing. I will implement this in the next patch version.

>
> sfl_sampler_init zero's newsm.
> If it is always zero, perhaps that memset can be removed from
> sfl_sampler_init(). Avoiding extra work. Or is that too risky in your
> opinion?
>

`sfl_receiver_init()` and `sfl_poller_init()` also zero `rcv` and
`newpl` respectively. However, I do not think that we should remove
the `memset()`s in the `*_init()` functions as they are also used when
the SFLReceiver, SFLSampler, or SFLPoller is reset. I would recommend
keeping both.

Best regards,
James Raphael Tiovalen
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to