net: sched: gred: dynamically allocate tc_gred_qopt_offload
authorArnd Bergmann <arnd@arndb.de>
Tue, 26 Oct 2021 10:07:11 +0000 (12:07 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Oct 2021 19:06:52 +0000 (12:06 -0700)
commitf25c0515c521375154c62c72447869f40218c861
tree14077ccf4ceb5ed5013882445d0d61733648cc3d
parent4796e2518a52c23769c51b41f100f3fa369e7e61
net: sched: gred: dynamically allocate tc_gred_qopt_offload

The tc_gred_qopt_offload structure has grown too big to be on the
stack for 32-bit architectures after recent changes.

net/sched/sch_gred.c:903:13: error: stack frame size (1180) exceeds limit (1024) in 'gred_destroy' [-Werror,-Wframe-larger-than]
net/sched/sch_gred.c:310:13: error: stack frame size (1212) exceeds limit (1024) in 'gred_offload' [-Werror,-Wframe-larger-than]

Use dynamic allocation per qdisc to avoid this.

Fixes: 50dc9a8572aa ("net: sched: Merge Qdisc::bstats and Qdisc::cpu_bstats data types")
Fixes: 67c9e6270f30 ("net: sched: Protect Qdisc::bstats with u64_stats")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20211026100711.nalhttf6mbe6sudx@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_gred.c