summaryrefslogtreecommitdiffstats
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorAlex Vesker2018-07-12 14:13:09 +0200
committerDavid S. Miller2018-07-13 02:37:12 +0200
commitccadfa444b34c6ec7bb458eee17fdd8c9a456c63 (patch)
treeadb65c4f7fde4d7563889d9f89774c7097c3aaa0 /include/net/devlink.h
parentdevlink: Add support for creating and destroying regions (diff)
downloadkernel-qcow2-linux-ccadfa444b34c6ec7bb458eee17fdd8c9a456c63.tar.gz
kernel-qcow2-linux-ccadfa444b34c6ec7bb458eee17fdd8c9a456c63.tar.xz
kernel-qcow2-linux-ccadfa444b34c6ec7bb458eee17fdd8c9a456c63.zip
devlink: Add callback to query for snapshot id before snapshot create
To restrict the driver with the snapshot ID selection a new callback is introduced for the driver to get the snapshot ID before creating a new snapshot. This will also allow giving the same ID for multiple snapshots taken of different regions on the same time. Signed-off-by: Alex Vesker <valex@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/devlink.h')
-rw-r--r--include/net/devlink.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index e5397652f2fb..f27d8593687a 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -29,6 +29,7 @@ struct devlink {
struct list_head resource_list;
struct list_head param_list;
struct list_head region_list;
+ u32 snapshot_id;
struct devlink_dpipe_headers *dpipe_headers;
const struct devlink_ops *ops;
struct device *dev;
@@ -551,6 +552,7 @@ struct devlink_region *devlink_region_create(struct devlink *devlink,
u32 region_max_snapshots,
u64 region_size);
void devlink_region_destroy(struct devlink_region *region);
+u32 devlink_region_shapshot_id_get(struct devlink *devlink);
#else
@@ -792,6 +794,12 @@ devlink_region_destroy(struct devlink_region *region)
{
}
+static inline u32
+devlink_region_shapshot_id_get(struct devlink *devlink)
+{
+ return 0;
+}
+
#endif
#endif /* _NET_DEVLINK_H_ */