]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mlxsw: Add KVD sizes configuration into profile
authorJiri Pirko <jiri@mellanox.com>
Tue, 5 Jul 2016 09:27:45 +0000 (11:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 16:06:29 +0000 (09:06 -0700)
Up until now we only used hash-based tables in the device, but we are
going to use the linear table for remote routes adjacency lists.

Add the configuration fields that control the size of the linear table.

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/cmd.h
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/pci.c

index cd63b82636888a2c7e9a90f41a00a8d96b28ae6f..f9cd6e3f7709a1eb3ee85a65e6628c7a3109e853 100644 (file)
@@ -607,6 +607,24 @@ MLXSW_ITEM32(cmd_mbox, config_profile,
  */
 MLXSW_ITEM32(cmd_mbox, config_profile, set_ar_sec, 0x0C, 15, 1);
 
+/* cmd_mbox_config_set_kvd_linear_size
+ * Capability bit. Setting a bit to 1 configures the profile
+ * according to the mailbox contents.
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, set_kvd_linear_size, 0x0C, 24, 1);
+
+/* cmd_mbox_config_set_kvd_hash_single_size
+ * Capability bit. Setting a bit to 1 configures the profile
+ * according to the mailbox contents.
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, set_kvd_hash_single_size, 0x0C, 25, 1);
+
+/* cmd_mbox_config_set_kvd_hash_double_size
+ * Capability bit. Setting a bit to 1 configures the profile
+ * according to the mailbox contents.
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, set_kvd_hash_double_size, 0x0C, 26, 1);
+
 /* cmd_mbox_config_profile_max_vepa_channels
  * Maximum number of VEPA channels per port (0 through 16)
  * 0 - multi-channel VEPA is disabled
@@ -733,6 +751,31 @@ MLXSW_ITEM32(cmd_mbox, config_profile, adaptive_routing_group_cap, 0x4C, 0, 16);
  */
 MLXSW_ITEM32(cmd_mbox, config_profile, arn, 0x50, 31, 1);
 
+/* cmd_mbox_config_kvd_linear_size
+ * KVD Linear Size
+ * Valid for Spectrum only
+ * Allowed values are 128*N where N=0 or higher
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, kvd_linear_size, 0x54, 0, 24);
+
+/* cmd_mbox_config_kvd_hash_single_size
+ * KVD Hash single-entries size
+ * Valid for Spectrum only
+ * Allowed values are 128*N where N=0 or higher
+ * Must be greater or equal to cap_min_kvd_hash_single_size
+ * Must be smaller or equal to cap_kvd_size - kvd_linear_size
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, kvd_hash_single_size, 0x58, 0, 24);
+
+/* cmd_mbox_config_kvd_hash_double_size
+ * KVD Hash double-entries size (units of single-size entries)
+ * Valid for Spectrum only
+ * Allowed values are 128*N where N=0 or higher
+ * Must be either 0 or greater or equal to cap_min_kvd_hash_double_size
+ * Must be smaller or equal to cap_kvd_size - kvd_linear_size
+ */
+MLXSW_ITEM32(cmd_mbox, config_profile, kvd_hash_double_size, 0x5C, 0, 24);
+
 /* cmd_mbox_config_profile_swid_config_mask
  * Modify Switch Partition Configuration mask. When set, the configu-
  * ration value for the Switch Partition are taken from the mailbox.
index 436bc49df6ab5bcc23ccd2c199c3891597e24289..2fe385cce203c20c6d5d30b8cffccbbe99a66507 100644 (file)
@@ -190,7 +190,8 @@ struct mlxsw_config_profile {
                used_max_ib_mc:1,
                used_max_pkey:1,
                used_ar_sec:1,
-               used_adaptive_routing_group_cap:1;
+               used_adaptive_routing_group_cap:1,
+               used_kvd_sizes:1;
        u8      max_vepa_channels;
        u16     max_lag;
        u16     max_port_per_lag;
@@ -211,6 +212,9 @@ struct mlxsw_config_profile {
        u8      ar_sec;
        u16     adaptive_routing_group_cap;
        u8      arn;
+       u32     kvd_linear_size;
+       u32     kvd_hash_single_size;
+       u32     kvd_hash_double_size;
        struct mlxsw_swid_config swid_config[MLXSW_CONFIG_PROFILE_SWID_COUNT];
 };
 
index 7f4173c8eda36c979b0d0e5b14f5bacc81a23a3e..ddbc9f22278debc19c4bc4fca7f27f266d6d53a0 100644 (file)
@@ -1255,6 +1255,20 @@ static int mlxsw_pci_config_profile(struct mlxsw_pci *mlxsw_pci, char *mbox,
                mlxsw_cmd_mbox_config_profile_adaptive_routing_group_cap_set(
                        mbox, profile->adaptive_routing_group_cap);
        }
+       if (profile->used_kvd_sizes) {
+               mlxsw_cmd_mbox_config_profile_set_kvd_linear_size_set(
+                       mbox, 1);
+               mlxsw_cmd_mbox_config_profile_kvd_linear_size_set(
+                       mbox, profile->kvd_linear_size);
+               mlxsw_cmd_mbox_config_profile_set_kvd_hash_single_size_set(
+                       mbox, 1);
+               mlxsw_cmd_mbox_config_profile_kvd_hash_single_size_set(
+                       mbox, profile->kvd_hash_single_size);
+               mlxsw_cmd_mbox_config_profile_set_kvd_hash_double_size_set(
+                       mbox, 1);
+               mlxsw_cmd_mbox_config_profile_kvd_hash_double_size_set(
+                       mbox, profile->kvd_hash_double_size);
+       }
 
        for (i = 0; i < MLXSW_CONFIG_PROFILE_SWID_COUNT; i++)
                mlxsw_pci_config_profile_swid_config(mlxsw_pci, mbox, i,