On 2/28/22 10:18, Adrian Moreno wrote: > > > On 2/25/22 13:07, Dumitru Ceara wrote: >> On 2/16/22 15:27, Adrian Moreno wrote: >>> Rewrite hmap's loops using multi-variable helpers. >>> >>> For SAFE loops, use the LONG version of the multi-variable macros to >>> keep backwards compatibility. >>> >>> Signed-off-by: Adrian Moreno <[email protected]> >>> --- >> >> A couple tiny nits, with those addressed: >> >> Acked-by: Dumitru Ceara <[email protected]> >> >>> diff --git a/lib/ovs-numa.h b/lib/ovs-numa.h >>> index ecc251a7f..83bd10cca 100644 >>> --- a/lib/ovs-numa.h >>> +++ b/lib/ovs-numa.h >>> @@ -68,9 +68,9 @@ void ovs_numa_dump_destroy(struct ovs_numa_dump *); >>> int ovs_numa_thread_setaffinity_core(unsigned core_id); >>> #define FOR_EACH_CORE_ON_DUMP(ITER, DUMP) \ >>> - HMAP_FOR_EACH((ITER), hmap_node, &(DUMP)->cores) >>> + HMAP_FOR_EACH (ITER, hmap_node, &(DUMP)->cores) >> >> Nit: kind of unrelated. >> > > Well... yes and no :) > > The internal iterator name is now determined by: > > #define ITER_VAR(NAME) NAME ## __iterator__ > > if we pass (myvar), the variable declaration will fail because > (myvar)__iterator__ is not a valid variable name. Parenthesis would be > required if we supported arbitrary expressions as the first argument but > macros won't really work in that case. >
Thanks, I had missed that. > I can add a comment explaining this limitation to the macros in > include/openvswitch/util.h. Or maybe you can think of a way to overcome > this limitation? > Looking at hmap.h, it seems to me that we had this limitation from the beginning. We might as well leave it as-is. Please ignore my original comment. > >>> #define FOR_EACH_NUMA_ON_DUMP(ITER, DUMP) \ >>> - HMAP_FOR_EACH((ITER), hmap_node, &(DUMP)->numas) >>> + HMAP_FOR_EACH (ITER, hmap_node, &(DUMP)->numas) >> >> Nit: here too. >> > > > Thanks Regards, Dumitru _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
