diff options
author | Sam Leffler <sam@FreeBSD.org> | 2003-06-30 05:09:32 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2003-06-30 05:09:32 +0000 |
commit | d8409aaf6e683996e179b67ebb387777104595cb (patch) | |
tree | 5f6e66583ac67766f3158c80d1f5db5a2c905add /sys/opencrypto/crypto.c | |
parent | 9b6e332f0885db9a85e5d22c1717d83812e49bad (diff) | |
download | src-d8409aaf6e683996e179b67ebb387777104595cb.tar.gz src-d8409aaf6e683996e179b67ebb387777104595cb.zip |
consolidate callback optimization check in one location by adding a flag
for crypto operations that indicates the crypto code should do the check
in crypto_done
MFC after: 1 day
Notes
Notes:
svn path=/head/; revision=117058
Diffstat (limited to 'sys/opencrypto/crypto.c')
-rw-r--r-- | sys/opencrypto/crypto.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index e2683dc790b7..3bb53bcfedb9 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -950,7 +950,16 @@ crypto_done(struct cryptop *crp) if (crypto_timing) crypto_tstat(&cryptostats.cs_done, &crp->crp_tstamp); #endif - if (crp->crp_flags & CRYPTO_F_CBIMM) { + /* + * CBIMM means unconditionally do the callback immediately; + * CBIFSYNC means do the callback immediately only if the + * operation was done synchronously. Both are used to avoid + * doing extraneous context switches; the latter is mostly + * used with the software crypto driver. + */ + if ((crp->crp_flags & CRYPTO_F_CBIMM) || + ((crp->crp_flags & CRYPTO_F_CBIFSYNC) && + (CRYPTO_SESID2CAPS(crp->crp_sid) & CRYPTOCAP_F_SYNC))) { /* * Do the callback directly. This is ok when the * callback routine does very little (e.g. the |