Module Name: src Committed By: knakahara Date: Wed May 17 11:04:38 UTC 2017
Modified Files: src/sys/opencrypto: crypto.c Log Message: refactor cryptointr(), no functional changes. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/opencrypto/crypto.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.69 src/sys/opencrypto/crypto.c:1.70 --- src/sys/opencrypto/crypto.c:1.69 Wed May 17 11:03:42 2017 +++ src/sys/opencrypto/crypto.c Wed May 17 11:04:38 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: crypto.c,v 1.69 2017/05/17 11:03:42 knakahara Exp $ */ +/* $NetBSD: crypto.c,v 1.70 2017/05/17 11:04:38 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.69 2017/05/17 11:03:42 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.70 2017/05/17 11:04:38 knakahara Exp $"); #include <sys/param.h> #include <sys/reboot.h> @@ -1265,26 +1265,30 @@ cryptointr(void) submit = crp; break; } - if (!cap->cc_qblocked) { - if (submit != NULL) { - /* - * We stop on finding another op, - * regardless whether its for the same - * driver or not. We could keep - * searching the queue but it might be - * better to just use a per-driver - * queue instead. - */ - if (CRYPTO_SESID2HID(submit->crp_sid) - == hid) - hint = CRYPTO_HINT_MORE; + + /* + * skip blocked crp regardless of CRYPTO_F_BATCH + */ + if (cap->cc_qblocked != 0) + continue; + + if (submit != NULL) { + /* + * We stop on finding another op, + * regardless whether its for the same + * driver or not. We could keep + * searching the queue but it might be + * better to just use a per-driver + * queue instead. + */ + if (CRYPTO_SESID2HID(submit->crp_sid) == hid) + hint = CRYPTO_HINT_MORE; + break; + } else { + submit = crp; + if ((submit->crp_flags & CRYPTO_F_BATCH) == 0) break; - } else { - submit = crp; - if ((submit->crp_flags & CRYPTO_F_BATCH) == 0) - break; - /* keep scanning for more are q'd */ - } + /* keep scanning for more are q'd */ } } if (submit != NULL) {