DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: liwencheng <liwencheng@phytium.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v4 3/4] net/macb: add NEON vectorized Rx/Tx
Date: Sun, 26 Oct 2025 11:17:31 -0700	[thread overview]
Message-ID: <20251026111731.66acce34@phoenix> (raw)
In-Reply-To: <1743577152-119846-1-git-send-email-liwencheng@phytium.com.cn>

On Wed,  2 Apr 2025 06:59:12 +0000
liwencheng <liwencheng@phytium.com.cn> wrote:

> +static inline uint8x8_t macb_mbuf_initializer(struct macb_rx_queue *rxq)
> +{
> +	volatile struct rte_mbuf mbuf = {.buf_addr = 0}; /* zeroed mbuf */

There is no way an on stack variable could be volatile. What it looks like
your are doing is trying to workaround misunderstanding of atomic.

> +	uint64x1_t mbuf_initializer;
> +	uint8x8_t rearm_data_vec;
> +
> +	mbuf.data_off = RTE_PKTMBUF_HEADROOM + MACB_RX_DATA_OFFSET;
> +	mbuf.nb_segs = 1;
> +	mbuf.port = rxq->port_id;

Why not just put these into the initializer?

> +	rte_mbuf_refcnt_set((struct rte_mbuf *)&mbuf, 1);
> +
> +	/* prevent compiler reordering: rearm_data covers previous fields */
> +	rte_compiler_barrier();

You would be better off doing an atomic store with the right type of memory
order, rather than weak + barrier.  But would have to handle case where 
refcounts are compiled out.

> +	mbuf_initializer =
> +		vset_lane_u64(*(uint64_t *)(&mbuf.rearm_data), mbuf_initializer, 0);

Take the volatile of mbuf and you won't have compiler warning.


> +	rearm_data_vec = vld1_u8((uint8_t *)&mbuf_initializer);
> +	return rearm_data_vec;
> +}

  parent reply	other threads:[~2025-10-26 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02  6:59 liwencheng
2025-04-07  6:39 ` [PATCH v5 " liwencheng
2025-04-08  6:21   ` [PATCH v6 2/3] " liwencheng
2025-04-18  3:26     ` [PATCH v7 " Wencheng Li
2025-06-04  7:01       ` [PATCH v8 " Wencheng Li
2025-06-06  9:07         ` [PATCH v9 " Wencheng Li
2025-08-20  4:33           ` [PATCH v10 " Wencheng Li
2025-10-26 18:02 ` [PATCH v4 3/4] " Stephen Hemminger
2025-10-26 18:17 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-10  7:05 [PATCH v3 2/6] " Wencheng Li
2025-04-02  7:10 ` [PATCH v4 3/4] " liwencheng

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=20251026111731.66acce34@phoenix \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=liwencheng@phytium.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).