]> www.infradead.org Git - users/dwmw2/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Mon, 7 Oct 2024 23:35:03 +0000 (16:35 -0700)
commitbec2a32145d5cc066df29182fa0e5b0d4329b1a1
tree3228661f66e180665ce997f2dad90a23fa14d48b
parent539770616521e5b046ca7612eb79ba11b53edb1d
mlxsw: spectrum_acl_flex_keys: Constify struct mlxsw_afk_element_inst

'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>
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