not reachable because all callers had set the CRYPTO_F_NOQUEUE flag.
ok patrick@ mvs@ bluhm@
-/* $OpenBSD: crypto.c,v 1.87 2021/10/13 22:43:44 bluhm Exp $ */
+/* $OpenBSD: crypto.c,v 1.88 2021/10/21 22:59:08 tobhe Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
/* XXXSMP crypto_invoke() is not MP safe */
lock = 1;
- if (crp->crp_flags & CRYPTO_F_NOQUEUE) {
- if (lock)
- KERNEL_LOCK();
- crypto_invoke(crp);
- if (lock)
- KERNEL_UNLOCK();
- } else {
- struct taskq *tq;
-
- tq = lock ? crypto_taskq : crypto_taskq_mpsafe;
- task_set(&crp->crp_task, (void (*))crypto_invoke, crp);
- task_add(tq, &crp->crp_task);
- }
+ if (lock)
+ KERNEL_LOCK();
+ crypto_invoke(crp);
+ if (lock)
+ KERNEL_UNLOCK();
}
/*
{
crp->crp_flags |= CRYPTO_F_DONE;
- if (crp->crp_flags & CRYPTO_F_NOQUEUE) {
- /* not from the crypto queue, wakeup the userland process */
- crp->crp_callback(crp);
- } else {
- struct taskq *tq;
-
- tq = (crp->crp_flags & CRYPTO_F_MPSAFE) ?
- crypto_taskq_mpsafe : crypto_taskq;
- task_set(&crp->crp_task, (void (*))crp->crp_callback, crp);
- task_add(tq, &crp->crp_task);
- }
+ crp->crp_callback(crp);
}
-/* $OpenBSD: cryptodev.h,v 1.76 2021/10/13 22:43:44 bluhm Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.77 2021/10/21 22:59:08 tobhe Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
#define CRYPTO_F_IMBUF 0x0001 /* Input/output are mbuf chains, otherwise contig */
#define CRYPTO_F_IOV 0x0002 /* Input/output are uio */
#define CRYPTO_F_MPSAFE 0x0004 /* Do not use kernel lock for callback */
-#define CRYPTO_F_NOQUEUE 0x0008 /* Don't use crypto queue/thread */
#define CRYPTO_F_DONE 0x0010 /* request completed */
void *crp_buf; /* Data to be processed */
-/* $OpenBSD: ip_ah.c,v 1.156 2021/10/13 22:43:44 bluhm Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.157 2021/10/21 22:59:07 tobhe Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_input_cb;
crp->crp_sid = tdb->tdb_cryptoid;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_output_cb;
crp->crp_sid = tdb->tdb_cryptoid;
-/* $OpenBSD: ip_esp.c,v 1.175 2021/10/21 08:39:33 tobhe Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.176 2021/10/21 22:59:07 tobhe Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
/* Crypto operation descriptor */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length */
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_input_cb;
crp->crp_sid = tdb->tdb_cryptoid;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_output_cb;
crp->crp_opaque = (caddr_t)tc;
-/* $OpenBSD: ip_ipcomp.c,v 1.76 2021/10/13 22:43:44 bluhm Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.77 2021/10/21 22:59:07 tobhe Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
/* Crypto operation descriptor */
crp->crp_ilen = m->m_pkthdr.len - (skip + hlen);
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_input_cb;
crp->crp_sid = tdb->tdb_cryptoid;
/* Crypto operation descriptor */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length */
- crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE | CRYPTO_F_NOQUEUE;
+ crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_MPSAFE;
crp->crp_buf = (caddr_t)m;
crp->crp_callback = ipsec_output_cb;
crp->crp_opaque = (caddr_t)tc;