Re: [PATCH net-next v2] net: convert netdev_nl_sock bindings list to xarray

Nikolay Aleksandrov <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On 11/08/2026 17:29, Shivaji Kant wrote:
> netdev_nl_sock previously used a struct list_head bindings to keep
> track of active netdev netlink bindings, protected by a per-socket
> struct mutex lock (priv->lock).
> 
> Since list modifications and iterations are not concurrency-safe,
> priv->lock was introduced to serialize operations on priv->bindings.
> However, xarray manages its own internal locking (xa_lock) for store,
> erase, and iteration operations.
> 
> Convert bindings in struct netdev_nl_sock from struct list_head to
> struct xarray and remove priv->lock. This simplifies the code by
> removing explicit mutex locking in netdev_nl_bind_rx_doit(),
> netdev_nl_bind_tx_doit(), and socket initialization/teardown functions.
> 
> Reviewed-by: Mina Almasry <[email protected]>
> Signed-off-by: Shivaji Kant <[email protected]>
> ---
> v1 -> v2:
>    - Add explicit err_erase_dmabuf_bindings err label in net_devmem_bind_dmabuf()
>      to align cleanup paths with the rest of the function (feedback from reviewer).
> 
> v1: https://lore.kernel.org/all/[email protected]/
> 
>   include/net/netdev_netlink.h |  5 ++---
>   net/core/devmem.c            | 14 +++++++++++---
>   net/core/devmem.h            |  4 ++--
>   net/core/netdev-genl.c       | 25 ++++++-------------------
>   4 files changed, 21 insertions(+), 27 deletions(-)
> 

Reviewed-by: Nikolay Aleksandrov <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.