opencrypto - Only yield for cryptosoft
authorAlex Hornung <ahornung@gmail.com>
Tue, 24 Aug 2010 06:54:09 +0000 (07:54 +0100)
committerAlex Hornung <ahornung@gmail.com>
Tue, 24 Aug 2010 06:54:09 +0000 (07:54 +0100)
* There's no need to yield the CPU when doing hardware-assisted
  crypto. Move the lwkt_yield()s into cryptosoft.

sys/opencrypto/crypto.c
sys/opencrypto/cryptosoft.c

index cbc6bee..7e34357 100644 (file)
@@ -830,7 +830,6 @@ crypto_dispatch(struct cryptop *crp)
                KASSERT(cap != NULL, ("%s: Driver disappeared.", __func__));
                if (!cap->cc_qblocked) {
                        result = crypto_invoke(cap, crp, 0);
-                       lwkt_yield();
                        if (result != ERESTART)
                                return (result);
                        /*
@@ -1363,7 +1362,6 @@ crypto_proc(void *arg)
 
                        CRYPTO_Q_UNLOCK(tdinfo);
                        result = crypto_invoke(cap, submit, hint);
-                       lwkt_yield();
                        CRYPTO_Q_LOCK(tdinfo);
 
                        if (result == ERESTART) {
index e228178..d940a5b 100644 (file)
@@ -1129,6 +1129,7 @@ swcr_process(device_t dev, struct cryptop *crp, int hint)
 
 done:
        crypto_done(crp);
+       lwkt_yield();
        return 0;
 }