Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto refactor cryptointr(), no functional changes.



details:   https://anonhg.NetBSD.org/src/rev/024e624f9c24
branches:  trunk
changeset: 823979:024e624f9c24
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Wed May 17 11:04:38 2017 +0000

description:
refactor cryptointr(), no functional changes.

diffstat:

 sys/opencrypto/crypto.c |  46 +++++++++++++++++++++++++---------------------
 1 files changed, 25 insertions(+), 21 deletions(-)

diffs (68 lines):

diff -r 22164cadfeb5 -r 024e624f9c24 sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c   Wed May 17 11:03:42 2017 +0000
+++ b/sys/opencrypto/crypto.c   Wed May 17 11:04:38 2017 +0000
@@ -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 @@
                                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) {



Home | Main Index | Thread Index | Old Index