On Thu, Mar 10, 2022 at 3:55 PM Ananyev, Konstantin
<[email protected]> wrote:
> > Calls to rte_memcpy for 1 < n < 16 could result in unaligned
> > loads/stores, which is undefined behaviour according to the C
> > standard, and strict aliasing violations.
> >
> > The code was changed to use a packed structure that allows aliasing
> > (using the __may_alias__ attribute) to perform the load/store
> > operations. This results in code that has the same performance as the
> > original code and that is also C standards-compliant.
> >
> > Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time")
> > Cc: [email protected]
> >
> > Signed-off-by: Luc Pelletier <[email protected]>
> Acked-by: Konstantin Ananyev <[email protected]>
> Tested-by: Konstantin Ananyev <[email protected]>

Thanks, applied.


> As a side note, we probably need to check other similar places in DPDK code.

What would be the best way to detect those problematic places?

I tried UBsan, and it did report some of the issues fixed with this patch.


-- 
David Marchand

Reply via email to