Skip to content

Commit

Permalink
devlink: Add per devlink instance lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arkadi Sharshevsky authored and David S. Miller committed Jan 16, 2018
1 parent d98c8cc commit 2406e7e
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 59 deletions.
1 change: 1 addition & 0 deletions include/net/devlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
Loading

0 comments on commit 2406e7e

Please sign in to comment.