]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ccr: Use a software OCF session for requests which fallback to software.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 4 Jan 2022 22:22:32 +0000 (14:22 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 4 Jan 2022 22:22:32 +0000 (14:22 -0800)
commite43cf698d93c9f3007ade4884c6ace38eec43a52
tree22a63abc026c1fd12c6b3caf9043c99cc8a4ae01
parent74d3f1b63dbea05038e966cf4bb69a01b0589500
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.

2) 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).

3) 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
sys/dev/cxgbe/crypto/t4_crypto.c