[PATCH bpf-next v5 5/5] selftests/bpf: Add test for open coded dmabuf_iter
Song Liu
song at kernel.org
Mon May 12 20:29:43 UTC 2025
On Mon, May 12, 2025 at 10:41 AM T.J. Mercier <tjmercier at google.com> wrote:
>
> Use the same test buffers as the traditional iterator and a new BPF map
> to verify the test buffers can be found with the open coded dmabuf
> iterator.
>
> Signed-off-by: T.J. Mercier <tjmercier at google.com>
> Acked-by: Christian König <christian.koenig at amd.com>
Acked-by: Song Liu <song at kernel.org>
With a nitpick below.
[...]
>
> -static int create_test_buffers(void)
> +static int create_test_buffers(int map_fd)
> {
> + bool f = false;
> +
> udmabuf = create_udmabuf();
> sysheap_dmabuf = create_sys_heap_dmabuf();
>
> if (udmabuf < 0 || sysheap_dmabuf < 0)
> return -1;
>
> - return 0;
> + return bpf_map_update_elem(map_fd, udmabuf_test_buffer_name, &f, BPF_ANY) ||
> + bpf_map_update_elem(map_fd, sysheap_test_buffer_name, &f, BPF_ANY);
nit: Instead of passing map_fd in here, we can just call
bpf_map_update_elem() in test_dmabuf_iter()
[...]
More information about the dri-devel
mailing list