[PATCH v4 5/5] failsafe: make sub-device remove flag thread-safe

2022-11-29 Thread Luc Pelletier
gned int rather than a bit field. We also now use the atomic built-ins to read/write the value of the remove flag to ensure thread-safety. Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") Cc: Gaetan Rivet Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsa

[PATCH v4 4/5] failsafe: use public APIs in fs_link_update

2022-11-29 Thread Luc Pelletier
lsafe device. Fixes: ae80146c5a1b ("net/failsafe: fix removed device handling") Cc: Matan Azrad Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ops.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/drive

[PATCH v4 3/5] failsafe: fix double release of port

2022-11-29 Thread Luc Pelletier
ng done in rte_eth_dev_release_port). Fixes: fac0ae546e5f ("net/failsafe: free port by dedicated function") Cc: Matan Azrad Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ether.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/fails

[PATCH v4 2/5] failsafe: use public rx/tx burst API

2022-11-29 Thread Luc Pelletier
-by: Luc Pelletier --- drivers/net/failsafe/failsafe_rxtx.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c index 707fe60a36..6d8ab0a6e7 100644 --- a/drivers/net/failsafe/failsafe_rxtx.c +++ b

[PATCH v4 1/5] failsafe: fix segfault on hotplug event

2022-11-29 Thread Luc Pelletier
rmance. Fixes: 7a0935239b9e ("ethdev: make fast-path functions to use new flat array") Cc: Konstantin Ananyev Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ether.c | 2 - drivers/net/failsafe/failsafe_private.h | 8 --- drivers/net/failsafe

[PATCH v4 0/5] Failsafe bug fixes and improvements

2022-11-29 Thread Luc Pelletier
v2: * fixed git commit hashes in commit message v3: * address comments / split into several commits v4: * fix checkpatch warnings Luc Pelletier (5): failsafe: fix segfault on hotplug event failsafe: use public rx/tx burst API failsafe: fix double release of port failsafe: use public APIs

[PATCH v3 5/5] failsafe: make sub-device remove flag thread-safe

2022-11-29 Thread Luc Pelletier
gned int rather than a bit field. We also now use the atomic built-ins to read/write the value of the remove flag to ensure thread-safety. Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") Cc: Gaetan Rivet Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsa

[PATCH v3 4/5] failsafe: use public APIs in fs_link_update

2022-11-29 Thread Luc Pelletier
lsafe device. Fixes: ae80146c5a1b ("net/failsafe: fix removed device handling") Cc: Matan Azrad Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ops.c | 38 ++--- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drive

[PATCH v3 2/5] failsafe: use public rx/tx burst API

2022-11-29 Thread Luc Pelletier
-by: Luc Pelletier --- drivers/net/failsafe/failsafe_rxtx.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c index 707fe60a36..6d8ab0a6e7 100644 --- a/drivers/net/failsafe/failsafe_rxtx.c +++ b

[PATCH v3 3/5] failsafe: fix double release of port

2022-11-29 Thread Luc Pelletier
ng done in rte_eth_dev_release_port). Fixes: fac0ae546e5f ("net/failsafe: free port by dedicated function") Cc: Matan Azrad Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ether.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/fails

[PATCH v3 1/5] failsafe: fix segfault on hotplug event

2022-11-29 Thread Luc Pelletier
rmance. Fixes: 7a0935239b9e ("ethdev: make fast-path functions to use new flat array") Cc: Konstantin Ananyev Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- drivers/net/failsafe/failsafe_ether.c | 2 - drivers/net/failsafe/failsafe_private.h | 8 --- drivers/net/failsafe

[PATCH v3 0/5] Failsafe bug fixes and improvements

2022-11-29 Thread Luc Pelletier
Following the comments on v1 and v2 of the patch, I've tried to address all issues that were mentioned. I've also fixed other issues discovered during testing. I've split the changes into several commits. Please note that only the bug fix commits have been marked for back-porting

Re: [PATCH] failsafe: fix segfault on hotplug event

2022-11-16 Thread Luc Pelletier
Hi Konstantin, > It is not recommended way to update rte_eth_fp_ops[] contents directly. > There are eth_dev_fp_ops_setup()/ eth_dev_fp_ops_reset() that supposed > to be used for that. Good to know. I see another fix that was made in a different PMD that does exactly the same thing: https://gith

[PATCH v2] failsafe: fix segfault on hotplug event

2022-11-10 Thread Luc Pelletier
ns should have been used. To fix the problem, the failsafe PMD code was changed to update the function pointers in the rte_eth_fp_ops array when a hotplug event occurs. Fixes: 7a0935239b9e ("ethdev: make fast-path functions to use new flat array") Cc: Konstantin Ananyev Cc: sta...@dpdk.or

[PATCH] failsafe: fix segfault on hotplug event

2022-11-10 Thread Luc Pelletier
have been used. To fix the problem, the failsafe PMD code was changed to update the function pointers in the rte_eth_fp_ops array when a hotplug event occurs. Fixes: 7a0935239b ("ethdev: make fast-path functions to use new flat array") Cc: Konstantin Ananyev Cc: sta...@dpdk.

Re: [PATCH v7] eal: fix rte_memcpy strict aliasing/alignment bugs

2022-05-13 Thread Luc Pelletier
Hi David, > > Actually, looking again at the history, it fixes: > > Fixes: f5472703c0bd ("eal: optimize aligned memcpy on x86") > > Nop, that's probably even older, could you double check? > I'll hold on pushing this fix. It seems you still haven't received a response. I'll take a stab at this.

Re: [PATCH v7] eal: fix rte_memcpy strict aliasing/alignment bugs

2022-04-08 Thread Luc Pelletier
Hi David, Le jeu. 7 avr. 2022 à 11:24, David Marchand a écrit : > > 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? As far as I'm aware, there is no silver bullet to detect all strict aliasing violat

[PATCH v7] eal: fix rte_memcpy strict aliasing/alignment bugs

2022-02-25 Thread Luc Pelletier
/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: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- v7: * Fix co

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

2022-02-25 Thread Luc Pelletier
Hi, This patch can be abandoned. As indicated in another thread (http://mails.dpdk.org/archives/dev/2022-February/234889.html), there is no requirement/desire to make this change. Thanks. Le sam. 15 janv. 2022 à 14:39, Luc Pelletier a écrit : > > Calls to rte_memcpy_aligned could res

[PATCH v6] eal: fix rte_memcpy strict aliasing/alignment bugs

2022-02-25 Thread Luc Pelletier
/store operations. This results in code that has the same performance as the original code and that is also C standard-compliant. Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- v6: * Refoc

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-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-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-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

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

2022-01-25 Thread Luc Pelletier
Hi Georg, > perhaps it's worth mentioning that the Linux Kernel is compiled with > -fno-strict-aliasing, because it contains code which violates the C > strict aliasing rules. Such code yields undefined behavior and is thus > unsafe when compiling with optmizing compilers such as GCC and Clang, by

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

2022-01-17 Thread Luc Pelletier
d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Thanks to Stephen's pointer to look at the linux kernel, I was able to find a way to perform the unaligned load/store using pure C code. The new

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

2022-01-16 Thread Luc Pelletier
86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Added volatile for asm statements. I had been testing with clang and it was working but it seems gcc requires this, otherwise the asm is completely discarded by the optimizer. The

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

2022-01-16 Thread Luc Pelletier
lp in making improvements. Le dim. 16 janv. 2022 à 09:15, Luc Pelletier a écrit : > > 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

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

2022-01-16 Thread Luc Pelletier
86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Please note that I didn't write the entire function in inline assembly. The reason why I kept the bitwise ands as C code is so the optimizer can remove the branches when n is k

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

2022-01-16 Thread Luc Pelletier
> X86 always allows unaligned access. Irregardless of what tools say. > Why impose additional overhead in performance critical code. Let me preface my response by saying that I'm not a C compiler developer. Hopefully someone who is will read this and chime in. I agree that X86 allows unaligned st

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

2022-01-15 Thread Luc Pelletier
produce even more optimized results. Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- I forgot that code under x86 also needs to compile for 32-bit (obviously). So, I did some more experiment

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

2022-01-15 Thread Luc Pelletier
select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- I have just submitted another patch related to rte_memcpy. The changes in the other patch are straightforward. The changes in this patch are likely to require more discussion, so I&#

[PATCH] eal: fix unaligned loads/stores in rte_memcpy_aligned

2022-01-15 Thread Luc Pelletier
ue. Fixes: d35cc1fe6a7a ("eal/x86: revert select optimized memcpy at run-time") Cc: Xiaoyun Li Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- lib/eal/x86/include/rte_memcpy.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/eal/x86/includ

Re: [dpdk-dev] [RFC] eal: simplify the implementation of rte_ctrl_thread_create

2021-08-25 Thread Luc Pelletier
Hi Honnappa, (Sorry if you get this message twice, I forgot to reply all the first time) Sorry for the late reply. I was also away. I have only made one small contribution to DPDK so I'll defer to others to decide whether this patch should be accepted. When I submitted my patch, I got the feelin

Re: [dpdk-dev] 19.11.9 patches review and test - V2

2021-06-14 Thread Luc Pelletier
> > # Basic Intel(R) NIC testing > > * PF(i40e, ixgbe): test scenarios including > > rte_flow/TSO/Jumboframe/checksum offload/Tunnel, etc. Listed but not all. > > - Known issues as below: > > 1) https://bugs.dpdk.org/show_bug.cgi?id=731 – [dpdk-19.11.9] > > telemetry: python3 /roo

Re: [dpdk-dev] [PATCH 2/2] eal: fix hang in ctrl thread creation error logic

2021-04-08 Thread Luc Pelletier
l. I opted not to but it seems like I should have. If it's a problem, please let me know and I'll repost them with 'v8'. Le jeu. 8 avr. 2021 à 10:20, Olivier Matz a écrit : > > Hi Luc, > > On Wed, Apr 07, 2021 at 04:16:06PM -0400, Luc Pelletier wrote: > > The

[dpdk-dev] [PATCH 2/2] eal: fix hang in ctrl thread creation error logic

2021-04-07 Thread Luc Pelletier
o that the control thread exits gracefully if the affinity cannot be set successfully and removes the call to pthread_cancel. Fixes: 6383d26 ("eal: set name when creating a control thread") Cc: olivier.m...@6wind.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivi

[dpdk-dev] [PATCH 1/2] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
: 3a0d465 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivier, Hi Honnappa, As discussed, I've split the changes into 2 patches. This first commit fixes the race condition but leaves in the pthr

[dpdk-dev] [PATCH v7] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivier, Olivier, thanks for pointing out that pthread_barrier_wait acts as a full memory barrier; I didn't know that was explicitly s

[dpdk-dev] [PATCH v6] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivier, I've made the changes as you requested. However, I'm using the atomic built-ins for reading and writing start_rout

Re: [dpdk-dev] [PATCH v5] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
Not directly related to this patch, but can someone please explain why Patchwork is creating a new series everytime I post a new version of the patch to this thread? I must be doing something wrong but I don't know what it is. I have been using --in-reply-to with git send-email but that's apparentl

[dpdk-dev] [PATCH v5] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Same as v4 except that I fixed 2 minor style issues flagged by patchwork. lib/librte_eal/common/eal_common_thread.c | 52 +++--

[dpdk-dev] [PATCH v4] eal: fix race in ctrl thread creation

2021-04-07 Thread Luc Pelletier
: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivier, Hi Honnappa, Thanks for your comments Honnappa. You make a very good point about the cancellation point requirements. I'

[dpdk-dev] [PATCH v3] eal: fix race in ctrl thread creation

2021-04-06 Thread Luc Pelletier
has been completely removed in favour of a reference count on the control thread parameters struct. Fixes: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- Hi Olivier, Hi Honnappa, Thank

[dpdk-dev] [PATCH v3] eal: fix possible UB on creation of ctrl thread

2021-04-06 Thread Luc Pelletier
Hi Olivier, Hi Honnappa, Thanks for your input Honnappa. I've made the changes to completely remove the barrier. However, I have not moved the call to pthread_setaffinity_np to the control thread; I think we still want to report the result of this function to the caller of rte_ctrl_thread_create

Re: [dpdk-dev] [PATCH v2] eal: fix race in ctrl thread creation

2021-03-25 Thread Luc Pelletier
s: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") > Cc: jianfeng....@intel.com > Cc: sta...@dpdk.org > > Reported-by: Luc Pelletier > Signed-off-by: David Marchand > Signed-off-by: Olivier Matz > --- > > Hi Luc, > > Thank you for rep

[dpdk-dev] [PATCH] eal: fix possible UB on creation of ctrl thread

2021-03-24 Thread Luc Pelletier
: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation") Cc: jianfeng@intel.com Cc: sta...@dpdk.org Signed-off-by: Luc Pelletier --- lib/librte_eal/common/eal_common_thread.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/librte_