The KTLS crypto callback always locks the session to deliver a wakeup.
But if we're handling the operation synchronously this is wasted effort.
On an Ampere server this results in a large amount of sleepqueue lock
contention. Use CRYPTO_SESS_SYNC() to determine whether the operation
will be completed asynchronously or not, and select a callback
appropriately.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/opencrypto/ktls_ocf.c | ||
---|---|---|
141 | These two statements can be moved up out of the loop. |
sys/opencrypto/ktls_ocf.c | ||
---|---|---|
141 | I had written it that way originally, but I noticed that we handle EAGAIN (i.e., the crypto driver changed) by looping, in which case we should re-evaluate the flag. Does that not make sense for some reason? |
sys/opencrypto/ktls_ocf.c | ||
---|---|---|
141 | Oh, humm, ok. I think long term I want crypto_dispatch() to return EINPROGRESS when it doesn't complete the request synchronously, but this is fine for now. |