From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v3 0/5] eal: RTE_PTR_ADD and fix unaligned types
Date: Mon, 7 Sep 2026 11:31:19 -0700 [thread overview]
Message-ID: <20260907183239.629053-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20260904220953.3105930-1-stephen@networkplumber.org>
This series started with Scott Mitchell's patch to preserve pointer
qualifications across RTE_PTR_ADD and RTE_PTR_SUB. Reviewing it
turned up two further problems.
The first is that unaligned_uintNN_t only had alignment 1 on armv8
aarch32, the one target setting RTE_ARCH_STRICT_ALIGN. Everywhere
else they were ordinary aligned types, so code using them to read
or write at arbitrary offsets was still undefined behaviour and was
reported by UBSAN. Giving them alignment 1 on all architectures
fixes that, and once mlx5 no longer needs its strict alignment
path, RTE_ARCH_STRICT_ALIGN has no users left and is removed.
The second is the jhash test, which declared its key as a byte
array and cast it to unaligned_uint32_t * to pass to a function
taking const uint32_t *. That is fixed first in the series so the
alignment change does not introduce a new clang warning.
Only patch 1 should go to stable.
Note for reviewers: unaligned_uintNN_t is in an installed header,
so applications embedding one of these types in a structure will
see its layout change. That is called out in the release notes.
The types are also used in the hash key compare path
(rte_cuckoo_hash.c, rte_cmp_generic.h) and for 8 byte ring elements
(rte_ring_elem_pvt.h). Scalar code generation is unchanged on x86,
but the compiler can no longer assume alignment when combining
adjacent accesses, so hash and ring perf results would be welcome,
particularly on arm.
v3 - fix definition of unaligned types on Windows
Scott Mitchell (1):
eal: RTE_PTR_ADD/SUB API improvements
Stephen Hemminger (4):
test: fix jhash 32 bit key type
eal: make unaligned really unaligned
net/mlx5: drop unnecessary STRICT_ALIGN
arm: remove no longer used RTE_ARCH_STRICT_ALIGN
app/test-pmd/cmdline_flow.c | 4 +-
app/test/test_common.c | 507 +++++++++++++++++++-
app/test/test_hash_functions.c | 14 +-
config/arm/meson.build | 1 -
doc/guides/rel_notes/release_26_11.rst | 20 +
drivers/bus/cdx/cdx_vfio.c | 13 +-
drivers/bus/pci/linux/pci.c | 6 +-
drivers/bus/vmbus/linux/vmbus_uio.c | 6 +-
drivers/common/cnxk/roc_cpt_debug.c | 12 +-
drivers/common/cnxk/roc_ml.c | 4 +-
drivers/common/cnxk/roc_nix_bpf.c | 2 +-
drivers/common/cnxk/roc_nix_inl.h | 4 +-
drivers/common/cnxk/roc_nix_inl_dp.h | 8 +-
drivers/common/mlx5/mlx5_common_mr.c | 2 +-
drivers/dma/idxd/idxd_pci.c | 2 +-
drivers/dma/odm/odm_dmadev.c | 4 +-
drivers/event/cnxk/cn10k_worker.c | 32 +-
drivers/event/cnxk/cn20k_worker.c | 32 +-
drivers/mempool/bucket/rte_mempool_bucket.c | 7 +-
drivers/net/cxgbe/sge.c | 4 +-
drivers/net/ena/ena_ethdev.c | 10 +-
drivers/net/mlx4/mlx4_txq.c | 3 +-
drivers/net/mlx5/mlx5_tx.h | 12 +-
lib/eal/common/eal_common_fbarray.c | 2 +-
lib/eal/common/eal_common_memory.c | 29 +-
lib/eal/common/eal_common_options.c | 3 +-
lib/eal/common/malloc_elem.h | 34 +-
lib/eal/freebsd/eal_memory.c | 4 +
lib/eal/include/rte_common.h | 192 +++++++-
lib/eal/linux/eal_memalloc.c | 5 +
lib/eal/linux/eal_memory.c | 7 +
lib/eal/windows/eal_memalloc.c | 5 +
lib/graph/rte_graph.h | 4 +-
lib/latencystats/rte_latencystats.c | 3 +
lib/mbuf/rte_mbuf.c | 2 +
lib/mbuf/rte_mbuf.h | 3 +
lib/member/rte_xxh64_avx512.h | 6 +-
lib/mempool/rte_mempool.h | 5 +
lib/pdcp/pdcp_entity.h | 8 +-
lib/vhost/vhost_user.c | 13 +-
40 files changed, 875 insertions(+), 159 deletions(-)
--
2.53.0
next prev parent reply other threads:[~2026-09-07 18:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 22:09 [RFC 0/3] eal: make unaligned types really unaligned Stephen Hemminger
2026-09-04 22:09 ` [RFC 1/3] eal: make unaligned " Stephen Hemminger
2026-09-04 22:09 ` [RFC 2/3] net/mlx5: drop unnecessary STRICT_ALIGN Stephen Hemminger
2026-09-05 10:00 ` Morten Brørup
2026-09-04 22:09 ` [RFC 3/3] arm: remove no longer used RTE_ARCH_STRICT_ALIGN Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 0/5] eal: RTE_PTR_ADD qualifiers and real unaligned types Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 1/5] test: fix jhash 32 bit key type Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 2/5] eal: RTE_PTR_ADD/SUB API improvements Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 3/5] eal: make unaligned really unaligned Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 4/5] net/mlx5: drop unnecessary STRICT_ALIGN Stephen Hemminger
2026-09-06 17:09 ` [PATCH v2 5/5] arm: remove no longer used RTE_ARCH_STRICT_ALIGN Stephen Hemminger
2026-09-06 20:14 ` [PATCH v2 0/5] eal: RTE_PTR_ADD qualifiers and real unaligned types Morten Brørup
2026-09-07 18:31 ` Stephen Hemminger [this message]
2026-09-07 18:31 ` [PATCH v3 1/5] test: fix jhash 32 bit key type Stephen Hemminger
2026-09-07 18:31 ` [PATCH v3 2/5] eal: RTE_PTR_ADD/SUB API improvements Stephen Hemminger
2026-09-07 18:31 ` [PATCH v3 3/5] eal: make unaligned really unaligned Stephen Hemminger
2026-09-07 18:31 ` [PATCH v3 4/5] net/mlx5: drop unnecessary STRICT_ALIGN Stephen Hemminger
2026-09-07 18:31 ` [PATCH v3 5/5] arm: remove no longer used RTE_ARCH_STRICT_ALIGN Stephen Hemminger
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=20260907183239.629053-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.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