Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102975009
D46494.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D46494.diff
View Options
diff --git a/sys/netipsec/ipsec_offload.c b/sys/netipsec/ipsec_offload.c
--- a/sys/netipsec/ipsec_offload.c
+++ b/sys/netipsec/ipsec_offload.c
@@ -69,6 +69,7 @@
static struct mtx ipsec_accel_sav_tmp;
static struct unrhdr *drv_spi_unr;
static struct mtx ipsec_accel_cnt_lock;
+static struct taskqueue *ipsec_accel_tq;
struct ipsec_accel_install_newkey_tq {
struct secasvar *sav;
@@ -166,6 +167,11 @@
mtx_init(&ipsec_accel_cnt_lock, "ipascn", MTX_DEF, 0);
drv_spi_unr = new_unrhdr(IPSEC_ACCEL_DRV_SPI_MIN,
IPSEC_ACCEL_DRV_SPI_MAX, &ipsec_accel_sav_tmp);
+ ipsec_accel_tq = taskqueue_create("ipsec_offload", M_WAITOK,
+ taskqueue_thread_enqueue, &ipsec_accel_tq);
+ (void)taskqueue_start_threads(&ipsec_accel_tq,
+ 1 /* Must be single-threaded */, PWAIT,
+ "ipsec_offload");
ipsec_accel_sa_newkey_p = ipsec_accel_sa_newkey_impl;
ipsec_accel_forget_sav_p = ipsec_accel_forget_sav_impl;
ipsec_accel_spdadd_p = ipsec_accel_spdadd_impl;
@@ -207,6 +213,8 @@
clean_unrhdr(drv_spi_unr); /* avoid panic, should go later */
clear_unrhdr(drv_spi_unr);
delete_unrhdr(drv_spi_unr);
+ taskqueue_drain_all(ipsec_accel_tq);
+ taskqueue_free(ipsec_accel_tq);
mtx_destroy(&ipsec_accel_sav_tmp);
mtx_destroy(&ipsec_accel_cnt_lock);
}
@@ -344,7 +352,7 @@
/*
* If ipsec_accel_forget_sav() raced with us and set
* the flag, do its work. Its task cannot execute in
- * parallel since taskqueue_thread is single-threaded.
+ * parallel since ipsec_accel taskqueue is single-threaded.
*/
if ((sav->accel_flags & SADB_KEY_ACCEL_DEINST) != 0) {
tqf = (void *)sav->accel_forget_tq;
@@ -385,7 +393,7 @@
TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq);
tq->sav = sav;
tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */
- taskqueue_enqueue(taskqueue_thread, &tq->install_task);
+ taskqueue_enqueue(ipsec_accel_tq, &tq->install_task);
}
static int
@@ -508,7 +516,7 @@
TASK_INIT(&tq->forget_task, 0, ipsec_accel_forget_sav_act, tq);
tq->forget_vnet = curthread->td_vnet;
tq->sav = sav;
- taskqueue_enqueue(taskqueue_thread, &tq->forget_task);
+ taskqueue_enqueue(ipsec_accel_tq, &tq->forget_task);
}
static void
@@ -696,7 +704,7 @@
in_pcbref(inp);
TASK_INIT(&tq->adddel_task, 0, ipsec_accel_spdadd_act, sp);
key_addref(sp);
- taskqueue_enqueue(taskqueue_thread, &tq->adddel_task);
+ taskqueue_enqueue(ipsec_accel_tq, &tq->adddel_task);
}
static void
@@ -751,7 +759,7 @@
tq->adddel_vnet = curthread->td_vnet;
TASK_INIT(&tq->adddel_task, 0, ipsec_accel_spddel_act, sp);
key_addref(sp);
- taskqueue_enqueue(taskqueue_thread, &tq->adddel_task);
+ taskqueue_enqueue(ipsec_accel_tq, &tq->adddel_task);
}
static void
@@ -1124,7 +1132,7 @@
static void
ipsec_accel_sync_imp(void)
{
- taskqueue_drain_all(taskqueue_thread);
+ taskqueue_drain_all(ipsec_accel_tq);
}
static struct mbuf *
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 9:34 AM (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11374280
Default Alt Text
D46494.diff (2 KB)
Attached To
Mode
D46494: ipsec offload: use private taskqueue thread
Attached
Detach File
Event Timeline
Log In to Comment