Skip to content
  • Arnd Bergmann's avatar
    net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create · 5233794b
    Arnd Bergmann authored
    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: 10caabda
    
     ("net/mlx5e: Use termination table for VLAN push actions")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    Acked-by: default avatarMark Bloch <markb@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    5233794b