Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-19 Thread Neeraj Upadhyay
On 9/19/2024 12:16 PM, Linus Torvalds wrote: > On Thu, 19 Sept 2024 at 00:44, Neeraj Upadhyay > wrote: >> >> While we were working on this problem, this refcount scalability issue got >> resolved recently with conditional ref acquisition [3] (however, there are >> new >> developments in appa

RE: [PATCH net-next v2 2/3] selftests: nic_basic_tests: Add selftest case for speed and duplex state checks

2024-09-19 Thread Mohan.Prasad
Hi Willem, Thanks for the review comments. > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > Mohan Prasad J wrote: > > Add selftest case for testing the speed and duplex state of local NIC > > driver and the partner based on the supported link mod

[PATCH v2] mac802154: Fix potential RCU dereference issue in mac802154_scan_worker

2024-09-19 Thread Jiawei Ye
In the `mac802154_scan_worker` function, the `scan_req->type` field was accessed after the RCU read-side critical section was unlocked. According to RCU usage rules, this is illegal and can lead to unpredictable behavior, such as accessing memory that has been updated or causing use-after-free issu

[PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-19 Thread Anjali Kulkarni
Add a new type PROC_CN_MCAST_NOTIFY to proc connector API, which allows a thread to notify the kernel that it has exited abnormally. Thread can also send the exit status code it wants returned in the notification with it. Exiting thread can call this either when it wants to call pthread_exit() with

[PATCH net-next 0/2] Threads extension for process connector

2024-09-19 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is called. I

[PATCH net-next 2/2] connector/cn_proc: Selftest for threads case

2024-09-19 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) to the kernel

Re: [PATCH v3 0/1] Add KUnit tests for llist

2024-09-19 Thread Artur Alves Cavalcante de Barros
On 9/19/24 1:01 PM, Shuah Khan wrote: On 9/16/24 18:51, Artur Alves wrote: Hi all, This is part of a hackathon organized by LKCAMP[1], focused on writing tests using KUnit. We reached out a while ago asking for advice on what would be a useful contribution[2] and ended up choosing data structur

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Jonas Oberhauser
Am 9/19/2024 um 2:12 AM schrieb Jann Horn: On Tue, Sep 17, 2024 at 4:33 PM Boqun Feng wrote: Hazard pointers [1] provide a way to dynamically distribute refcounting and can be used to improve the scalability of refcounting without significant space cost. +static inline void *__hazptr_try

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Alan Huang
2024年9月20日 02:58,Boqun Feng wrote: > > On Thu, Sep 19, 2024 at 09:57:12PM +0800, Alan Huang wrote: > [...] >>> >>> I think you're right. (Although the node will be eventually deleted at >>> cleanup_hazptr_context(), however there could be a long-live >>> hazptr_context). It should be: >>> >>> h

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Boqun Feng
On Thu, Sep 19, 2024 at 09:57:12PM +0800, Alan Huang wrote: [...] > > > > I think you're right. (Although the node will be eventually deleted at > > cleanup_hazptr_context(), however there could be a long-live > > hazptr_context). It should be: > > > > hazptr_t val = smp_load_acquire(&hzcp->slots

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Jonas Oberhauser
Am 9/19/2024 um 8:56 AM schrieb Boqun Feng: On Wed, Sep 18, 2024 at 11:17:37PM +0800, Alan Huang wrote: [...] +#define hazptr_tryprotect(hzp, gp, field) (typeof(gp))__hazptr_tryprotect(hzp, (void **)&(gp), offsetof(typeof(*gp), field)) +#define hazptr_protect(hzp, gp, field) ({ \ + typeof(gp

Re: [PATCH v3 0/1] Add KUnit tests for llist

2024-09-19 Thread Shuah Khan
On 9/16/24 18:51, Artur Alves wrote: Hi all, This is part of a hackathon organized by LKCAMP[1], focused on writing tests using KUnit. We reached out a while ago asking for advice on what would be a useful contribution[2] and ended up choosing data structures that did not yet have tests. This p

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Alan Huang
2024年9月19日 15:10,Boqun Feng wrote: > > On Thu, Sep 19, 2024 at 02:39:13PM +0800, Lai Jiangshan wrote: >> On Tue, Sep 17, 2024 at 10:34 PM Boqun Feng wrote: >> >>> +static void hazptr_context_snap_readers_locked(struct hazptr_reader_tree >>> *tree, >>> +

Re: [PATCH] selftests: Makefile: create OUTPUT dir

2024-09-19 Thread Shuah Khan
On 9/16/24 01:56, Anders Roxell wrote: When cross building kselftest out-of-tree the following issue can be seen: [...] make[4]: Entering directory '/src/kernel/linux/tools/testing/selftests/net/lib' CC csum /usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: c

Re: [PATCH v2] selftests/vDSO: support DT_GNU_HASH

2024-09-19 Thread Shuah Khan
On 9/15/24 00:49, Fangrui Song wrote: glibc added support for DT_GNU_HASH in 2006 and DT_HASH has been obsoleted for more than one decade in many Linux distributions. Many vDSOs support DT_GNU_HASH. This patch adds selftests support. Signed-off-by: Fangrui Song Tested-by: Xi Ruoyao -- Changes

Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors

2024-09-19 Thread Abdellatif El Khlifi
Hi Krzysztof, > >>> + '#extsys-id': > >> > >> '#' is not correct for sure, that's not a cell specifier. > >> > >> But anyway, we do not accept in general instance IDs. > > > > I'm happy to replace the instance ID with another solution. > > In our case the remoteproc instance does not have a bas

Re: [PATCH net v2] selftests: forwarding: Avoid false MDB delete/flush failures

2024-09-19 Thread Ido Schimmel
Hi, Thanks for the patch and sorry for the late reply (was OOO). On Mon, Sep 16, 2024 at 07:49:05PM +1000, Jamie Bainbridge wrote: > Running this test on a small system produces different failures every > test checking deletions, and some flushes. From different test runs: > > TEST: Common host

Re: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-19 Thread Andrew Lunn
On Thu, Sep 19, 2024 at 10:44:11AM +, mohan.pra...@microchip.com wrote: > Hello Andrew, > > Thank you for the suggestion. > > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > > content is safe > > > > > > Since you have batteries included python: > > > > > > > >

Re: [PATCH v4 2/2] selftests/resctrl: Adjust SNC support messages

2024-09-19 Thread Maciej Wieczor-Retman
On 2024-09-17 at 08:32:11 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 8/27/24 1:15 AM, Maciej Wieczor-Retman wrote: >> On 2024-08-12 at 16:40:10 -0700, Reinette Chatre wrote: >> > On 7/12/24 2:04 AM, Maciej Wieczor-Retman wrote: > >> > > + >> > > +if ((get_vendor() == ARCH_INTEL) && snc

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-19 Thread Mateusz Guzik
On Thu, Sep 19, 2024 at 04:14:05AM +0530, Neeraj Upadhyay wrote: > On 9/18/2024 12:48 PM, Linus Torvalds wrote: > > On Tue, 17 Sept 2024 at 16:34, Boqun Feng wrote: > >> > >> This series introduces hazard pointers [1] to kernel space. A TL;DR > >> description of hazard pointers is "a scalable refc

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-19 Thread Linus Torvalds
On Thu, 19 Sept 2024 at 16:15, Christoph Hellwig wrote: > > Agreed. From the description this would seem like a good fit for > q_usage_counter in the block layer, which currently makes creative use > of percpu counters. Yes, if this actually could simplify code that currently used percpu counter

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-19 Thread Christoph Hellwig
On Wed, Sep 18, 2024 at 09:18:43AM +0200, Linus Torvalds wrote: > On Tue, 17 Sept 2024 at 16:34, Boqun Feng wrote: > > > > This series introduces hazard pointers [1] to kernel space. A TL;DR > > description of hazard pointers is "a scalable refcounting mechanim > > with RCU-like API". More informa

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Jonas Oberhauser
Am 9/17/2024 um 4:33 PM schrieb Boqun Feng: +#define hazptr_protect(hzp, gp, field) ({ \ + typeof(gp) ___p;\ + \ + ___p = hazptr_trypro

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Alan Huang
2024年9月19日 15:10,Boqun Feng wrote: > > On Thu, Sep 19, 2024 at 02:39:13PM +0800, Lai Jiangshan wrote: >> On Tue, Sep 17, 2024 at 10:34 PM Boqun Feng wrote: >> >>> +static void hazptr_context_snap_readers_locked(struct hazptr_reader_tree >>> *tree, >>> +

Re: [PATCH net v2] selftests: forwarding: Avoid false MDB delete/flush failures

2024-09-19 Thread Simon Horman
On Mon, Sep 16, 2024 at 07:49:05PM +1000, Jamie Bainbridge wrote: > Running this test on a small system produces different failures every > test checking deletions, and some flushes. From different test runs: > > TEST: Common host entries configuration tests (L2)[FAIL] > Failed t

Re: [PATCH] Fix the RCU usage in mac802154_scan_worker

2024-09-19 Thread Stefan Schmidt
Hello Jiawei, On 9/19/24 14:26, Jiawei Ye wrote: On 9/19/24 17:01, Przemek Kitszel wrote: In the `mac802154_scan_worker` function, the `scan_req->type` field was accessed after the RCU read-side critical section was unlocked. According to RCU usage rules, this is illegal and can lead to unpredi

Re: [RESEND PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-19 Thread Xuan Zhuo
On Thu, 19 Sep 2024 16:13:51 +0800, Wenbo Li wrote: > Currently, the virtio-net driver will perform a pre-dma-mapping for > small or mergeable RX buffer. But for small packets, a mismatched address > without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. > > That will result in unsynchron

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Alan Huang
2024年9月19日 15:10,Boqun Feng wrote: > > On Thu, Sep 19, 2024 at 02:39:13PM +0800, Lai Jiangshan wrote: >> On Tue, Sep 17, 2024 at 10:34 PM Boqun Feng wrote: >> >>> +static void hazptr_context_snap_readers_locked(struct hazptr_reader_tree >>> *tree, >>> +

Re: [PATCH] Fix the RCU usage in mac802154_scan_worker

2024-09-19 Thread Jiawei Ye
On 9/19/24 17:01, Przemek Kitszel wrote: > > In the `mac802154_scan_worker` function, the `scan_req->type` field was > > accessed after the RCU read-side critical section was unlocked. According > > to RCU usage rules, this is illegal and can lead to unpredictable > > behavior, such as accessing me

Re: [PATCH 1/1 V4] selftests: net: improve missing modules error message

2024-09-19 Thread Paolo Abeni
On 9/19/24 10:10, Paolo Abeni wrote: On 9/14/24 18:00, David Hunter wrote: The error message describing the required modules is inaccurate. Currently, only "SKIP: Need act_mirred module" is printed when any of the modules are missing. As a result, users might only include that module; however,

Re: [RFC PATCH] remoteproc: k3-r5: Fix check performed in k3_r5_rproc_{mbox_callback/kick}

2024-09-19 Thread Mathieu Poirier
On Tue, 17 Sept 2024 at 03:13, Kumar, Udit wrote: > > Hi Mathieu, > > On 9/17/2024 2:07 PM, Mathieu Poirier wrote: > > On Mon, 16 Sept 2024 at 23:20, Kumar, Udit wrote: > >> On 9/16/2024 8:50 PM, Mathieu Poirier wrote: > >>> On Mon, 16 Sept 2024 at 02:31, Siddharth Vadapalli > >>> wrote: >

Re: [RFC PATCH] remoteproc: k3-r5: Fix check performed in k3_r5_rproc_{mbox_callback/kick}

2024-09-19 Thread Mathieu Poirier
s On Tue, 17 Sept 2024 at 03:40, Beleswar Prasad Padhi wrote: > > Hi Mathieu, > > On 17/09/24 14:07, Mathieu Poirier wrote: > > On Mon, 16 Sept 2024 at 23:20, Kumar, Udit wrote: > >> On 9/16/2024 8:50 PM, Mathieu Poirier wrote: > >>> On Mon, 16 Sept 2024 at 02:31, Siddharth Vadapalli > >>> wro

Re: [PATCH 1/1 V4] selftests: net: improve missing modules error message

2024-09-19 Thread Paolo Abeni
On 9/14/24 18:00, David Hunter wrote: The error message describing the required modules is inaccurate. Currently, only "SKIP: Need act_mirred module" is printed when any of the modules are missing. As a result, users might only include that module; however, three modules are required. Fix th

RE: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-19 Thread Mohan.Prasad
Hello Andrew, Thank you for the suggestion. > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > > > Since you have batteries included python: > > > > > > ethtool --json enp2s0 > > > [sudo] password for andrew: > > > [ { > > > "ifname": "enp2

Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors

2024-09-19 Thread Abdellatif El Khlifi
Hi Krzysztof, > > Add devicetree binding schema for the External Systems remote processors > > > > The External Systems remote processors are provided on the Corstone-1000 > > IoT Reference Design Platform via the SSE-710 subsystem. > > > > For more details about the External Systems, please see

Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors

2024-09-19 Thread Krzysztof Kozlowski
On 19/09/2024 11:35, Abdellatif El Khlifi wrote: > Hi Krzysztof, > >>> Add devicetree binding schema for the External Systems remote processors >>> >>> The External Systems remote processors are provided on the Corstone-1000 >>> IoT Reference Design Platform via the SSE-710 subsystem. >>> >>> For

Re: [PATCH net v4 0/2] bpf: devmap: provide rxq after redirect

2024-09-19 Thread Paolo Abeni
On 9/11/24 10:41, Florian Kauer wrote: rxq contains a pointer to the device from where the redirect happened. Currently, the BPF program that was executed after a redirect via BPF_MAP_TYPE_DEVMAP* does not have it set. Add bugfix and related selftest. Signed-off-by: Florian Kauer --- Changes i

Re: [PATCH] mac802154: Fix potential RCU dereference issue in mac802154_scan_worker

2024-09-19 Thread Przemek Kitszel
On 9/19/24 09:16, Jiawei Ye wrote: In the `mac802154_scan_worker` function, the `scan_req->type` field was accessed after the RCU read-side critical section was unlocked. According to RCU usage rules, this is illegal and can lead to unpredictable behavior, such as accessing memory that has been u

[RESEND PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-19 Thread Wenbo Li
Currently, the virtio-net driver will perform a pre-dma-mapping for small or mergeable RX buffer. But for small packets, a mismatched address without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. That will result in unsynchronized buffers when SWIOTLB is enabled, for example, when running

Re: [RESEND PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-19 Thread Xuan Zhuo
On Thu, 19 Sep 2024 16:32:45 +0800, Xuan Zhuo wrote: > On Thu, 19 Sep 2024 16:13:51 +0800, Wenbo Li > wrote: > > Currently, the virtio-net driver will perform a pre-dma-mapping for > > small or mergeable RX buffer. But for small packets, a mismatched address > > without VIRTNET_RX_PAD and xdp_h

Re: [PATCH v2 5/5] remoteproc: arm64: corstone1000: Add the External Systems driver

2024-09-19 Thread Mathieu Poirier
On Wed, 18 Sept 2024 at 09:40, Abdellatif El Khlifi wrote: > > Hi Mathieu, > > > Introduce remoteproc support for Corstone-1000 external systems > > > > The Corstone-1000 IoT Reference Design Platform supports up to two > > external systems processors. These processors can be switched on or off >

Re: [PATCH net-next] selftests: net: ioam: add tunsrc support

2024-09-19 Thread Paolo Abeni
On 9/7/24 18:42, Justin Iurman wrote: TL;DR This patch comes from a discussion we had with Jakub and Paolo. This patch updates the IOAM selftests to support the new "tunsrc" feature of IOAM. As a consequence, some changes were required. For example, the IPv6 header must be accessed to check some

Re: [PATCH v1 2/5] dt-bindings: mailbox: add binding for Microchip IPC mailbox driver

2024-09-19 Thread Conor Dooley
On Wed, Sep 18, 2024 at 10:35:58AM -0500, Rob Herring wrote: > On Mon, Sep 16, 2024 at 05:31:36PM +0100, Conor Dooley wrote: > > On Thu, Sep 12, 2024 at 04:23:44PM -0500, Samuel Holland wrote: > > > Hi Valentina, > > > > > > On 2024-09-12 12:00 PM, Valentina Fernandez wrote: > > > > Add a dt-bindi

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Lai Jiangshan
On Tue, Sep 17, 2024 at 10:34 PM Boqun Feng wrote: > +static void hazptr_context_snap_readers_locked(struct hazptr_reader_tree > *tree, > + struct hazptr_context *hzcp) > +{ > + lockdep_assert_held(hzcp->lock); > + > + for (int i = 0; i <

[PATCH] mac802154: Fix potential RCU dereference issue in mac802154_scan_worker

2024-09-19 Thread Jiawei Ye
In the `mac802154_scan_worker` function, the `scan_req->type` field was accessed after the RCU read-side critical section was unlocked. According to RCU usage rules, this is illegal and can lead to unpredictable behavior, such as accessing memory that has been updated or causing use-after-free issu

Re: [RESEND PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-19 Thread Xuan Zhuo
On Thu, 19 Sep 2024 11:52:14 +0800, Wenbo Li wrote: > Currently, the virtio-net driver will perform a pre-dma-mapping for > small or mergeable RX buffer. But for small packets, a mismatched address > without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. > > That will result in unsynchron

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Boqun Feng
On Wed, Sep 18, 2024 at 11:17:37PM +0800, Alan Huang wrote: [...] > > +#define hazptr_tryprotect(hzp, gp, field) > > (typeof(gp))__hazptr_tryprotect(hzp, (void **)&(gp), offsetof(typeof(*gp), > > field)) > > +#define hazptr_protect(hzp, gp, field) ({ \ > > + typeof(gp) ___p; \ > > + \ > > + ___p

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-19 Thread Boqun Feng
On Thu, Sep 19, 2024 at 02:39:13PM +0800, Lai Jiangshan wrote: > On Tue, Sep 17, 2024 at 10:34 PM Boqun Feng wrote: > > > +static void hazptr_context_snap_readers_locked(struct hazptr_reader_tree > > *tree, > > + struct hazptr_context *hzcp) > > +{ >