04/02/2022 18:16, Ananyev, Konstantin: > > > Calls to rte_memcpy_generic could result in unaligned loads/stores for > > 1 < n < 16. This is undefined behavior according to the C standard, > > and it gets flagged by the clang undefined behavior sanitizer. > > > > rte_memcpy_generic is called with unaligned src and dst addresses. > > When 1 < n < 16, the code would cast both src and dst to a qword, > > dword or word pointer, without verifying the alignment of src/dst. The > > code was changed to use a packed structure to perform the unaligned > > load/store operations. This results in unaligned load/store operations > > to be C standards-compliant. > > Still not sure we need to fix that: > This is x86 specific code-path, and as I remember on x86 there are no > penalties for unaligned access to 2/4/8 byte values. > Though I like introduction of rte_mov15_or_less() function -t helps > with code dedup.
Any more opinions?