diff options
author | Arkadi Sharshevsky <arkadis@mellanox.com> | 2018-01-15 10:59:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-16 22:15:34 +0300 |
commit | 2406e7e546b223e8cf42c44ac7352d4d1fd1dbcd (patch) | |
tree | f52c791e9abfca5b0f239ba315d1381af950545f /include/net | |
parent | d98c8ccdebda9de011d3ea29ffb5aac57cd2b69a (diff) | |
download | linux-2406e7e546b223e8cf42c44ac7352d4d1fd1dbcd.tar.xz |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/devlink.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index b9654e133599..4d2c6fc94837 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -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); }; |