]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Fix handling of resource_size_param
authorJiri Pirko <jiri@mellanox.com>
Wed, 28 Feb 2018 12:12:09 +0000 (13:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Feb 2018 17:32:36 +0000 (12:32 -0500)
commitdd60d24a4e85014667675a59f8900a6eb7535ee6
treecf9ff25bb8ba0eeb1d783da2baeb0f96843ed566
parent78753a5fd10f3b206f1012e2ea1ad92764d4ce0b
mlxsw: spectrum: Fix handling of resource_size_param

Current code uses global variables, adjusts them and passes pointer down
to devlink. With every other mlxsw_core instance, the previously passed
pointer values are rewritten. Fix this by de-globalize the variables and
also memcpy size_params during devlink resource registration.
Also, introduce a convenient size_param_init helper.

Fixes: d770a1780474 ("mlxsw: spectrum: Register KVD resources with devlink")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
include/net/devlink.h
net/core/devlink.c