diff options
author | pjd <pjd@FreeBSD.org> | 2006-05-17 18:12:44 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-05-17 18:12:44 +0000 |
commit | eaddfa446c9ad87aa799d5eb2a97f30296c3a243 (patch) | |
tree | 4d034e5502b0e22c447a85a42fca3e9cf5859a93 /sys/opencrypto/cryptodev.h | |
parent | b51022e9f791e29b9fb7902bb2f2425b259ad823 (diff) | |
download | FreeBSD-src-eaddfa446c9ad87aa799d5eb2a97f30296c3a243.zip FreeBSD-src-eaddfa446c9ad87aa799d5eb2a97f30296c3a243.tar.gz |
- 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
Diffstat (limited to 'sys/opencrypto/cryptodev.h')
-rw-r--r-- | sys/opencrypto/cryptodev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index 6791b35..b1999d7 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -303,6 +303,7 @@ struct cryptkop { /* Crypto capabilities structure */ struct cryptocap { u_int32_t cc_sessions; + u_int32_t cc_koperations; /* * Largest possible operator length (in bits) for each type of |