netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, mlxsw@mellanox.com
Subject: [patch net-next 8/8] mlxsw: spectrum: Add another partition to KVD linear
Date: Sun, 22 Oct 2017 23:11:50 +0200	[thread overview]
Message-ID: <20171022211150.2567-9-jiri@resnulli.us> (raw)
In-Reply-To: <20171022211150.2567-1-jiri@resnulli.us>

From: Ido Schimmel <idosch@mellanox.com>

The KVD linear is currently partitioned into two partitions. One for
single entries and another for groups of 32 entries.

Add another partition consisting of groups of 512 entries which will
allow us to more accurately represent the nexthop weights in non-equal
cost multi-path routing.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c
index 266b3af..310c382 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c
@@ -41,13 +41,22 @@
 #define MLXSW_SP_KVDL_SINGLE_SIZE 16384
 #define MLXSW_SP_KVDL_SINGLE_END \
 	(MLXSW_SP_KVDL_SINGLE_SIZE + MLXSW_SP_KVDL_SINGLE_BASE - 1)
+
 #define MLXSW_SP_KVDL_CHUNKS_BASE \
 	(MLXSW_SP_KVDL_SINGLE_BASE + MLXSW_SP_KVDL_SINGLE_SIZE)
-#define MLXSW_SP_KVDL_CHUNKS_SIZE \
-	(MLXSW_SP_KVD_LINEAR_SIZE - MLXSW_SP_KVDL_CHUNKS_BASE)
+#define MLXSW_SP_KVDL_CHUNKS_SIZE 49152
 #define MLXSW_SP_KVDL_CHUNKS_END \
 	(MLXSW_SP_KVDL_CHUNKS_SIZE + MLXSW_SP_KVDL_CHUNKS_BASE - 1)
+
+#define MLXSW_SP_KVDL_LARGE_CHUNKS_BASE \
+	(MLXSW_SP_KVDL_CHUNKS_BASE + MLXSW_SP_KVDL_CHUNKS_SIZE)
+#define MLXSW_SP_KVDL_LARGE_CHUNKS_SIZE \
+	(MLXSW_SP_KVD_LINEAR_SIZE - MLXSW_SP_KVDL_LARGE_CHUNKS_BASE)
+#define MLXSW_SP_KVDL_LARGE_CHUNKS_END \
+	(MLXSW_SP_KVDL_LARGE_CHUNKS_SIZE + MLXSW_SP_KVDL_LARGE_CHUNKS_BASE - 1)
+
 #define MLXSW_SP_CHUNK_MAX 32
+#define MLXSW_SP_LARGE_CHUNK_MAX 512
 
 struct mlxsw_sp_kvdl_part_info {
 	unsigned int part_index;
@@ -192,6 +201,12 @@ static const struct mlxsw_sp_kvdl_part_info kvdl_parts_info[] = {
 		.end_index	= MLXSW_SP_KVDL_CHUNKS_END,
 		.alloc_size	= MLXSW_SP_CHUNK_MAX,
 	},
+	{
+		.part_index	= 2,
+		.start_index	= MLXSW_SP_KVDL_LARGE_CHUNKS_BASE,
+		.end_index	= MLXSW_SP_KVDL_LARGE_CHUNKS_END,
+		.alloc_size	= MLXSW_SP_LARGE_CHUNK_MAX,
+	},
 };
 
 static struct mlxsw_sp_kvdl_part *
-- 
2.9.5

  parent reply	other threads:[~2017-10-22 21:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 21:11 [patch net-next 0/8] mlxsw: Add support for non-equal-cost multi-path Jiri Pirko
2017-10-22 21:11 ` [patch net-next 1/8] mlxsw: spectrum_dpipe: Add adjacency group size Jiri Pirko
2017-10-22 21:11 ` [patch net-next 2/8] mlxsw: spectrum: Better represent KVDL partitions Jiri Pirko
2017-10-22 21:11 ` [patch net-next 3/8] mlxsw: spectrum: Add ability to query KVDL allocation size Jiri Pirko
2017-10-22 21:11 ` [patch net-next 4/8] mlxsw: spectrum_router: Store weight in nexthop struct Jiri Pirko
2017-10-22 21:11 ` [patch net-next 5/8] mlxsw: spectrum_router: Prepare for large adjacency groups Jiri Pirko
2017-10-22 21:11 ` [patch net-next 6/8] mlxsw: spectrum_router: Populate adjacency entries according to weights Jiri Pirko
2017-10-22 21:11 ` [patch net-next 7/8] mlxsw: spectrum: Increase number of linear entries Jiri Pirko
2017-10-22 21:11 ` Jiri Pirko [this message]
2017-10-23  4:27 ` [patch net-next 0/8] mlxsw: Add support for non-equal-cost multi-path 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=20171022211150.2567-9-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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).