]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mlxsw: spectrum: Change KVD linear parts from list to array
authorJiri Pirko <jiri@mellanox.com>
Sun, 1 Apr 2018 14:34:53 +0000 (17:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 14:56:42 +0000 (10:56 -0400)
commit4f8768befdea9d8004361f180ca559f22ce5346d
tree60e3d4fba6b1e5b73768959437d81bfc34996424
parentf9b9120119ca70ccdb1c900ac061425e4784c4de
mlxsw: spectrum: Change KVD linear parts from list to array

The parts info is array. The parts copy this info array, yet they are a
list. So make the indexing according to the id and change the list of
parts into array of parts. This helps to eliminate lookups and
constructs like mlxsw_sp_kvdl_part_update() (took me some non-trivial
time to figure out what is going on there).
Alongside with that, introduce a helper macro to define the parts infos.

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