]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create
authorArnd Bergmann <arnd@arndb.de>
Tue, 18 Jun 2019 11:15:06 +0000 (13:15 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 28 Jun 2019 23:03:59 +0000 (16:03 -0700)
commitac089aafebb4833d1c722d89e09541d74dfb8aca
tree692403786274b37ba322ef93950bcc9f54cff405
parent3a4b1415127eb4387e49711a8808c1805eae317d
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: 11a71d9177e8 ("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>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
include/linux/mlx5/fs.h