Commit Graph

3 Commits

Author SHA1 Message Date
Jerome Marchand 0b7a94f140 selftests/bpf: Test case for SEC("?.struct_ops")
JIRA: https://issues.redhat.com/browse/RHEL-23649

commit 733e5e875444fc5afc9b72714f0ecaca629ccf8a
Author: Eduard Zingerman <eddyz87@gmail.com>
Date:   Wed Mar 6 12:45:27 2024 +0200

    selftests/bpf: Test case for SEC("?.struct_ops")

    Check that "?.struct_ops" and "?.struct_ops.link" section names define
    struct_ops maps with autocreate == false after open.

    Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20240306104529.6453-14-eddyz87@gmail.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2024-10-15 10:49:14 +02:00
Jerome Marchand a7b1b7e51f selftests/bpf: Verify struct_ops autoload/autocreate sync
JIRA: https://issues.redhat.com/browse/RHEL-23649

commit 651d49f15b2a84b3bcfe950fa99c3672b9619dbd
Author: Eduard Zingerman <eddyz87@gmail.com>
Date:   Wed Mar 6 12:45:23 2024 +0200

    selftests/bpf: Verify struct_ops autoload/autocreate sync

    Check that autocreate flags of struct_ops map cause autoload of
    struct_ops corresponding programs:
    - when struct_ops program is referenced only from a map for which
      autocreate is set to false, that program should not be loaded;
    - when struct_ops program with autoload == false is set to be used
      from a map with autocreate == true using shadow var,
      that program should be loaded;
    - when struct_ops program is not referenced from any map object load
      should fail.

    Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20240306104529.6453-10-eddyz87@gmail.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2024-10-15 10:49:13 +02:00
Jerome Marchand faa6361f1d selftests/bpf: Test autocreate behavior for struct_ops maps
JIRA: https://issues.redhat.com/browse/RHEL-23649

commit 1863acccdf936c6917398165ca97e252d02fa6dd
Author: Eduard Zingerman <eddyz87@gmail.com>
Date:   Wed Mar 6 12:45:21 2024 +0200

    selftests/bpf: Test autocreate behavior for struct_ops maps

    Check that bpf_map__set_autocreate() can be used to disable automatic
    creation for struct_ops maps.

    Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20240306104529.6453-8-eddyz87@gmail.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2024-10-15 10:49:13 +02:00