On Tue, May 13, 2025 at 9:36 AM T.J. Mercier 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
> Acked-by: Christian König
d-by: Christian König
Acked-by: Song Liu
With one more comment below.
[...]
> diff --git a/tools/testing/selftests/bpf/progs/dmabuf_iter.c
> b/tools/testing/selftests/bpf/progs/dmabuf_iter.c
> new file mode 100644
> index ..2a1b5397196d
> --- /dev/null
>
On Mon, May 12, 2025 at 10:41 AM T.J. Mercier 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
> Acked-by: Christian König
On Mon, May 12, 2025 at 10:41 AM T.J. Mercier wrote:
[...]
> +
> +static int udmabuf;
static int udmabuf = -1;
> +static const char udmabuf_test_buffer_name[DMA_BUF_NAME_LEN] =
> "udmabuf_test_buffer_for_iter";
> +static size_t udmabuf_test_buffer_size;
> +static int sysheap_dmabuf;
static int
On Fri, May 9, 2025 at 2:43 PM T.J. Mercier wrote:
>
[...]
> >
> > Personally, I would prefer we just merge all the logic of
> > create_udmabuf() and create_sys_heap_dmabuf()
> > into create_test_buffers().
>
> That's a lot of different stuff to put in one place. How about
> returning file descrip
On Thu, May 8, 2025 at 11:20 AM T.J. Mercier wrote:
[...]
> +
> +void test_dmabuf_iter(void)
> +{
> + struct dmabuf_iter *skel = NULL;
> + char buf[256];
> + int iter_fd;
> +
> + skel = dmabuf_iter__open_and_load();
> + if (!ASSERT_OK_PTR(skel, "dmabuf_iter__open_and
On Thu, May 8, 2025 at 11:21 AM T.J. Mercier 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.
The way we split 4/5 and 5/5 makes the code tricker to follow. I guess
the motivation is
On Thu, May 8, 2025 at 11:20 AM T.J. Mercier wrote:
[...]
> diff --git a/tools/testing/selftests/bpf/prog_tests/dmabuf_iter.c
> b/tools/testing/selftests/bpf/prog_tests/dmabuf_iter.c
> new file mode 100644
> index ..35745f4ce0f8
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog
structures (now including dmabufs), allowing for more efficient analysis
> of kernel data compared to multiple reads from procfs, sysfs, or
> multiple traditional BPF iterator invocations.
>
> Signed-off-by: T.J. Mercier
Acked-by: Song Liu
With one nitpick below:
> ---
&g
s for the duration of the bpf program execution without
> holding the list mutex.
>
> Signed-off-by: T.J. Mercier
> Reviewed-by: Christian König
Acked-by: Song Liu
With one nitpick below.
> ---
[...]
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> index 8f
ed-off-by: T.J. Mercier
> Reviewed-by: Christian König
Acked-by: Song Liu
On Fri, Apr 18, 2025 at 8:25 AM T.J. Mercier wrote:
>
> On Thu, Apr 17, 2025 at 1:26 PM Song Liu wrote:
> >
> > On Thu, Apr 17, 2025 at 9:05 AM T.J. Mercier wrote:
> > >
> > > On Wed, Apr 16, 2025 at 9:56 PM Song Liu wrote:
> > > >
>
On Mon, Apr 14, 2025 at 3:53 PM T.J. Mercier wrote:
>
> This test creates a udmabuf and uses a BPF program that prints dmabuf
> metadata with the new dmabuf_iter to verify it can be found.
>
> Signed-off-by: T.J. Mercier
> ---
[...]
> +
> +
> +static void subtest_dmabuf_iter_check_udmabuf(struct
On Mon, Apr 14, 2025 at 3:53 PM T.J. Mercier wrote:
>
> The dmabuf iterator traverses the list of all DMA buffers. The list is
> maintained only when CONFIG_DEBUG_FS is enabled.
>
> DMA buffers are refcounted through their associated struct file. A
> reference is taken on each buffer as the list i
On Thu, Apr 17, 2025 at 9:05 AM T.J. Mercier wrote:
>
> On Wed, Apr 16, 2025 at 9:56 PM Song Liu wrote:
> >
> > On Wed, Apr 16, 2025 at 7:09 PM T.J. Mercier wrote:
> > >
> > > On Wed, Apr 16, 2025 at 6:26 PM Song Liu wrote:
> > [...]
> > > &g
On Wed, Apr 16, 2025 at 7:09 PM T.J. Mercier wrote:
>
> On Wed, Apr 16, 2025 at 6:26 PM Song Liu wrote:
[...]
> >
> > Here is another rookie question, it appears to me there is a file descriptor
> > associated with each DMA buffer, can we achieve the same goal with
On Wed, Apr 16, 2025 at 4:40 PM T.J. Mercier wrote:
>
> On Wed, Apr 16, 2025 at 4:08 PM Song Liu wrote:
> >
> > On Wed, Apr 16, 2025 at 3:51 PM T.J. Mercier wrote:
> > [...]
> > > >
> > > > IIUC, the iterator simply traverses elements in a linked
On Wed, Apr 16, 2025 at 3:51 PM T.J. Mercier wrote:
[...]
> >
> > IIUC, the iterator simply traverses elements in a linked list. I feel it is
> > an overkill to implement a new BPF iterator for it.
>
> Like other BPF iterators such as kmem_cache_iter or task_iter.
> Cgroup_iter iterates trees inst
On Mon, Apr 14, 2025 at 3:53 PM T.J. Mercier wrote:
[...]
> +
> +BTF_ID_LIST_GLOBAL_SINGLE(bpf_dmabuf_btf_id, struct, dma_buf)
> +DEFINE_BPF_ITER_FUNC(dmabuf, struct bpf_iter_meta *meta, struct dma_buf
> *dmabuf)
> +
> +static void *dmabuf_iter_seq_start(struct seq_file *seq, loff_t *pos)
> +{
>
; drivers/infiniband/core/ucma.c| 2 +-
> drivers/macintosh/mac_hid.c | 2 +-
> drivers/md/md.c | 2 +-
For md bits:
Reviewed-by: Song Liu
Thanks,
Song
[...]
= sizeof(int),
> .mode = S_IRUGO|S_IWUSR,
> .proc_handler = proc_dointvec,
> - },
> - { }
> + }
> };
Please keep "}," as Greg suggested. Otherwise,
Acked-by: Song Liu
Thanks,
Song
21 matches
Mail list logo