From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [patch net-next 02/10] devlink: Add support for resource abstraction Date: Wed, 20 Dec 2017 14:43:58 -0500 (EST) Message-ID: <20171220.144358.1892414104907740492.davem@davemloft.net> References: <20171220115821.22171-1-jiri@resnulli.us> <20171220115821.22171-3-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, arkadis@mellanox.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, ast@kernel.org, daniel@iogearbox.net, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, alexander.h.duyck@intel.com, linville@tuxdriver.com, gospo@broadcom.com, steven.lin1@broadcom.com, yuvalm@mellanox.com, ogerlitz@mellanox.com, dsa@cumulusnetworks.com, roopa@cumulusnetworks.com To: jiri@resnulli.us Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:43126 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756430AbdLTToC (ORCPT ); Wed, 20 Dec 2017 14:44:02 -0500 In-Reply-To: <20171220115821.22171-3-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko Date: Wed, 20 Dec 2017 12:58:13 +0100 > From: Arkadi Sharshevsky > > 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 > Signed-off-by: Jiri Pirko 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.