public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: scott.k.mitch1@gmail.com
To: dev@dpdk.org
Cc: mb@smartsharesystems.com, stephen@networkplumber.org,
	bruce.richardson@intel.com, david.marchand@redhat.com,
	Scott <scott.k.mitch1@gmail.com>
Subject: [PATCH v18 0/2] net: optimize __rte_raw_cksum
Date: Wed, 28 Jan 2026 11:41:39 -0800	[thread overview]
Message-ID: <20260128194141.90018-1-scott.k.mitch1@gmail.com> (raw)
In-Reply-To: <20260128180516.76786-1-scott.k.mitch1@gmail.com>

From: Scott <scott.k.mitch1@gmail.com>

This series optimizes __rte_raw_cksum by replacing memcpy with direct
pointer access, enabling compiler vectorization on both GCC and Clang.

Patch 1 adds __rte_may_alias and __rte_aligned(1) to unaligned typedefs
to prevent a GCC strict-aliasing bug where struct initialization is
incorrectly elided, and avoid UB by clarifying access can be from any
address.

Patch 2 uses the improved unaligned_uint16_t type in __rte_raw_cksum
to enable compiler optimizations while maintaining correctness across
all architectures (including strict-alignment platforms).

Performance results show significant improvements (40% for small buffers,
up to 8x for larger buffers) on Intel Xeon with Clang 18.1.

Changes in v18:
- Fix MSVC compile error __rte_aligned(1) must come before type
- Fix test_hash_functions incorrect usage of unaligned_uint32_t

Changes in v17:
- Use __rte_aligned(1) unconditionally on unaligned type aliases
- test_cksum_fuzz uses unit_test_suite_runner
- test_cksum_fuzz reference method rename to
test_cksum_fuzz_cksum_reference

Changes in v16:
- Add Fixes tag and Cc stable/author for backporting (patch 1)

Changes in v15:
- Use NOHUGE_OK and ASAN_OK constants in REGISTER_FAST_TEST

Changes in v14:
- Split into two patches: EAL typedef fix and checksum optimization
- Use unaligned_uint16_t directly instead of wrapper struct
- Added __rte_may_alias to unaligned typedefs to prevent GCC bug

Scott Mitchell (2):
  eal: add __rte_may_alias and __rte_aligned to unaligned typedefs
  net: __rte_raw_cksum pointers enable compiler optimizations

 app/test/meson.build           |   1 +
 app/test/test_cksum_fuzz.c     | 234 +++++++++++++++++++++++++++++++++
 app/test/test_cksum_perf.c     |   2 +-
 app/test/test_hash_functions.c |   2 +-
 lib/eal/include/rte_common.h   |  45 ++++---
 lib/net/rte_cksum.h            |  14 +-
 6 files changed, 271 insertions(+), 27 deletions(-)
 create mode 100644 app/test/test_cksum_fuzz.c

--
2.39.5 (Apple Git-154)


  parent reply	other threads:[~2026-01-28 19:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 12:04 [PATCH v14 0/2] net: optimize __rte_raw_cksum scott.k.mitch1
2026-01-12 12:04 ` [PATCH v14 1/2] eal: add __rte_may_alias to unaligned typedefs scott.k.mitch1
2026-01-12 13:28   ` Morten Brørup
2026-01-12 15:00     ` Scott Mitchell
2026-01-12 12:04 ` [PATCH v14 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-01-17 21:21 ` [PATCH v15 0/2] net: optimize __rte_raw_cksum scott.k.mitch1
2026-01-17 21:21   ` [PATCH v15 1/2] eal: add __rte_may_alias to unaligned typedefs scott.k.mitch1
2026-01-20 15:23     ` Morten Brørup
2026-01-23 14:34       ` Scott Mitchell
2026-01-17 21:21   ` [PATCH v15 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-01-17 22:08   ` [PATCH v15 0/2] net: optimize __rte_raw_cksum Stephen Hemminger
2026-01-20 12:45     ` Morten Brørup
2026-01-23 15:43       ` Scott Mitchell
2026-01-23 16:02   ` [PATCH v16 " scott.k.mitch1
2026-01-23 16:02     ` [PATCH v16 1/2] eal: add __rte_may_alias to unaligned typedefs scott.k.mitch1
2026-01-23 16:02     ` [PATCH v16 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-01-28 11:05       ` David Marchand
2026-01-28 17:39         ` Scott Mitchell
2026-01-24  8:23     ` [PATCH v16 0/2] net: optimize __rte_raw_cksum Morten Brørup
2026-01-28 18:05     ` [PATCH v17 " scott.k.mitch1
2026-01-28 18:05       ` [PATCH v17 1/2] eal: add __rte_may_alias and __rte_aligned to unaligned typedefs scott.k.mitch1
2026-01-28 18:05       ` [PATCH v17 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-01-28 19:41       ` scott.k.mitch1 [this message]
2026-01-28 19:41         ` [PATCH v18 1/2] eal: add __rte_may_alias and __rte_aligned to unaligned typedefs scott.k.mitch1
2026-01-29  8:28           ` Morten Brørup
2026-02-02  4:31             ` Scott Mitchell
2026-01-28 19:41         ` [PATCH v18 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-01-29  8:31           ` Morten Brørup
2026-02-02  4:48         ` [PATCH v19 0/2] net: optimize __rte_raw_cksum scott.k.mitch1
2026-02-02  4:48           ` [PATCH v19 1/2] eal: add __rte_may_alias and __rte_aligned to unaligned typedefs scott.k.mitch1
2026-02-03  8:18             ` Morten Brørup
2026-02-16 14:29             ` David Marchand
2026-02-16 15:00               ` Morten Brørup
2026-02-02  4:48           ` [PATCH v19 2/2] net: __rte_raw_cksum pointers enable compiler optimizations scott.k.mitch1
2026-02-03  8:19             ` Morten Brørup
2026-02-06 14:54           ` [PATCH v19 0/2] net: optimize __rte_raw_cksum David Marchand
2026-02-07  1:29             ` Scott Mitchell
2026-02-10 11:53               ` Thomas Monjalon
2026-02-16 14:04               ` David Marchand

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=20260128194141.90018-1-scott.k.mitch1@gmail.com \
    --to=scott.k.mitch1@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.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