cvs commit: src/sys/opencrypto crypto.c cryptodev.h

Pawel Jakub Dawidek pjd at
Wed May 17 11:13:06 PDT 2006

pjd         2006-05-17 18:12:44 UTC

  FreeBSD src repository

  Modified files:
    sys/opencrypto       crypto.c cryptodev.h 
  - 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
  - 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
  Revision  Changes    Path
  1.19      +139 -145  src/sys/opencrypto/crypto.c
  1.13      +1 -0      src/sys/opencrypto/cryptodev.h

More information about the cvs-src mailing list