> From: Robin Jarry [mailto:rja...@redhat.com]
> Sent: Wednesday, 4 January 2023 11.14
> 
> Morten Brørup, Dec 16, 2022 at 11:47:
> > > + usage_str[0] = '\0';
> > > + usage_cb = lcore_usage_cb;
> > > + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {
> >
> > Move memset() inside here, and add comment:
> >
> > + /* The application's callback may not set all the fields in the
> structure, so clear it here. */
> > + memset(&usage, 0, sizeof(usage));
> 
> This may make the code more complex than it needs to be (two nested
> ifs)
> for very little performance benefit. I'm not sure it is worth it. I can
> add the comment, though.

You are right - I missed that. Just adding the comment is fine.


Please also note my comment regarding the rte_lcore_usage_cb() function 
description:

"should be left to their default value." -> "must not be modified."

Reply via email to