Module Name: src Committed By: knakahara Date: Fri Apr 7 12:17:57 UTC 2017
Modified Files: src/sys/opencrypto: crypto.c cryptodev.c Log Message: the processing said "ghastly hacks" is unnecessary now. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/opencrypto/crypto.c cvs rdiff -u -r1.87 -r1.88 src/sys/opencrypto/cryptodev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/opencrypto/crypto.c diff -u src/sys/opencrypto/crypto.c:1.53 src/sys/opencrypto/crypto.c:1.54 --- src/sys/opencrypto/crypto.c:1.53 Thu Apr 6 09:39:12 2017 +++ src/sys/opencrypto/crypto.c Fri Apr 7 12:17:57 2017 @@ -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 @@ static TAILQ_HEAD(krprethead, cryptkop) 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) . */ Index: src/sys/opencrypto/cryptodev.c diff -u src/sys/opencrypto/cryptodev.c:1.87 src/sys/opencrypto/cryptodev.c:1.88 --- src/sys/opencrypto/cryptodev.c:1.87 Fri Apr 7 12:15:51 2017 +++ src/sys/opencrypto/cryptodev.c Fri Apr 7 12:17:57 2017 @@ -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 @@ eagain: (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 @@ cryptodev_key(struct crypt_kop *kop) 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) {