diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2024-07-14 01:53:32 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-07-15 06:26:16 +0300 |
commit | 555a05d84ca2c587e2d4777006e2c2fb3dfbd91d (patch) | |
tree | 70eb909f21fbedec14e57676d9deabc90df162ab /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 62fdd1708fcb3e1c58d21221bf0861a8b1975f90 (diff) | |
download | linux-555a05d84ca2c587e2d4777006e2c2fb3dfbd91d.tar.xz |
net: dpaa: avoid on-stack arrays of NR_CPUS elements
The dpaa-eth driver is written for PowerPC and Arm SoCs which have 1-24
CPUs. It depends on CONFIG_NR_CPUS having a reasonably small value in
Kconfig. Otherwise, there are 2 functions which allocate on-stack arrays
of NR_CPUS elements, and these can quickly explode in size, leading to
warnings such as:
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:3280:12: warning:
stack frame size (16664) exceeds limit (2048) in 'dpaa_eth_probe' [-Wframe-larger-than]
The problem is twofold:
- Reducing the array size to the boot-time num_possible_cpus() (rather
than the compile-time NR_CPUS) creates a variable-length array,
which should be avoided in the Linux kernel.
- Using NR_CPUS as an array size makes the driver blow up in stack
consumption with generic, as opposed to hand-crafted, .config files.
A simple solution is to use dynamic allocation for num_possible_cpus()
elements (aka a small number determined at runtime).
Link: https://lore.kernel.org/all/202406261920.l5pzM1rj-lkp@intel.com/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Link: https://patch.msgid.link/20240713225336.1746343-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions