FreeBSD: Improve crypto_dispatch() handling
commitd51f4ea5f9575847a271f2c99253b072a6ede07e
authorAlexander Motin <mav@FreeBSD.org>
Fri, 17 Jun 2022 22:38:51 +0000 (17 18:38 -0400)
committerGitHub <noreply@github.com>
Fri, 17 Jun 2022 22:38:51 +0000 (17 15:38 -0700)
tree924e737066539e0bcde5fadffbabb38fb1fecba7
parentf60973998593c37f55beea05e74528c1992b7849
FreeBSD: Improve crypto_dispatch() handling

Handle crypto_dispatch() return values same as crp->crp_etype errors.
On FreeBSD 12 many drivers returned same errors both ways, and lack
of proper handling for the first ended up in assertion panic later.
It was changed in FreeBSD 13, but there is no reason to not be safe.

While there, skip waiting for completion, including locking and
wakeup() call, for sessions on synchronous crypto drivers, such as
typical aesni and software.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13563
module/os/freebsd/zfs/crypto_os.c