HomeFreeBSD

ccr: Use a software OCF session for requests which fallback to software.

Description

ccr: Use a software OCF session for requests which fallback to software.

Previously the driver duplicated code from cryptosoft.c to handle
certain edge case AES-CCM and AES-GCM requests. However, this
approach has a few downsides:

  1. It only uses "plain" software and not accelerated software since it uses enc_xform directly.
  1. It performs the operation synchronously even though the caller believes it is invoking an async driver. This was fine for the original use case of requests with only AAD and no payload that execute quickly, but is a bit more disingenuous for large requests which fall back due to exceeding the size of a firmware work request (e.g. due to large scatter/gather lists).
  1. It has required several updates since ccr(4) was added to the tree.

Instead, allocate a software session for AES-CCM and AES-GCM sessions
and dispatch a cloned request asynchronusly to the software session.

Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33608

(cherry picked from commit e43cf698d93c9f3007ade4884c6ace38eec43a52)

Details

Provenance
jhbAuthored on Jan 4 2022, 10:22 PM
Reviewer
markj
Differential Revision
D33608: ccr: Use a software OCF session for requests which fallback to software.
Parents
rG6a13905b5ab3: OCF: Add crypto_clonereq().
Branches
Unknown
Tags
Unknown