On Mon, Jan 15, 2024 at 02:08 PM -08, Vadim Fedorenko wrote: > Add simple tc hook selftests to show the way to work with new crypto > BPF API. Some tricky dynptr initialization is used to provide empty iv > dynptr. Simple AES-ECB algo is used to demonstrate encryption and > decryption of fixed size buffers. > > Signed-off-by: Vadim Fedorenko <vadfed@xxxxxxxx> > --- [...] > diff --git a/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c > new file mode 100644 > index 000000000000..70bde9640651 > --- /dev/null > +++ b/tools/testing/selftests/bpf/prog_tests/crypto_sanity.c > @@ -0,0 +1,217 @@ [...] > +static void deinit_afalg(void) > +{ > + if (tfmfd) > + close(tfmfd); > + if (opfd) > + close(opfd); > +} Did you mean tfmfd/opfd != -1? [...]