On Mon, May 12, 2025 at 1:30 PM Song Liu song@kernel.org wrote:
On Mon, May 12, 2025 at 10:41 AM T.J. Mercier tjmercier@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@google.com Acked-by: Christian König christian.koenig@amd.com
Acked-by: Song Liu song@kernel.org
Thanks, I'll send v6 this afternoon or tomorrow morning with all changes.
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()
[...]