mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 08:12:53 +00:00
nss-clients: nss_qdisc: restore dev_base_lock usage for kernels < 6.10
In kernels prior to 6.10, dev_base_lock was required to protect the net_device list traversal. From 6.10 onward the lock was dropped in favor of RCU. To preserve previous behavior (i.e. 24.10-nss on kernel 6.6), restore read_lock()/read_unlock() and wrap into kernel macros check. Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
6b2c80e13a
commit
88ee738cb5
@ -471,21 +471,26 @@
|
||||
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
|
||||
--- a/nss_qdisc/nss_qdisc.c
|
||||
+++ b/nss_qdisc/nss_qdisc.c
|
||||
@@ -375,7 +375,7 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
@@ -375,7 +375,9 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
br_update.port_list_count = 0;
|
||||
br_update.unassign_count = 0;
|
||||
|
||||
- read_lock(&dev_base_lock);
|
||||
+ /* read_lock(&dev_base_lock); */
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
|
||||
+ read_lock(&dev_base_lock);
|
||||
+#endif
|
||||
dev = first_net_device(&init_net);
|
||||
|
||||
while(dev) {
|
||||
@@ -422,7 +422,7 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
@@ -422,7 +424,10 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
nextdev:
|
||||
dev = next_net_device(dev);
|
||||
}
|
||||
- read_unlock(&dev_base_lock);
|
||||
+ /* read_unlock(&dev_base_lock); */
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
|
||||
+ read_unlock(&dev_base_lock);
|
||||
+#endif
|
||||
|
||||
nss_qdisc_info("List count %d\n", br_update.port_list_count);
|
||||
|
||||
|
||||
@ -471,21 +471,26 @@
|
||||
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
|
||||
--- a/nss_qdisc/nss_qdisc.c
|
||||
+++ b/nss_qdisc/nss_qdisc.c
|
||||
@@ -374,7 +374,7 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
@@ -374,7 +374,9 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
br_update.port_list_count = 0;
|
||||
br_update.unassign_count = 0;
|
||||
|
||||
- read_lock(&dev_base_lock);
|
||||
+ /* read_lock(&dev_base_lock); */
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
|
||||
+ read_lock(&dev_base_lock);
|
||||
+#endif
|
||||
dev = first_net_device(&init_net);
|
||||
|
||||
while(dev) {
|
||||
@@ -421,7 +421,7 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
@@ -421,7 +423,10 @@ static int nss_qdisc_refresh_bshaper_ass
|
||||
nextdev:
|
||||
dev = next_net_device(dev);
|
||||
}
|
||||
- read_unlock(&dev_base_lock);
|
||||
+ /* read_unlock(&dev_base_lock); */
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
|
||||
+ read_unlock(&dev_base_lock);
|
||||
+#endif
|
||||
|
||||
nss_qdisc_info("List count %d\n", br_update.port_list_count);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user