aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/devlink.h
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2018-07-12 15:13:08 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-12 17:37:12 -0700
commitb16ebe925a4400a2ec3dc663c81dce2fd9bf0998 (patch)
tree7af2cc8202b3667e864820e2a9dbe3f0cd071cae /include/net/devlink.h
parentMerge branch 'mvpp2-add-RSS-support' (diff)
downloadlinux-dev-b16ebe925a4400a2ec3dc663c81dce2fd9bf0998.tar.xz
linux-dev-b16ebe925a4400a2ec3dc663c81dce2fd9bf0998.zip
devlink: Add support for creating and destroying regions
This allows a device to register its supported address regions. Each address region can be accessed directly for example reading the snapshots taken of this address space. Drivers are not limited in the name selection for different regions. An example of a region-name can be: pci cr-space, register-space. 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.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h
index f67c29cede15..e5397652f2fb 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -28,6 +28,7 @@ struct devlink {
struct list_head dpipe_table_list;
struct list_head resource_list;
struct list_head param_list;
+ struct list_head region_list;
struct devlink_dpipe_headers *dpipe_headers;
const struct devlink_ops *ops;
struct device *dev;
@@ -397,6 +398,8 @@ enum devlink_param_generic_id {
.validate = _validate, \
}
+struct devlink_region;
+
struct devlink_ops {
int (*reload)(struct devlink *devlink, struct netlink_ext_ack *extack);
int (*port_type_set)(struct devlink_port *devlink_port,
@@ -543,6 +546,11 @@ int devlink_param_driverinit_value_get(struct devlink *devlink, u32 param_id,
int devlink_param_driverinit_value_set(struct devlink *devlink, u32 param_id,
union devlink_param_value init_val);
void devlink_param_value_changed(struct devlink *devlink, u32 param_id);
+struct devlink_region *devlink_region_create(struct devlink *devlink,
+ const char *region_name,
+ u32 region_max_snapshots,
+ u64 region_size);
+void devlink_region_destroy(struct devlink_region *region);
#else
@@ -770,6 +778,20 @@ devlink_param_value_changed(struct devlink *devlink, u32 param_id)
{
}
+static inline struct devlink_region *
+devlink_region_create(struct devlink *devlink,
+ const char *region_name,
+ u32 region_max_snapshots,
+ u64 region_size)
+{
+ return NULL;
+}
+
+static inline void
+devlink_region_destroy(struct devlink_region *region)
+{
+}
+
#endif
#endif /* _NET_DEVLINK_H_ */