[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171114235954.3f5d15a8@cakuba>
Date: Tue, 14 Nov 2017 23:59:54 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, mlxsw@...lanox.com,
andrew@...n.ch, vivien.didelot@...oirfairelinux.com,
f.fainelli@...il.com, michael.chan@...adcom.com,
ganeshgr@...lsio.com, saeedm@...lanox.com, matanb@...lanox.com,
leonro@...lanox.com, idosch@...lanox.com, ast@...nel.org,
daniel@...earbox.net, simon.horman@...ronome.com,
pieter.jansenvanvuuren@...ronome.com, john.hurley@...ronome.com,
alexander.h.duyck@...el.com, linville@...driver.com,
gospo@...adcom.com, steven.lin1@...adcom.com, yuvalm@...lanox.com,
ogerlitz@...lanox.com, dsa@...ulusnetworks.com,
roopa@...ulusnetworks.com
Subject: Re: [patch net-next RFC v2 02/11] devlink: Add support for resource
abstraction
On Tue, 14 Nov 2017 17:18:43 +0100, Jiri Pirko wrote:
> From: Arkadi Sharshevsky <arkadis@...lanox.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 <arkadis@...lanox.com>
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> ---
> include/net/devlink.h | 80 +++++++++++
> include/uapi/linux/devlink.h | 10 ++
> net/core/devlink.c | 330 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 420 insertions(+)
>
> diff --git a/include/net/devlink.h b/include/net/devlink.h
> index 4d2c6fc..960e80a 100644
> --- a/include/net/devlink.h
> +++ b/include/net/devlink.h
> @@ -224,6 +225,45 @@ struct devlink_dpipe_headers {
> unsigned int headers_count;
> };
>
> +/**
> + * struct devlink_resource_ops - resource ops
> + * @occ_get - get the occupied size
> + * @size_validate - validate the size of the resource before update, reload
nit:
@member: is more common and used throughout this file, rather than
@member -
> + * is needed for changes to take place
> + */
> +struct devlink_resource_ops {
> + u64 (*occ_get)(struct devlink *devlink);
> + int (*size_validate)(struct devlink *devlink, u64 size,
> + struct list_head *resource_list,
> + struct netlink_ext_ack *extack);
> +};
Powered by blists - more mailing lists