[PATCH v5] net: optimize raw checksum computation

Scott Mitchell scott.k.mitch1 at gmail.com
Thu Jan 8 22:19:37 CET 2026


On Thu, Jan 8, 2026 at 11:12 AM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> On Thu,  8 Jan 2026 01:13:38 -0500
> scott.k.mitch1 at 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.


More information about the dev mailing list