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 <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d98c8ccdeb
commit
2406e7e546
@@ -30,6 +30,7 @@ struct devlink {
|
||||
const struct devlink_ops *ops;
|
||||
struct device *dev;
|
||||
possible_net_t _net;
|
||||
struct mutex lock;
|
||||
char priv[0] __aligned(NETDEV_ALIGN);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user