RE: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-14 Thread Ananyev, Konstantin
Hi Luc, > > Indeed it looks like a problem. > > Thanks for pointing it out. > > Was able to reproduce it with gcc 11 (clang 13 seems fine). > > Actually, adding ' __attribute__ ((__may_alias__))' for both dst and src > > didn't quire the problem. > > __may_alias__ works if it's applied to a typ

Re: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-13 Thread Luc Pelletier
Hi Konstantin, > Indeed it looks like a problem. > Thanks for pointing it out. > Was able to reproduce it with gcc 11 (clang 13 seems fine). > Actually, adding ' __attribute__ ((__may_alias__))' for both dst and src > didn't quire the problem. __may_alias__ works if it's applied to a typedef, see

RE: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-11 Thread Ananyev, Konstantin
> > Not sure I understand the problem you are referring to. > > Are you saying that original rte_memcpy() code breaks strict aliasing? > > If so, could you point where exactly? > > As far as I understand, yes, it does break strict aliasing. For > example, in the following line: > > *(uint64_t *)d

Re: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-10 Thread Luc Pelletier
Hi Konstantin, > > Thanks for your input Konstantin. Much appreciated. Just to make sure > > I understand, can you please confirm that we do not want to fix the > > fact that unaligned access in C is undefined behaviour? > > Yes, I don't think it is a real problem in that particular case. Perfect

RE: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-10 Thread Ananyev, Konstantin
Hi Luc, > > > 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 ad

Re: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-09 Thread Luc Pelletier
> > 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

Re: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-08 Thread Thomas Monjalon
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

RE: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-04 Thread 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

Re: [PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-02-04 Thread Luc Pelletier
Hi, It's been several days and I haven't received any additional feedback on this patch (and the other patch related to this one: http://mails.dpdk.org/archives/dev/2022-January/232491.html). I would welcome any kind of feedback. Ideally, I'm hoping an authoritative voice would indicate if there's

[PATCH v5] eal: fix unaligned loads/stores in rte_memcpy_generic

2022-01-17 Thread Luc Pelletier
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 wou