OSDN Git Service

mlxsw: spectrum_cnt: Move config validation along with resource register
authorJiri Pirko <jiri@mellanox.com>
Wed, 18 Mar 2020 13:48:54 +0000 (15:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Mar 2020 23:46:19 +0000 (16:46 -0700)
commitab8c4cc604206a9b99705018fffe0c5d2c90f2ef
tree6c07aa1c92871f34d067039c21a0b8af1d3d1e19
parentd53cdbb889a33c803847da8d1592a45b4c1badb5
mlxsw: spectrum_cnt: Move config validation along with resource register

Move the validation of subpools configuration, to avoid possible over
commitment to resource registration. Add WARN_ON to indicate bug
in the code.

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_cnt.c