mlxsw: spectrum: Define sizes of KVD areas
authorJiri Pirko <jiri@mellanox.com>
Tue, 5 Jul 2016 09:27:46 +0000 (11:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 16:06:30 +0000 (09:06 -0700)
Override the defaults and define the area sizes ourselves.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h

index 9bebb7af4e542c46d280a4b739e7af16b588bd18..c812513e079d678238a77a00ac397e1835791490 100644 (file)
@@ -2356,6 +2356,10 @@ static struct mlxsw_config_profile mlxsw_sp_config_profile = {
        .max_ib_mc                      = 0,
        .used_max_pkey                  = 1,
        .max_pkey                       = 0,
+       .used_kvd_sizes                 = 1,
+       .kvd_linear_size                = MLXSW_SP_KVD_LINEAR_SIZE,
+       .kvd_hash_single_size           = MLXSW_SP_KVD_HASH_SINGLE_SIZE,
+       .kvd_hash_double_size           = MLXSW_SP_KVD_HASH_DOUBLE_SIZE,
        .swid_config                    = {
                {
                        .used_type      = 1,
index 9c2a60f01517843471aaaeb03bd1655c19166a87..f7d34d8ce759009bee80f78c2f72ef3e5e43931b 100644 (file)
 #define MLXSW_SP_BYTES_TO_CELLS(b) DIV_ROUND_UP(b, MLXSW_SP_BYTES_PER_CELL)
 #define MLXSW_SP_CELLS_TO_BYTES(c) (c * MLXSW_SP_BYTES_PER_CELL)
 
+#define MLXSW_SP_KVD_LINEAR_SIZE 65536 /* entries */
+#define MLXSW_SP_KVD_HASH_SINGLE_SIZE 163840 /* entries */
+#define MLXSW_SP_KVD_HASH_DOUBLE_SIZE 32768 /* entries */
+
 /* Maximum delay buffer needed in case of PAUSE frames, in cells.
  * Assumes 100m cable and maximum MTU.
  */