HomeFreeBSD

ktls: Avoid wakeups and locking for synchronous callbacks

Description

ktls: Avoid wakeups and locking for synchronous callbacks

When performing encryption in software, the KTLS crypto callback always
locks the session to deliver a wakeup. But, if we're handling the
operation synchronously this is wasted effort and can result in
sleepqueue lock contention on large systems.

Use CRYPTO_SESS_SYNC() to determine whether the operation will be
completed asynchronously or not, and select a callback appropriately.
Avoid locking the session to check for completion if the session handles
requests synchronously.

Reviewed by: jhb
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28195

Details

Provenance
markjAuthored on Feb 8 2021, 2:19 PM
Reviewer
jhb
Differential Revision
D28195: ktls: Avoid wakeups and locking for synchronous callbacks
Parents
rG68f6800ce05c: opencrypto: Introduce crypto_dispatch_async()
Branches
Unknown
Tags
Unknown