public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Maxime Peim <maxime.peim@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2] test/flow: add support for async API
Date: Sun, 1 Mar 2026 16:52:35 -0800	[thread overview]
Message-ID: <20260301165235.1aa2003e@phoenix.local> (raw)
In-Reply-To: <20260301232931.444294-1-maxime.peim@gmail.com>

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.

  parent reply	other threads:[~2026-03-02  0:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 10:56 [PATCH] test/flow: add support for async API Maxime Peim
2026-02-25 22:23 ` Stephen Hemminger
2026-03-01 23:29   ` [PATCH v2] " Maxime Peim
2026-03-01 23:36     ` Maxime Peim
2026-03-02  0:52     ` Stephen Hemminger [this message]
2026-03-02 10:57   ` [PATCH v3] " Maxime Peim
2026-03-02 14:35   ` [PATCH v4] " Maxime Peim
2026-03-09 12:52   ` [PATCH v5] " Maxime Peim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260301165235.1aa2003e@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=maxime.peim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox