From: Jiri Pirko <j...@resnulli.us>
Date: Wed, 20 Dec 2017 12:58:13 +0100

> From: Arkadi Sharshevsky <arka...@mellanox.com>
> 
> Add support for hardware resource abstraction over devlink. Each resource
> is identified via id, furthermore it contains information regarding its
> size and its related sub resources. Each resource can also provide its
> current occupancy.
> 
> In some cases the sizes of some resources can be changed, yet for those
> changes to take place a hot driver reload may be needed. The reload
> capability will be introduced in the next patch.
> 
> Signed-off-by: Arkadi Sharshevsky <arka...@mellanox.com>
> Signed-off-by: Jiri Pirko <j...@mellanox.com>

In what units are these sizes?  If it depends upon the resource, it would
be great to have a way to introspect the units given a resource.

> +     struct devlink_resource_ops *resource_ops;

Const?

> +static inline int
> +devlink_resource_register(struct devlink *devlink,
> +                       const char *resource_name,
> +                       bool top_hierarchy,
> +                       u64 resource_size,
> +                       u64 resource_id,
> +                       u64 parent_resource_id,
> +                       struct devlink_resource_ops *resource_ops)

Const for resource_ops?

> +int devlink_resource_register(struct devlink *devlink,
> +                           const char *resource_name,
> +                           bool top_hierarchy,
> +                           u64 resource_size,
> +                           u64 resource_id,
> +                           u64 parent_resource_id,
> +                           struct devlink_resource_ops *resource_ops)

Likewise.

Reply via email to