Re: [PATCH v2] test/flow: add support for async API

Stephen Hemminger
2026-03-02T00:53:01Z

On Mon, 2 Mar 2026 00:29:30 +0100
Maxime Peim <maxime.peim@gmail.com> wrote:

> + switch (items[i].type) {
> + case RTE_FLOW_ITEM_TYPE_IPV4:
> + ((struct rte_flow_item_ipv4 *)(uintptr_t)items[i].spec)->hdr.src_addr =
> + RTE_BE32(counter);
Since spec is a void * you don't have to make it so opaque via uintptr_t.

> + break;
> + case RTE_FLOW_ITEM_TYPE_IPV6: {
> + struct rte_flow_item_ipv6 *spec =
> + (struct rte_flow_item_ipv6 *)(uintptr_t)items[i].spec;

ditto

> + uint8_t j;
> + for (j = 0; j < 4; j++)
> + spec->hdr.src_addr.a[15 - j] = counter >> (j * 8);
> + break;
> + }
> + default:
> + break;
> + }

Every time I see a cast my "spidey sense" tingles and look for code issues.