kernel - dm_target_crypt - use CRYPTO_F_BATCH
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 02:29:54 +0000 (19:29 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 02:29:54 +0000 (19:29 -0700)
* Allow crypto requests to be dispatched to multiple crypto support
  threads instead of executing the operation synchronously.

* Greatly improves crypto performance on SMP boxes.  25MB/s -> 80MB/s on
  my quad.

* Currently the ivgen code gets in the way because it must be executed
  synchronously before the data crypto op can be initiated.  Further
  performance improvements are possible.

sys/dev/disk/dm/dm_target_crypt.c

index 799d92d..d5a7089 100644 (file)
@@ -755,7 +755,8 @@ dmtc_crypto_read_start(dm_target_crypt_config_t *priv, struct bio *bio)
                crp->crp_callback = dmtc_crypto_cb_read_done;
                crp->crp_desc = crd;
                crp->crp_etype = 0;
-               crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL;
+               crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL |
+                                CRYPTO_F_BATCH;
 
                crd->crd_alg = priv->crypto_alg;
                crd->crd_key = (caddr_t)priv->crypto_key;
@@ -910,7 +911,8 @@ dmtc_crypto_write_start(dm_target_crypt_config_t *priv, struct bio *bio)
                crp->crp_callback = dmtc_crypto_cb_write_done;
                crp->crp_desc = crd;
                crp->crp_etype = 0;
-               crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL;
+               crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL |
+                                CRYPTO_F_BATCH;
 
                crd->crd_alg = priv->crypto_alg;
                crd->crd_key = (caddr_t)priv->crypto_key;