On 2024-09-18 10:24, Konstantin Ananyev wrote:
+/**
+ * Iterate over each lcore id's value for an lcore variable.
+ *
+ * @param lcore_id
+ * An <code>unsigned int</code> variable successively set to the
+ * lcore id of every valid lcore id (up to @c RTE_MAX_LCORE).
+ * @param value
+ * A pointer variable successively set to point to lcore variable
+ * value instance of the current lcore id being processed.
+ * @param handle
+ * The lcore variable handle.
+ */
+#define RTE_LCORE_VAR_FOREACH_VALUE(lcore_id, value, handle) \
+ for (lcore_id = (((value) = RTE_LCORE_VAR_LCORE_VALUE(0, handle)), 0); \
+ lcore_id < RTE_MAX_LCORE; \
+ lcore_id++, (value) = RTE_LCORE_VAR_LCORE_VALUE(lcore_id, handle))
+
I think we need a '()' around references to lcore_id:
for ((lcore_id) = (((value) = RTE_LCORE_VAR_LCORE_VALUE(0, handle)), 0); \
(lcore_id) < RTE_MAX_LCORE; \
(lcore_id)++, (value) = RTE_LCORE_VAR_LCORE_VALUE(lcore_id,
handle))
Yes, of course. Thanks.