]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mlxsw: spectrum_acl_flex_keys: Constify struct mlxsw_afk_element_inst
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 4 Oct 2024 05:26:05 +0000 (07:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:08 +0000 (20:03 +0100)
commitcfa0f932774b27f09e6f771f27fa9a97ad637c4c
tree7838c0c107d792b778648dfdb936032b6bf3c8fb
parent22074dc1d4d3ea14ef6313ae4337cb07778498d6
mlxsw: spectrum_acl_flex_keys: Constify struct mlxsw_afk_element_inst

[ Upstream commit bec2a32145d5cc066df29182fa0e5b0d4329b1a1 ]

'struct mlxsw_afk_element_inst' are not modified in these drivers.

Constifying these structures moves some data to a read-only section, so
increases overall security.

Update a few functions and struct mlxsw_afk_block accordingly.

On a x86_64, with allmodconfig, as an example:
Before:
======
   text    data     bss     dec     hex filename
   4278    4032       0    8310    2076 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.o

After:
=====
   text    data     bss     dec     hex filename
   7934     352       0    8286    205e drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/8ccfc7bfb2365dcee5b03c81ebe061a927d6da2e.1727541677.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 217bbf156f93 ("mlxsw: spectrum_acl_flex_keys: Use correct key block on Spectrum-4")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.c