netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Daniel Borkmann <daniel@iogearbox.net>,
	Vadim Fedorenko <vadfed@meta.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Andrii Nakryiko <andrii@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Mykola Lysenko <mykolal@fb.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next 2/2] selftests: bpf: crypto skcipher algo selftests
Date: Thu, 26 Oct 2023 19:20:33 +0100	[thread overview]
Message-ID: <4693cb58-ab86-495f-838e-50464fe116ce@linux.dev> (raw)
In-Reply-To: <d7f21ccf-a866-53e1-4de9-e1cc972edaed@iogearbox.net>

On 26/10/2023 15:02, Daniel Borkmann wrote:
> On 10/26/23 3:59 AM, Vadim Fedorenko wrote:
>> Add simple tc hook selftests to show the way to work with new crypto
>> BPF API. Some weird structre and map are added to setup program to make
>> verifier happy about dynptr initialization from memory. Simple AES-ECB
>> algo is used to demonstrate encryption and decryption of fixed size
>> buffers.
>>
>> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
>> ---
>>   tools/testing/selftests/bpf/config            |   1 +
>>   .../selftests/bpf/prog_tests/crypto_sanity.c  | 129 +++++++++++++++
>>   .../selftests/bpf/progs/crypto_common.h       |  98 +++++++++++
>>   .../selftests/bpf/progs/crypto_sanity.c       | 154 ++++++++++++++++++
>>   4 files changed, 382 insertions(+)
>>   create mode 100644 
>> tools/testing/selftests/bpf/prog_tests/crypto_sanity.c
>>   create mode 100644 tools/testing/selftests/bpf/progs/crypto_common.h
>>   create mode 100644 tools/testing/selftests/bpf/progs/crypto_sanity.c
>>
>> diff --git a/tools/testing/selftests/bpf/config 
>> b/tools/testing/selftests/bpf/config
>> index 02dd4409200e..2a5d6339831b 100644
>> --- a/tools/testing/selftests/bpf/config
>> +++ b/tools/testing/selftests/bpf/config
>> @@ -14,6 +14,7 @@ CONFIG_CGROUP_BPF=y
>>   CONFIG_CRYPTO_HMAC=y
>>   CONFIG_CRYPTO_SHA256=y
>>   CONFIG_CRYPTO_USER_API_HASH=y
>> +CONFIG_CRYPTO_SKCIPHER=y
>>   CONFIG_DEBUG_INFO=y
>>   CONFIG_DEBUG_INFO_BTF=y
>>   CONFIG_DEBUG_INFO_DWARF4=y
> 
> Quick note: for upstream CI side, more config seems missing, see the GHA 
> failure:

Thanks for the signal, Daniel. Looks like CONFIG_CRYPTO_ECB is missing.
I'll adjust config for v2, but I'll wait a bit longer to get more
feedback

> https://github.com/kernel-patches/bpf/actions/runs/6654055344/job/18081734522
> 
> Notice: Success: 435/3403, Skipped: 32, Failed: 1
> Error: #64 crypto_sanity
>    Error: #64 crypto_sanity
>    test_crypto_sanity:PASS:skel open 0 nsec
>    test_crypto_sanity:PASS:ip netns add crypto_sanity_ns 0 nsec
>    test_crypto_sanity:PASS:ip -net crypto_sanity_ns -6 addr add 
> face::1/128 dev lo nodad 0 nsec
>    test_crypto_sanity:PASS:ip -net crypto_sanity_ns link set dev lo up 0 
> nsec
>    test_crypto_sanity:PASS:crypto_sanity__load 0 nsec
>    open_netns:PASS:malloc token 0 nsec
>    open_netns:PASS:open /proc/self/ns/net 0 nsec
>    open_netns:PASS:open netns fd 0 nsec
>    open_netns:PASS:setns 0 nsec
>    test_crypto_sanity:PASS:open_netns 0 nsec
>    test_crypto_sanity:PASS:if_nametoindex lo 0 nsec
>    test_crypto_sanity:PASS:crypto_sanity__attach 0 nsec
>    test_crypto_sanity:PASS:skb_crypto_setup fd 0 nsec
>    test_crypto_sanity:PASS:skb_crypto_setup 0 nsec
>    test_crypto_sanity:PASS:skb_crypto_setup retval 0 nsec
>    test_crypto_sanity:FAIL:skb_crypto_setup status unexpected error: -95 
> (errno 2)
>    libbpf: Kernel error message: Parent Qdisc doesn't exists
>    close_netns:PASS:setns 0 nsec
> Test Results:
>               bpftool: PASS
>   test_progs-no_alu32: FAIL (returned 1)
>              shutdown: CLEAN
> Error: Process completed with exit code 1.


  reply	other threads:[~2023-10-26 18:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26  1:59 [PATCH bpf-next 1/2] bpf: add skcipher API support to TC/XDP programs Vadim Fedorenko
2023-10-26  1:59 ` [PATCH bpf-next 2/2] selftests: bpf: crypto skcipher algo selftests Vadim Fedorenko
2023-10-26 14:02   ` Daniel Borkmann
2023-10-26 18:20     ` Vadim Fedorenko [this message]
2023-10-26 21:47 ` [PATCH bpf-next 1/2] bpf: add skcipher API support to TC/XDP programs Jakub Kicinski
2023-10-26 23:29   ` Vadim Fedorenko
2023-10-27  1:35     ` Jakub Kicinski
2023-10-27 12:07       ` Vadim Fedorenko
2023-10-27 17:02       ` Vadim Fedorenko
2023-10-26 22:53 ` Alexei Starovoitov
2023-10-26 23:38   ` Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4693cb58-ab86-495f-838e-50464fe116ce@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=vadfed@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).