aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorJan Hoffmann <jan@3e8.eu>2022-12-17 21:45:43 +0100
committerSander Vanheule <sander@svanheule.net>2022-12-27 16:29:57 +0100
commit2c40359c5c12621fa386efca3139ea523db6d39f (patch)
tree81e916c19fb678eeb067e809a2911a2e31b28c26 /target
parentae0a3f88ac335801f17035504ba572d14205787a (diff)
downloadupstream-2c40359c5c12621fa386efca3139ea523db6d39f.tar.gz
upstream-2c40359c5c12621fa386efca3139ea523db6d39f.tar.bz2
upstream-2c40359c5c12621fa386efca3139ea523db6d39f.zip
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 <jan@3e8.eu>
Diffstat (limited to 'target')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/debugfs.c3
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c3
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/debugfs.c3
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/debugfs.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/debugfs.c
index 9a7c7714c6..3c935f629a 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/debugfs.c
+++ b/target/linux/realtek/files-5.10/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++) {
diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
index 6eea0dc936..63461ff573 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
@@ -1728,6 +1728,9 @@ static int rtl83xx_port_fdb_dump(struct dsa_switch *ds, int port,
if (e.port == port || e.port == RTL930X_PORT_IGNORE)
cb(e.mac, e.vid, e.is_static, data);
+
+ if (!((i + 1) % 64))
+ cond_resched();
}
for (i = 0; i < 64; i++) {
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++) {
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
index 9281e08d33..3e71813112 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
@@ -1725,6 +1725,9 @@ static int rtl83xx_port_fdb_dump(struct dsa_switch *ds, int port,
if (e.port == port || e.port == RTL930X_PORT_IGNORE)
cb(e.mac, e.vid, e.is_static, data);
+
+ if (!((i + 1) % 64))
+ cond_resched();
}
for (i = 0; i < 64; i++) {