Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto the processing said "ghastly hacks" is unnece...



details:   https://anonhg.NetBSD.org/src/rev/b2670d9a765a
branches:  trunk
changeset: 352543:b2670d9a765a
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Apr 07 12:17:57 2017 +0000

description:
the processing said "ghastly hacks" is unnecessary now.

diffstat:

 sys/opencrypto/crypto.c    |  43 ++-----------------------------------------
 sys/opencrypto/cryptodev.c |  15 ++-------------
 2 files changed, 4 insertions(+), 54 deletions(-)

diffs (107 lines):

diff -r c22b1980f162 -r b2670d9a765a sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c   Fri Apr 07 12:15:51 2017 +0000
+++ b/sys/opencrypto/crypto.c   Fri Apr 07 12:17:57 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypto.c,v 1.53 2017/04/06 09:39:12 knakahara Exp $ */
+/*     $NetBSD: crypto.c,v 1.54 2017/04/07 12:17:57 knakahara Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $   */
 /*     $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */
 
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.53 2017/04/06 09:39:12 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.54 2017/04/07 12:17:57 knakahara Exp $");
 
 #include <sys/param.h>
 #include <sys/reboot.h>
@@ -121,45 +121,6 @@
                TAILQ_HEAD_INITIALIZER(crp_ret_kq);
 
 /*
- * XXX these functions are ghastly hacks for when the submission
- * XXX routines discover a request that was not CBIMM is already
- * XXX done, and must be yanked from the retq (where _done) put it
- * XXX as cryptoret won't get the chance.  The queue is walked backwards
- * XXX as the request is generally the last one queued.
- *
- *      call with the lock held, or else.
- */
-int
-crypto_ret_q_remove(struct cryptop *crp)
-{
-       struct cryptop * acrp, *next;
-
-       TAILQ_FOREACH_REVERSE_SAFE(acrp, &crp_ret_q, crprethead, crp_next, next) {
-               if (acrp == crp) {
-                       TAILQ_REMOVE(&crp_ret_q, crp, crp_next);
-                       crp->crp_flags &= (~CRYPTO_F_ONRETQ);
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-int
-crypto_ret_kq_remove(struct cryptkop *krp)
-{
-       struct cryptkop * akrp, *next;
-
-       TAILQ_FOREACH_REVERSE_SAFE(akrp, &crp_ret_kq, krprethead, krp_next, next) {
-               if (akrp == krp) {
-                       TAILQ_REMOVE(&crp_ret_kq, krp, krp_next);
-                       krp->krp_flags &= (~CRYPTO_F_ONRETQ);
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-/*
  * Crypto op and desciptor data structures are allocated
  * from separate private zones(FreeBSD)/pools(netBSD/OpenBSD) .
  */
diff -r c22b1980f162 -r b2670d9a765a sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c        Fri Apr 07 12:15:51 2017 +0000
+++ b/sys/opencrypto/cryptodev.c        Fri Apr 07 12:17:57 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptodev.c,v 1.87 2017/04/07 12:15:51 knakahara Exp $ */
+/*     $NetBSD: cryptodev.c,v 1.88 2017/04/07 12:17:57 knakahara Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $        */
 /*     $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $   */
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.87 2017/04/07 12:15:51 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.88 2017/04/07 12:17:57 knakahara Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -668,13 +668,6 @@
                        (uint32_t)cse->sid, &crp->crp_cv, crp));
                cv_wait(&crp->crp_cv, &crypto_mtx);     /* XXX cv_wait_sig? */
        }
-       if (crp->crp_flags & CRYPTO_F_ONRETQ) {
-               /* XXX this should never happen now with the CRYPTO_F_USER flag
-                * changes.
-                */
-               DPRINTF(("cryptodev_op: DONE, not woken by cryptoret.\n"));
-               (void)crypto_ret_q_remove(crp);
-       }
        mutex_exit(&crypto_mtx);
        cv_destroy(&crp->crp_cv);
 
@@ -895,10 +888,6 @@
        while (!(krp->krp_flags & CRYPTO_F_DQRETQ)) {
                cv_wait(&krp->krp_cv, &crypto_mtx);     /* XXX cv_wait_sig? */
        }
-       if (krp->krp_flags & CRYPTO_F_ONRETQ) {
-               DPRINTF(("cryptodev_key: DONE early, not via cryptoret.\n"));
-               (void)crypto_ret_kq_remove(krp);
-       }
        mutex_exit(&crypto_mtx);
 
        if (krp->krp_status != 0) {



Home | Main Index | Thread Index | Old Index