summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/cryptosoft.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-06-27 20:07:10 +0000
committersam <sam@FreeBSD.org>2003-06-27 20:07:10 +0000
commite6589a620a554ff7fdfd4d65dcb123787738ffa8 (patch)
treeabc501f01c8b5f6abaa2809bc2c82a2c09eaf55e /sys/opencrypto/cryptosoft.c
parent0b4d9704b927e84d9d5616e2ae39c36679ea5588 (diff)
downloadFreeBSD-src-e6589a620a554ff7fdfd4d65dcb123787738ffa8.zip
FreeBSD-src-e6589a620a554ff7fdfd4d65dcb123787738ffa8.tar.gz
Add support to eliminate a context switch per crypto op when using the
software crypto device: o record crypto device capabilities in each session id o add a capability that indicates if the crypto driver operates synchronously o tag the software crypto driver as operating synchronously This commit also introduces crypto session id macros that cleanup their construction and querying.
Diffstat (limited to 'sys/opencrypto/cryptosoft.c')
-rw-r--r--sys/opencrypto/cryptosoft.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index 5093753..6fa156e 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -813,7 +813,7 @@ swcr_freesession(void *arg, u_int64_t tid)
struct enc_xform *txf;
struct auth_hash *axf;
struct comp_algo *cxf;
- u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
+ u_int32_t sid = CRYPTO_SESID2LID(tid);
if (sid > swcr_sesnum || swcr_sessions == NULL ||
swcr_sessions[sid] == NULL)
@@ -999,7 +999,7 @@ done:
static void
swcr_init(void)
{
- swcr_id = crypto_get_driverid(CRYPTOCAP_F_SOFTWARE);
+ swcr_id = crypto_get_driverid(CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC);
if (swcr_id < 0)
panic("Software crypto device cannot initialize!");
crypto_register(swcr_id, CRYPTO_DES_CBC,
OpenPOWER on IntegriCloud