[Devel] [PATCH RHEL7 COMMIT] ms/drop_monitor: use setup_timer
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jul 28 22:28:43 MSK 2022
The commit is pushed to "branch-rh7-3.10.0-1160.66.1.vz7.188.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.66.1.vz7.188.6
------>
commit 88a4ec6a38a16a74b54a1f80cce214217d05580c
Author: Geliang Tang <geliangtang at gmail.com>
Date: Mon Jul 4 21:51:53 2022 +0300
ms/drop_monitor: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang at gmail.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 27303fcf5734d84c8d018b79d1db154ceaf88df8)
Combined with (partially):
e99e88a9d ("treewide: setup_timer() -> timer_setup()")
Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
=================
Patchset description:
drop_monitor: Add packet alert mode
Just port and adapt packet alert mode feature for RHEL7 kernel.
https://jira.sw.ru/browse/PSBM-140937
Ported-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
net/core/drop_monitor.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 639b8692209e4..7633d754e989d 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -144,9 +144,9 @@ static void send_dm_alert(struct work_struct *work)
* in the event that more drops will arrive during the
* hysteresis period.
*/
-static void sched_send_work(unsigned long _data)
+static void sched_send_work(struct timer_list *t)
{
- struct per_cpu_dm_data *data = (struct per_cpu_dm_data *)_data;
+ struct per_cpu_dm_data *data = from_timer(data, t, send_timer);
schedule_work(&data->dm_alert_work);
}
@@ -413,9 +413,7 @@ static int __init init_net_drop_monitor(void)
for_each_possible_cpu(cpu) {
data = &per_cpu(dm_cpu_data, cpu);
INIT_WORK(&data->dm_alert_work, send_dm_alert);
- init_timer(&data->send_timer);
- data->send_timer.data = (unsigned long)data;
- data->send_timer.function = sched_send_work;
+ timer_setup(&data->send_timer, sched_send_work, 0);
spin_lock_init(&data->lock);
reset_per_cpu_data(data);
}
More information about the Devel
mailing list