freebsd-dev/sys/opencrypto
Pawel Jakub Dawidek 4acae0ac29 - Make opencrypto more SMP friendly by dropping the queue lock around
crypto_invoke(). This allows to serve multiple crypto requests in
  parallel and not bached requests are served lock-less.
  Drivers should not depend on the queue lock beeing held around
  crypto_invoke() and if they do, that's an error in the driver - it
  should do its own synchronization.
- Don't forget to wakeup the crypto thread when new requests is
  queued and only if both symmetric and asymmetric queues are empty.
- Symmetric requests use sessions and there is no way driver can
  disappear when there is an active session, so we don't need to check
  this, but assert this. This is also safe to not use the driver lock
  in this case.
- Assymetric requests don't use sessions, so don't check the driver
  in crypto_kinvoke().
- Protect assymetric operation with the driver lock, because if there
  is no symmetric session, driver can disappear.
- Don't send assymetric request to the driver if it is marked as
  blocked.
- Add an XXX comment, because I don't think migration to another driver
  is safe when there are pending requests using freed session.
- Remove 'hint' argument from crypto_kinvoke(), as it serves no purpose.
- Don't hold the driver lock around kprocess method call, instead use
  cc_koperations to track number of in-progress requests.
- Cleanup register/unregister code a bit.
- Other small simplifications and cleanups.

Reviewed by:	sam
2006-05-17 18:12:44 +00:00
..
cast.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
cast.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
castsb.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
criov.c - Implement cuio_apply(), an equivalent to m_apply(9). 2006-05-17 17:56:00 +00:00
crypto_if.m /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
crypto.c - Make opencrypto more SMP friendly by dropping the queue lock around 2006-05-17 18:12:44 +00:00
cryptodev.c If kern.cryptodevallowsoft is TRUE allow also for symmetric software crypto 2006-05-17 18:01:51 +00:00
cryptodev.h - Make opencrypto more SMP friendly by dropping the queue lock around 2006-05-17 18:12:44 +00:00
cryptosoft.c - Simplify the code by using arc4rand(9) instead of arc4random(9) in a loop. 2006-04-10 18:24:59 +00:00
cryptosoft.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
deflate.c malloc.h relies on param.h for a definition of MAXCPU. I guess that there is 2005-05-30 05:01:44 +00:00
deflate.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
rmd160.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
rmd160.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
skipjack.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
skipjack.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
xform.c Check key size for rijndael, as invalid key size can lead to kernel panic. 2005-08-16 18:59:00 +00:00
xform.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00