Thread (13 messages) 13 messages, 6 authors, 2025-05-22

Re: [PATCH net-next 5/5] net/mlx5e: Convert mlx5 netdevs to instance locking

flat view

From: Stanislav Fomichev <hidden>
Date: 2025-05-22 15:28:48
Also in: bpf, linux-rdma, lkml

On 05/21, Cosmin Ratiu wrote:
On Wed, 2025-05-21 at 11:27 -0700, Stanislav Fomichev wrote:
quoted
On 05/21, Tariq Toukan wrote:
quoted
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index 0979d672d47f..79ae3a51a4b3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -32,6 +32,7 @@
 
 #include <rdma/ib_verbs.h>
 #include <linux/mlx5/fs.h>
+#include <net/netdev_lock.h>
 #include "en.h"
 #include "en/params.h"
 #include "ipoib.h"
@@ -102,6 +103,8 @@ int mlx5i_init(struct mlx5_core_dev *mdev,
struct net_device *netdev)
 
 	netdev->netdev_ops = &mlx5i_netdev_ops;
 	netdev->ethtool_ops = &mlx5i_ethtool_ops;
+	netdev->request_ops_lock = true;
+	netdev_lockdep_set_classes(netdev);
 
 	return 0;
 }
Out of curiosity: any reason this is part of patch 5 and not patch 4?
If you're referring to enabling instance locking in
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c and by patch 5
you meant patch 3, this part cannot be submitted separately from the
other changes in this patch, as without all of the changes we'd either
get assertion failures from missing the instance lock or deadlocks
(e.g. from using the dev_* instead of netif_* functions).

As I tried to explain in the description, I couldn't figure out a way
to split this change into smaller units, as the call graph looks like a
ball of hair spit out by a cat.
SG, thanks for clarifying!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help