From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Scott Mitchell" <scott.k.mitch1@gmail.com>,
"Stephen Hemminger" <stephen@networkplumber.org>,
"Aaron Conole" <aconole@redhat.com>
Cc: <dev@dpdk.org>
Subject: RE: [PATCH v5] net: optimize raw checksum computation
Date: Fri, 9 Jan 2026 10:08:00 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65637@smartserver.smartshare.dk> (raw)
In-Reply-To: <CAFn2buCqxz=43Xy6QycxS0KaY9A49bcLrsBOGFoP6MzHE0fnNg@mail.gmail.com>
+Aaron, please read up on this discussion, and step in if you can help.
(Aaron is the DPDK Project testing leader, and works at Red Hat.)
> From: Scott Mitchell [mailto:scott.k.mitch1@gmail.com]
> Sent: Friday, 9 January 2026 05.58
>
> On Thu, Jan 8, 2026 at 7:01 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Thu, 8 Jan 2026 16:19:37 -0500
> > Scott Mitchell <scott.k.mitch1@gmail.com> wrote:
> >
> > > On Thu, Jan 8, 2026 at 11:12 AM Stephen Hemminger
> > > <stephen@networkplumber.org> wrote:
> > > >
> > > > On Thu, 8 Jan 2026 01:13:38 -0500
> > > > scott.k.mitch1@gmail.com wrote:
> > > >
> > > > > +#ifdef RTE_CC_GCC
> > > > > + /* Suppress GCC -Wmaybe-uninitialized false positive. No
> assembly/runtime impacts. */
> > > > > + asm volatile("" : "+m" (psd_hdr));
> > > > > +#endif
> > > > >
> > > >
> > > > Maybe rte_compiler_barrier() will do same thing?
> > >
> > > Agreed it feels like a compiler bug but looking for advice if I'm
> > > missing something :)
> > >
> > > My initial concern with rte_compiler_barrier is its a general
> barrier
> > > which may have broader impacts on
> > > optimizations and compiled code. Will that be an issue in this
> case? I
> > > wasn't sure and the approach
> > > in the patch is targeted at a specific variable and assembly from
> > > clang/gcc was the same. I will
> > > introduce a macro to make it cleaner and I can replace it with
> > > rte_compiler_barrier if preferred.
> >
> > Maybe try with -fanalyzer and it might tell you more.
> > I suspect some of the aliasing setting are causing issues.
> > Some drivers are turning on no-strict-aliasing
>
> I have more evidence this is a GCC optimizer bug.
> The RTE_SUPPRESS_UNINITIALIZED_WARNING approach serves
> as a workaround to avoid the bug. I created a more minimal reproducer:
> https://gist.github.com/Scottmitch/bf23748b4588e68c9bdb8d124f92f1bd
>
> Your suspicion was correct, -fno-strict-aliasing avoids the bug but I
> don't
> think it is desirable to enable this broadly for DPDK when we have a
> more targeted workaround.
>
> I will reach out to RH to confirm but in the interim I suggest we keep
> RTE_SUPPRESS_UNINITIALIZED_WARNING (or similar alternative).
If this is a GCC compiler bug limited to the GCC version offered by RHEL 11, I prefer splitting the patch into a series with the following steps:
Patch 1/2: Add the optimization and new test cases in their minimal form, designed to work on normal compilers. Disregard bugs/warnings from the weird RHEL 11 compiler.
I.e. don't modify lib/eal/include/rte_common.h, lib/net/rte_ip6.h, lib/net/rte_ip4.h, drivers/net/hinic/hinic_pmd_tx.c, drivers/net/mlx5/mlx5_flow_dv.c.
Patch 2/2: Add the workarounds required by the RHEL 11 compiler.
Also, the change to drivers/net/hinic/hinic_pmd_tx.c should be moved to a patch independent of this series.
It's not directly related to this series, so let's not add more to the discussion than we need to. ;-)
And the implementation in the driver only considers RTE_MBUF_F_TX_TCP_SEG, whereas the DPDK function also considers RTE_MBUF_F_TX_UDP_SEG, so it warrants a separate discussion; it possibly fixes a bug.
Maybe even move the RHEL 11 related patches (my suggested patch 2/2) into a separate series, for the same conceptual reasons as moving the HINIC driver patch into a separate series.
You can use the Depends-On tag (https://doc.dpdk.org/guides/contributing/patches.html#patch-dependencies) for the follow-on changes to __rte_raw_cksum().
next prev parent reply other threads:[~2026-01-09 9:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 6:13 scott.k.mitch1
2026-01-08 16:10 ` Stephen Hemminger
2026-01-08 16:12 ` Stephen Hemminger
2026-01-08 21:19 ` Scott Mitchell
2026-01-09 0:00 ` Stephen Hemminger
2026-01-09 4:57 ` Scott Mitchell
2026-01-09 9:08 ` Morten Brørup [this message]
2026-01-09 17:04 ` Scott Mitchell
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=98CBD80474FA8B44BF855DF32C47DC35F65637@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=aconole@redhat.com \
--cc=dev@dpdk.org \
--cc=scott.k.mitch1@gmail.com \
--cc=stephen@networkplumber.org \
/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).