Skip to contentSkip to conversation

doc: announce changes in structure alignments for UBSan

PATCH Applied David Marchand 5 participants 5 messages Jul 9, 2025 – Jul 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: announce changes in structure alignments for UBSan

As part of the effort to limit undefined behaviors in DPDK code, some structure alignments revealed not to be accurate enough. At the moment two structures have been identified but others may be found while running more parts of DPDK with UBSan.

Though the calling code can explicitly request alignment, we would prefer to put the alignment constraints as part of the structure definition itself.

Such changes are ABI breakages.

---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
index e2d4125308..4ae561d670 100644
@@ -57,6 +57,10 @@ Deprecation Notices
   ``__atomic_thread_fence`` must be used for patches that need to be merged in
   20.08 onwards. This change will not introduce any performance degradation.
 
+* lib: multiple issues relating to unaligned accesses have been detected using the UBSan checker.
+  As part of resolving those issues, alignment in some structures will be updated in 25.11,
+  namely (but not exhaustively): ``struct rte_stack_lf_head`` and ``struct rte_mp_msg``.
+
 * lib: will fix extending some enum/define breaking the ABI. There are multiple
   samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
   used by iterators, and arrays holding these values are sized with this
Signature · 1 line
2.50.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · David Marchand

As part of the effort to limit undefined behaviors in DPDK code, some structure alignments revealed not to be accurate enough. At the moment two structures have been identified but others may be found while running more parts of DPDK with UBSan.

Quoted 8 lines

Though the calling code can explicitly request alignment, we would prefer to put the alignment constraints as part of the structure definition itself.

Such changes are ABI breakages.

---

Acked-by on v1 1/1
#2 lore raw
In reply to David Marchand
Quoted 30 lines

From: David Marchand [mailto:[email protected]]
Sent: Wednesday, 9 July 2025 14.40

As part of the effort to limit undefined behaviors in DPDK code, some structure alignments revealed not to be accurate enough. At the moment two structures have been identified but others may be found while running more parts of DPDK with UBSan.

Though the calling code can explicitly request alignment, we would prefer to put the alignment constraints as part of the structure definition itself.

Such changes are ABI breakages.

---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +0 -0
index e2d4125308..4ae561d670 100644
@@ -57,6 +57,10 @@ Deprecation Notices
   ``__atomic_thread_fence`` must be used for patches that need to be

merged in
20.08 onwards. This change will not introduce any performance
degradation.

Quoted 15 lines

+* lib: multiple issues relating to unaligned accesses have been detected using the UBSan checker.
+ As part of resolving those issues, alignment in some structures will be updated in 25.11,
+ namely (but not exhaustively): ``struct rte_stack_lf_head`` and ``struct rte_mp_msg``.
+
* lib: will fix extending some enum/define breaking the ABI. There are
multiple
samples in DPDK that enum/define terminated with a ``.*MAX.*`` value
which is
used by iterators, and arrays holding these values are sized with
this
--
2.50.0

Yes, please.

Acked-by on v1 1/1
#3 lore raw
In reply to David Marchand
Quoted 34 lines

As part of the effort to limit undefined behaviors in DPDK code, some structure alignments revealed not to be accurate enough. At the moment two structures have been identified but others may be found while running more parts of DPDK with UBSan.

Though the calling code can explicitly request alignment, we would prefer to put the alignment constraints as part of the structure definition itself.

Such changes are ABI breakages.

---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -1
index e2d4125308..4ae561d670 100644
@@ -57,6 +57,10 @@ Deprecation Notices
   ``__atomic_thread_fence`` must be used for patches that need to be merged in
   20.08 onwards. This change will not introduce any performance degradation.
 
+* lib: multiple issues relating to unaligned accesses have been detected using the UBSan checker.
+  As part of resolving those issues, alignment in some structures will be updated in 25.11,
+  namely (but not exhaustively): ``struct rte_stack_lf_head`` and ``struct rte_mp_msg``.
+
 * lib: will fix extending some enum/define breaking the ABI. There are multiple
   samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is
   used by iterators, and arrays holding these values are sized with this
--
Quoted 1 line

2.50.0

Acked-by Bruce Richardson Acked-by Morten Brørup Acked-by Konstantin Ananyev on v1 1/1 Applied
#4 lore raw
In reply to David Marchand

09/07/2025 14:40, David Marchand:

Quoted 5 lines

As part of the effort to limit undefined behaviors in DPDK code, some structure alignments revealed not to be accurate enough. At the moment two structures have been identified but others may be found while running more parts of DPDK with UBSan.

Quoted 7 lines

Though the calling code can explicitly request alignment, we would prefer to put the alignment constraints as part of the structure definition itself.

Such changes are ABI breakages.

Applied, thanks.