diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-06-18 13:15:06 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-06-28 16:03:59 -0700 |
commit | 5233794b179136d597b84188c1285148f07012e6 (patch) | |
tree | 692403786274b37ba322ef93950bcc9f54cff405 /include/linux/mlx5 | |
parent | f72e6c3e17be568138d8e4855ac2734d251a6913 (diff) | |
download | linux-5233794b179136d597b84188c1285148f07012e6.tar.gz linux-5233794b179136d597b84188c1285148f07012e6.tar.bz2 linux-5233794b179136d597b84188c1285148f07012e6.zip |
net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create
Putting an empty 'mlx5_flow_spec' structure on the stack is a bit
wasteful and causes a warning on 32-bit architectures when building
with clang -fsanitize-coverage:
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c: In function 'mlx5_eswitch_termtbl_create':
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c:90:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Since the structure is never written to, we can statically allocate
it to avoid the stack usage. To be on the safe side, mark all
subsequent function arguments that we pass it into as 'const'
as well.
Fixes: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push actions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Acked-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/fs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h index dc7e7aa53a13..04a569568eac 100644 --- a/include/linux/mlx5/fs.h +++ b/include/linux/mlx5/fs.h @@ -208,7 +208,7 @@ struct mlx5_flow_act { */ struct mlx5_flow_handle * mlx5_add_flow_rules(struct mlx5_flow_table *ft, - struct mlx5_flow_spec *spec, + const struct mlx5_flow_spec *spec, struct mlx5_flow_act *flow_act, struct mlx5_flow_destination *dest, int num_dest); |