Subject: Re: [PATCH bpf-next 2/6] selftests/bpf: Add tests for automatic map unpinning on load failure

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Fri, 08 Nov 2019 21:00:39 +0100

Song Liu <[email-masked]> writes:

> On Thu, Nov 7, 2019 at 8:52 AM Toke Høiland-Jørgensen <[email-masked]> wrote:
>>
>> From: Toke Høiland-Jørgensen <[email-masked]>
>>
>> This add tests for the different variations of automatic map unpinning on
>> load failure.
>>
>> Signed-off-by: Toke Høiland-Jørgensen <[email-masked]>
>> ---
>
> [...]
>
>> diff --git a/tools/testing/selftests/bpf/progs/test_pinning.c b/tools/testing/selftests/bpf/progs/test_pinning.c
>> index f69a4a50d056..f20e7e00373f 100644
>> --- a/tools/testing/selftests/bpf/progs/test_pinning.c
>> +++ b/tools/testing/selftests/bpf/progs/test_pinning.c
>> @@ -21,7 +21,7 @@ struct {
>>  } nopinmap SEC(".maps");
>>
>>  struct {
>> -       __uint(type, BPF_MAP_TYPE_ARRAY);
>> +       __uint(type, BPF_MAP_TYPE_HASH);
>
> Why do we need this change?

Because it needs to be different from the top map: I'm changing which of
the maps to use for the "check for parameter mismatch" selftest; the
last map needs to be the one that fails, so that a previous one can
succeed first and get removed on failure clean-up (which we can then
test for)...

-Toke