All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Robin Jarry" <rjarry@redhat.com>
To: "Bruce Richardson" <bruce.richardson@intel.com>
Cc: dev@dpdk.org,
	"Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	"Wathsala Vithanage" <wathsala.vithanage@arm.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	stable@dpdk.org
Subject: Re: [PATCH dpdk] ring: split 128-bit pair copies for unoptimized GCC
Date: Mon, 30 Nov 2026 16:57:41 +0100	[thread overview]
Message-ID: <DN8O3L485QLI.NOUVYVIZCVW9@redhat.com> (raw)
In-Reply-To: <aw2EykHIPc6DPuTV@bricha3-mobl1.ger.corp.intel.com>

Bruce Richardson, Nov 30, 2026 at 15:14:
> On Mon, Nov 30, 2026 at 01:29:30PM +0100, Robin Jarry wrote:
>> GCC 14 and 16 at -O0 report -Wstringop-overread when an inlined
>> ring enqueue receives a 24-byte item. Without optimization, GCC
>> diagnoses the 32-byte memcpy in the unreachable 128-bit copy path.
>> The unoptimized-build warning flag does not apply to applications
>> compiling DPDK headers, and the header-local suppression is gone.
>> 
>> Copy the pair as two 16-byte elements instead. This avoids the
>> false warning without suppressing diagnostics for applications.
>> Optimized x86-64 code still uses two 16-byte loads and stores.
>> 
>> Fixes: 812a18c167f4 ("build: disable GCC string op warnings when unoptimized")
>> Cc: stable@dpdk.org
>> Signed-off-by: Robin Jarry <rjarry@redhat.com>
>> ---
>>  lib/ring/rte_ring_elem_pvt.h | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>> 
> Forgive my ignorance here, but is this solving the underlying issue or just
> tweaking the code to hide the warning. Given a 24-byte object, is two
> 16-byte copies not just as bad as a single 32-byte copies?

Possibly just hiding the warning :D

I'll send a v3 that re-establishes the local warning suppressions
instead.

>
> /Bruce
>
> PS: AI analysis and testing of this patch also flags that when compiled for an
> architecture with AVX2 available, the original code produces one 32-byte
> load-store, vs two 16-byte load-stores for the updated code. Therefore,
> there is potential for a regression here for any cases where we may be load
> or store bounded.


-- 
Robin

# Avoid contact with skin.

  reply	other threads:[~2026-11-30 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:29 [PATCH dpdk] ring: split 128-bit pair copies for unoptimized GCC Robin Jarry
2026-11-30 14:04 ` [PATCH dpdk v2] " Robin Jarry
2026-11-30 14:04 ` [PATCH dpdk] " Morten Brørup
2026-11-30 14:14 ` Bruce Richardson
2026-11-30 15:57   ` Robin Jarry [this message]
2026-11-30 14:33 ` Morten Brørup
2026-12-01  9:01 ` [PATCH dpdk v3] ring: suppress unoptimized GCC string warnings locally Robin Jarry
2026-12-01  9:08   ` Morten Brørup

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=DN8O3L485QLI.NOUVYVIZCVW9@redhat.com \
    --to=rjarry@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=wathsala.vithanage@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.