Commit Graph

12 Commits

Author SHA1 Message Date
Mark Johnston
8fcf230c13 qat: Address -Wunused-but-set-variable warnings
MFC after:	1 week
2021-12-17 13:10:22 -05:00
John Baldwin
6e17a2e00d crypto: Validate AES-GCM IV length in check_csp().
This centralizes the check for valid nonce lengths for AES-GCM.

While here, remove some duplicate checks for valid AES-GCM tag lengths
from ccp(4) and ccr(4).

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33194
2021-12-09 11:52:41 -08:00
Mark Johnston
843d16436d qat: Make prototypes consistent with the implementation
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-04-05 16:30:00 -04:00
Mark Johnston
bd674d8b1f qat: Add support for separate AAD and output buffers
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:30:58 -05:00
Mark Johnston
6483fc224b qat: Free counters during detach
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
a33b29a044 qat: Count request allocation failures
This can be useful for troubleshooting performance problems.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
95ee7d9b87 qat: Fix DH895XCC firmware module autoloading
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Ryan Libby
324f89d9c8 qat: quiet -Wredundant-decls
Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27554
2020-12-11 22:51:53 +00:00
Mark Johnston
e4b675c929 qat: Initialize the crypto device ID to -1 instead of 0
Otherwise qat_detach() may attempt to deregister an unrelated crypto
driver if an error occurs in qat_attach() before crypto_get_driverid()
is called, since 0 is a valid driver ID.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-30 20:53:45 +00:00
Mark Johnston
7695ced633 qat: Fix firmware module autoloading
If firmware_get() fails to find a loaded firmware image, it searches for
candidate KLDs to load.  It will search for a KLD containing a module
with the same name as the requested image, and failing that, will load a
KLD with the same basename as the requested image.

The module name given by fw_stub.awk is simply "<mangled KLD name>_fw".

QAT firmware modules contain two images, neither of which match either
of the names used during lookup, so automatic loading of firmware images
after mountroot does not work.  Work around this by using the same
string for the first image name and for the KLD basename.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-30 20:53:25 +00:00
Mark Johnston
381219b64d qat: Fix nits reported by Coverity
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2020-11-12 15:00:48 +00:00
Mark Johnston
72143e89bb Add qat(4)
This provides an OpenCrypto driver for Intel QuickAssist devices.  The
driver was initially ported from NetBSD and comes with a few
improvements:
- support for GMAC/AES-GCM, AES-CTR and AES-XTS, and support for
  SHA/HMAC-authenticated encryption
- support for detaching the driver
- various bug fixes
- DH895X support

Discussed with:	jhb
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D26963
2020-11-05 15:55:23 +00:00