Re: [PATCH bpf-next v6 5/5] selftests/bpf: Add test for open coded dmabuf_iter

2025-05-14 Thread Song Liu
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

Re: [PATCH bpf-next v6 4/5] selftests/bpf: Add test for dmabuf_iter

2025-05-14 Thread Song Liu
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 >

Re: [PATCH bpf-next v5 5/5] selftests/bpf: Add test for open coded dmabuf_iter

2025-05-12 Thread Song Liu
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

Re: [PATCH bpf-next v5 4/5] selftests/bpf: Add test for dmabuf_iter

2025-05-12 Thread Song Liu
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

Re: [PATCH bpf-next v4 5/5] selftests/bpf: Add test for open coded dmabuf_iter

2025-05-09 Thread Song Liu
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

Re: [PATCH bpf-next v4 4/5] selftests/bpf: Add test for dmabuf_iter

2025-05-09 Thread Song Liu
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

Re: [PATCH bpf-next v4 5/5] selftests/bpf: Add test for open coded dmabuf_iter

2025-05-09 Thread Song Liu
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

Re: [PATCH bpf-next v4 4/5] selftests/bpf: Add test for dmabuf_iter

2025-05-08 Thread Song Liu
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

Re: [PATCH bpf-next v4 3/5] bpf: Add open coded dmabuf iterator

2025-05-08 Thread Song Liu
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

Re: [PATCH bpf-next v4 2/5] bpf: Add dmabuf iterator

2025-05-08 Thread Song Liu
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

Re: [PATCH bpf-next v4 1/5] dma-buf: Rename debugfs symbols

2025-05-08 Thread Song Liu
ed-off-by: T.J. Mercier > Reviewed-by: Christian König Acked-by: Song Liu

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-21 Thread 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: > > > > >

Re: [PATCH 3/4] selftests/bpf: Add test for dmabuf_iter

2025-04-21 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-21 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-17 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-17 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-16 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-16 Thread Song Liu
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

Re: [PATCH 2/4] bpf: Add dmabuf iterator

2025-04-16 Thread Song Liu
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) > +{ >

Re: [PATCH] treewide: const qualify ctl_tables where applicable

2025-01-09 Thread Song Liu
; 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 [...]

Re: [PATCH 13/15] raid: Remove now superfluous sentinel element from ctl_table array

2023-09-28 Thread Song Liu
= sizeof(int), > .mode = S_IRUGO|S_IWUSR, > .proc_handler = proc_dointvec, > - }, > - { } > + } > }; Please keep "}," as Greg suggested. Otherwise, Acked-by: Song Liu Thanks, Song