Re: [RFC PATCH net-next v6 09/15] memory-provider: dmabuf devmem memory provider

From
Pavel Begunkov <asml.silence@gmail.com>
Date
2024-03-06 14:59:40
Also in
bpf, dri-devel, linux-alpha, linux-arch, linux-doc, linux-kselftest, linux-media, linux-mips, linux-trace-kernel, lkml, sparclinux
Reply to
Mina Almasry, 2024-03-06
On 3/6/24 02:42, Mina Almasry wrote:
On Tue, Mar 5, 2024 at 6:28 PM David Wei [off-list ref] wrote:
quoted
On 2024-03-04 18:01, Mina Almasry wrote:
quoted
+     if (pool->p.queue)
+             binding = READ_ONCE(pool->p.queue->binding);
+
+     if (binding) {
+             pool->mp_ops = &dmabuf_devmem_ops;
+             pool->mp_priv = binding;
+     }
This is specific to TCP devmem. For ZC Rx we will need something more
generic to let us pass our own memory provider backend down to the page
pool.

What about storing ops and priv void ptr in struct netdev_rx_queue
instead? Then we can both use it.
Yes, this is dmabuf specific, I was thinking you'd define your own
member of netdev_rx_queue, and then add something like this to
page_pool_init:
That would be quite annoying, there are 3 expected users together
with huge pages, each would need a field and check all others are
disabled as you mentioned and so on. It should be cleaner to pass
a generic {pp_ops,pp_private} pair instead.

If header dependencies is a problem, you it can probably be

struct pp_provider_param {
	struct pp_ops ops;
	void *private;
};

# netdev_rx_queue.h

// definition is not included here
struct pp_provider_params;

struct netdev_rx_queue {
	...
	struct pp_provider_params *pp_params;
};

-- 
Pavel Begunkov
Thread (73 messages) 73 messages, 10 authors, last reply 2024-04-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help