From: Ido Schimmel <idosch@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jiri@mellanox.com, petrm@mellanox.com,
dsahern@gmail.com, mlxsw@mellanox.com,
Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH v2 net-next 10/10] mlxsw: spectrum: Don't use resource ID of 0
Date: Sun, 1 Apr 2018 17:34:59 +0300 [thread overview]
Message-ID: <20180401143459.30770-11-idosch@mellanox.com> (raw)
In-Reply-To: <20180401143459.30770-1-idosch@mellanox.com>
From: Petr Machata <petrm@mellanox.com>
In commit 145307460ba9 ("devlink: Remove top_hierarchy arg to
devlink_resource_register"), the "top_hierarchy" parameter to
devlink_resource_register() was removed in favor of using the parameter
"parent_resource_id" exclusively to determine who the parent is. The
root node's resource ID for this purpose is
DEVLINK_RESOURCE_ID_PARENT_TOP with the value 0. It is therefore
problematic that the resource MLXSW_SP_RESOURCE_KVD has also ID of 0.
Fix this by numbering driver-specific resources from 1.
Fixes: 145307460ba9 ("devlink: Remove top_hierarchy arg to devlink_resource_register")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index c4d47e456737..82820ba43728 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -75,7 +75,7 @@
#define MLXSW_SP_RESOURCE_NAME_KVD_LINEAR_LARGE_CHUNKS "large_chunks"
enum mlxsw_sp_resource_id {
- MLXSW_SP_RESOURCE_KVD,
+ MLXSW_SP_RESOURCE_KVD = 1,
MLXSW_SP_RESOURCE_KVD_LINEAR,
MLXSW_SP_RESOURCE_KVD_HASH_SINGLE,
MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,
--
2.14.3
next prev parent reply other threads:[~2018-04-01 14:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-01 14:34 [PATCH v2 net-next 00/10] mlxsw: Various cleanups Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 01/10] mlxsw: spectrum_acl: Fix flex actions header ifndef define construct Ido Schimmel
2018-04-05 1:33 ` Sasha Levin
2018-04-08 6:46 ` Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 02/10] mlxsw: spectrum_kvdl: Fix handling of resource_size_param Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 03/10] mlxsw: Constify devlink_resource_ops Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 04/10] mlxsw: spectrum: Change KVD linear parts from list to array Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 05/10] mlxsw: remove kvd_hash_granularity from config profile struct Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 06/10] mlxsw: core: Fix arg name of MLXSW_CORE_RES_VALID and MLXSW_CORE_RES_GET Ido Schimmel
2018-04-05 1:33 ` Sasha Levin
2018-04-08 6:47 ` Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 07/10] mlxsw: Move "used_kvd_sizes" check to mlxsw_pci_config_profile Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 08/10] mlxsw: Move "resources_query_enable" out of mlxsw_config_profile Ido Schimmel
2018-04-01 14:34 ` [PATCH v2 net-next 09/10] mlxsw: spectrum: Pass mlxsw_core as arg of mlxsw_sp_kvdl_resources_register() Ido Schimmel
2018-04-01 14:34 ` Ido Schimmel [this message]
2018-04-01 15:26 ` [PATCH v2 net-next 10/10] mlxsw: spectrum: Don't use resource ID of 0 David Ahern
2018-04-01 15:24 ` [PATCH v2 net-next 00/10] mlxsw: Various cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180401143459.30770-11-idosch@mellanox.com \
--to=idosch@mellanox.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=jiri@mellanox.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).