From 2c40359c5c12621fa386efca3139ea523db6d39f Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Sat, 17 Dec 2022 21:45:43 +0100 Subject: realtek: add cond_resched to loops accessing the FDB table A full loop accessing all FDB entries can take several milliseconds (on RTL839x about 20 ms), so give other kernel tasks a chance to run. This is especially important for rtl83xx_port_fdb_dump which is itself called in a loop for all ports by the kernel. Signed-off-by: Jan Hoffmann --- target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c') diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c index 9a7c7714c6..3c935f629a 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c @@ -343,6 +343,9 @@ static int l2_table_show(struct seq_file *m, void *v) seq_printf(m, "Hash table bucket %d index %d ", bucket, index); l2_table_print_entry(m, priv, &e); + + if (!((i + 1) % 64)) + cond_resched(); } for (i = 0; i < 64; i++) { -- cgit v1.2.3