Page MenuHomeFreeBSD

Add crypto_initreq() and crypto_destroyreq().
ClosedPublic

Authored by jhb on Jul 16 2020, 6:24 PM.

Details

Summary

These routines are similar to crypto_getreq() and crypto_freereq()
but operate on caller-supplied storage instead of allocating crypto
requests from a UMA zone.

Test Plan
  • used this with some KTLS performance testing

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb requested review of this revision.Jul 16 2020, 6:24 PM
jhb created this revision.

LGTM aside from the comments.

sys/opencrypto/crypto.c
1768 ↗(On Diff #74534)

Style doesn't require the extra newline anymore.

1796 ↗(On Diff #74534)

This needs to be conditional on crp != NULL.

This revision is now accepted and ready to land.Jul 16 2020, 6:30 PM
jhb added a subscriber: asomers.

Added @asomers since Alan's been looking at GELI stuff. One of the things I changed in the OCF rework was to make GELI use crypto_getreq instead of preallocating space for the crypto requests along with other data it was already allocating. That part could be reverted now to using this API instead and doing fewer allocations. (It's still better than the old OCF bits that needed the crd's as well as the crp).

jhb marked 2 inline comments as done.Jul 16 2020, 8:16 PM
jhb added inline comments.
sys/opencrypto/crypto.c
1796 ↗(On Diff #74534)

Oof, this is an old bug from when I added the 'how' flag to support M_NOWAIT.

jhb marked an inline comment as done.
  • Review feedback.
This revision now requires review to proceed.Jul 16 2020, 9:17 PM
This revision is now accepted and ready to land.Jul 16 2020, 9:19 PM
This revision was automatically updated to reflect the committed changes.