summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-12-01 20:30:23 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-12-01 20:30:23 +0000
commited37cc8866546cdb562a36b4b9472666a1cd9980 (patch)
treee27b0553675da7d9db8c47a9c09baa1098b9b0d0 /sys/net
parent9f687419bb25deb265fabb42af7229b29cab17e6 (diff)
pipex(4) layer is completely mp-safe, move the pipex_timer() timeout(9)
handler out of kernel lock. ok bluhm
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pipex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/net/pipex.c b/sys/net/pipex.c
index ac42168076b..299d1902a68 100644
--- a/sys/net/pipex.c
+++ b/sys/net/pipex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pipex.c,v 1.150 2023/11/28 13:23:20 bluhm Exp $ */
+/* $OpenBSD: pipex.c,v 1.151 2023/12/01 20:30:22 mvs Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -716,7 +716,8 @@ pipex_lookup_by_session_id(int protocol, int session_id)
void
pipex_timer_start(void)
{
- timeout_set_proc(&pipex_timer_ch, pipex_timer, NULL);
+ timeout_set_flags(&pipex_timer_ch, pipex_timer, NULL,
+ KCLOCK_NONE, TIMEOUT_PROC | TIMEOUT_MPSAFE);
timeout_add_sec(&pipex_timer_ch, pipex_prune);
}
@@ -731,8 +732,6 @@ pipex_timer(void *ignored_arg)
{
struct pipex_session *session, *session_tmp;
- timeout_add_sec(&pipex_timer_ch, pipex_prune);
-
mtx_enter(&pipex_list_mtx);
/* walk through */
LIST_FOREACH_SAFE(session, &pipex_session_list, session_list,
@@ -767,6 +766,9 @@ pipex_timer(void *ignored_arg)
}
}
+ if (LIST_FIRST(&pipex_session_list))
+ timeout_add_sec(&pipex_timer_ch, pipex_prune);
+
mtx_leave(&pipex_list_mtx);
}