Skip to content

Commit 2406e7e

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
devlink: Add per devlink instance lock
This is a preparation before introducing resources and hot reload support. Currently there are two global lock where one protects all devlink access, and the second one protects devlink port access. This patch adds per devlink instance lock which protects the internal members which are the sb/dpipe/ resource/ports. By introducing this lock the global devlink port lock can be discarded. Signed-off-by: Arkadi Sharshevsky <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d98c8cc commit 2406e7e

File tree

2 files changed

+78
-59
lines changed

2 files changed

+78
-59
lines changed

include/net/devlink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct devlink {
3030
const struct devlink_ops *ops;
3131
struct device *dev;
3232
possible_net_t _net;
33+
struct mutex lock;
3334
char priv[0] __aligned(NETDEV_ALIGN);
3435
};
3536

0 commit comments

Comments
 (0)