Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-09 Thread Pavel Begunkov
On 6/7/24 17:59, Mina Almasry wrote: On Fri, Jun 7, 2024 at 8:47 AM Pavel Begunkov wrote: On 6/7/24 16:42, Pavel Begunkov wrote: On 6/7/24 15:27, David Ahern wrote: On 6/7/24 7:42 AM, Pavel Begunkov wrote: I haven't seen any arguments against from the (net) maintainers so far. Nor I see

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-09 Thread Pavel Begunkov
for returning buffers might even be a nuisance. -- Pavel Begunkov

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-07 Thread Pavel Begunkov
On 6/7/24 16:42, Pavel Begunkov wrote: On 6/7/24 15:27, David Ahern wrote: On 6/7/24 7:42 AM, Pavel Begunkov wrote: I haven't seen any arguments against from the (net) maintainers so far. Nor I see any objection against callbacks from them (considering that either option adds an if). I have

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-07 Thread Pavel Begunkov
On 6/7/24 15:27, David Ahern wrote: On 6/7/24 7:42 AM, Pavel Begunkov wrote: I haven't seen any arguments against from the (net) maintainers so far. Nor I see any objection against callbacks from them (considering that either option adds an if). I have said before I do not understand why

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-07 Thread Pavel Begunkov
On 6/5/24 09:24, Christoph Hellwig wrote: On Mon, Jun 03, 2024 at 03:52:32PM +0100, Pavel Begunkov wrote: The question for Christoph is what exactly is the objection here? Why we would not be using well defined ops when we know there will be more users? The point is that there should

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-07 Thread Pavel Begunkov
On 6/3/24 16:43, Mina Almasry wrote: On Mon, Jun 3, 2024 at 7:52 AM Pavel Begunkov wrote: On 6/3/24 15:17, Mina Almasry wrote: On Fri, May 31, 2024 at 10:35 PM Christoph Hellwig wrote: On Thu, May 30, 2024 at 08:16:01PM +, Mina Almasry wrote: I'm unsure if the discussion has been

Re: [PATCH net-next v10 06/14] page_pool: convert to use netmem

2024-06-07 Thread Pavel Begunkov
quot; in the ring buffer is useless. netmem is a pointer with one bit serving as a flag, considering mangling it might be better to %p it and perhaps also print its type (page* vs iov) separately. -- Pavel Begunkov

Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers

2024-06-03 Thread Pavel Begunkov
ol_is_dmabuf(pool))) + netmem = mp_dmabuf_devmem_alloc_pages(): else netmem = __page_pool_alloc_pages_slow(pool, gfp); return netmem; -- Pavel Begunkov

Re: [PATCH net-next v10 01/14] netdev: add netdev_rx_queue_restart()

2024-06-03 Thread Pavel Begunkov
art) + return -EOPNOTSUPP; + + DEBUG_NET_WARN_ON_ONCE(!rtnl_is_locked()); -- Pavel Begunkov

Re: [PATCH net-next v9 11/14] tcp: RX path for devmem TCP

2024-05-28 Thread Pavel Begunkov
if not, I can look into squashing some fix. Let it be this way then. It's not a problem while there is only one such a provider. -- Pavel Begunkov

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-08 Thread Pavel Begunkov
On 5/8/24 16:51, Christoph Hellwig wrote: On Wed, May 08, 2024 at 12:35:52PM +0100, Pavel Begunkov wrote: all these, because e.g. ttm internally does have a page pool because depending upon allocator, that's indeed beneficial. Other drm drivers have more buffer-based concepts

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-08 Thread Pavel Begunkov
On 5/8/24 16:58, Jason Gunthorpe wrote: On Wed, May 08, 2024 at 04:44:32PM +0100, Pavel Begunkov wrote: like a weird and indirect way to get there. Why can't io_uring just be the entity that does the final free and not mess with the logic allocator? Then the user has to do a syscall (e.g

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-08 Thread Pavel Begunkov
On 5/8/24 15:25, Jason Gunthorpe wrote: On Wed, May 08, 2024 at 12:30:07PM +0100, Pavel Begunkov wrote: I'm not going to pretend to know about page pool details, but dmabuf is the way to get the bulk of pages into a pool within the net stack's allocator and keep that bulk properly refcounted

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-08 Thread Pavel Begunkov
On 5/8/24 08:16, Daniel Vetter wrote: On Tue, May 07, 2024 at 08:32:47PM -0300, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 08:35:37PM +0100, Pavel Begunkov wrote: On 5/7/24 18:56, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 06:25:52PM +0100, Pavel Begunkov wrote: On 5/7/24 17:48

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-08 Thread Pavel Begunkov
On 5/8/24 00:32, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 08:35:37PM +0100, Pavel Begunkov wrote: On 5/7/24 18:56, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 06:25:52PM +0100, Pavel Begunkov wrote: On 5/7/24 17:48, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 09:42:05AM -0700

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
On 5/7/24 18:56, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 06:25:52PM +0100, Pavel Begunkov wrote: On 5/7/24 17:48, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 09:42:05AM -0700, Mina Almasry wrote: 1. Align with devmem TCP to use udmabuf for your io_uring memory. I think in the past

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
On 5/7/24 18:15, Mina Almasry wrote: On Tue, May 7, 2024 at 9:55 AM Pavel Begunkov wrote: On 5/7/24 17:23, Christoph Hellwig wrote: On Tue, May 07, 2024 at 01:18:57PM -0300, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 05:05:12PM +0100, Pavel Begunkov wrote: even in tree if you give them

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
mandate uapi change in a not desirable way. -- Pavel Begunkov

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
On 5/7/24 17:42, Mina Almasry wrote: On Tue, May 7, 2024 at 9:24 AM Christoph Hellwig wrote: On Tue, May 07, 2024 at 01:18:57PM -0300, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 05:05:12PM +0100, Pavel Begunkov wrote: even in tree if you give them enough rope, and they should not have

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
On 5/7/24 17:23, Christoph Hellwig wrote: On Tue, May 07, 2024 at 01:18:57PM -0300, Jason Gunthorpe wrote: On Tue, May 07, 2024 at 05:05:12PM +0100, Pavel Begunkov wrote: even in tree if you give them enough rope, and they should not have that rope when the only sensible options are page/folio

Re: [RFC PATCH net-next v8 02/14] net: page_pool: create hooks for custom page providers

2024-05-07 Thread Pavel Begunkov
e branches for page based vs dmabuf in a few places. -- Pavel Begunkov

Re: [RFC PATCH net-next v8 07/14] page_pool: devmem support

2024-04-30 Thread Pavel Begunkov
do here or if something more appropriate to be in the patches you apply on top. I additionally think you may also need to run the page_pool_benchmark_simple tests like I do in the cover letter to see if you're affecting those. -- Pavel Begunkov

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-07 Thread Pavel Begunkov
On 3/6/24 21:59, Mina Almasry wrote: On Wed, Mar 6, 2024 at 11:14 AM Pavel Begunkov wrote: On 3/6/24 17:04, Mina Almasry wrote: On Wed, Mar 6, 2024 at 6:30 AM Pavel Begunkov wrote: On 3/5/24 22:36, Mina Almasry wrote: ... To be honest, I think it makes sense for the TCP stack

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-06 Thread Pavel Begunkov
On 3/6/24 17:04, Mina Almasry wrote: On Wed, Mar 6, 2024 at 6:30 AM Pavel Begunkov wrote: On 3/5/24 22:36, Mina Almasry wrote: On Tue, Mar 5, 2024 at 1:55 PM David Wei wrote: On 2024-03-04 18:01, Mina Almasry wrote: +struct memory_provider_ops { + int (*init)(struct page_pool *pool

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

2024-03-06 Thread Pavel Begunkov
provider_params; struct netdev_rx_queue { ... struct pp_provider_params *pp_params; }; -- Pavel Begunkov

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-06 Thread Pavel Begunkov
step 4 in the meantime. Might change, can be useful, but it was much easier to hook into the pp release loop. Another concern is who and when can reset ifq / kill pp outside of io_uring/devmem. I assume it can happen on a whim, which is hard to handle gracefully. -- Pavel Begunkov

Re: [RFC PATCH net-next v5 07/14] page_pool: devmem support

2024-02-14 Thread Pavel Begunkov
On 2/13/24 21:11, Mina Almasry wrote: On Tue, Feb 13, 2024 at 5:28 AM Pavel Begunkov wrote: ... A bit of a churn with the padding and nesting net_iov but looks sturdier. No duplication, and you can just check positions of the structure instead of per-field NET_IOV_ASSERT_OFFSET, which you

Re: [RFC PATCH net-next v5 08/14] memory-provider: dmabuf devmem memory provider

2024-02-13 Thread Pavel Begunkov
_SYMBOL(dmabuf_devmem_ops); It might make sense to move all these functions together with new code from core/dev.c into a new file -- Pavel Begunkov

Re: [RFC PATCH net-next v5 07/14] page_pool: devmem support

2024-02-13 Thread Pavel Begunkov
net_iov niov; }; }; ... -- Pavel Begunkov

Re: [RFC PATCH net-next v5 05/14] netdev: netdevice devmem allocator

2024-02-13 Thread Pavel Begunkov
uld have been niov->dma_addr +} + +static inline struct netdev_dmabuf_binding * +net_iov_binding(const struct net_iov *niov) +{ + return net_iov_owner(niov)->binding; +} + /* netmem */ struct netmem { ... -- Pavel Begunkov

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-19 Thread Pavel Begunkov
On 12/14/23 20:03, Mina Almasry wrote: On Mon, Dec 11, 2023 at 12:37 PM Pavel Begunkov wrote: ... If you remove the branch, let it fall into ->release and rely on refcounting there, then the callback could also fix up release_cnt or ask pp to do it, like in the patch I linked above Sadl

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-11 Thread Pavel Begunkov
On 12/11/23 02:30, Mina Almasry wrote: On Sat, Dec 9, 2023 at 7:05 PM Pavel Begunkov wrote: On 12/8/23 23:25, Mina Almasry wrote: On Fri, Dec 8, 2023 at 2:56 PM Pavel Begunkov wrote: On 12/8/23 00:52, Mina Almasry wrote: ... + if (pool->p.queue) + binding = READ_O

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-09 Thread Pavel Begunkov
On 12/8/23 23:25, Mina Almasry wrote: On Fri, Dec 8, 2023 at 2:56 PM Pavel Begunkov wrote: On 12/8/23 00:52, Mina Almasry wrote: ... + if (pool->p.queue) + binding = READ_ONCE(pool->p.queue->binding); + + if (binding) { + pool->mp_ops =

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-08 Thread Pavel Begunkov
page_pool_iov(page)) + return (struct page_pool_iov *)((unsigned long)page & ~PP_IOV); + + DEBUG_NET_WARN_ON_ONCE(true); + return NULL; +} + /** * page_pool_dev_alloc_pages() - allocate a page. * @pool: pool from which to allocate -- Pavel Begunkov

Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-08 Thread Pavel Begunkov
estroy= mp_dmabuf_devmem_destroy, + .alloc_pages= mp_dmabuf_devmem_alloc_pages, + .release_page = mp_dmabuf_devmem_release_page, +}; +EXPORT_SYMBOL(dmabuf_devmem_ops); -- Pavel Begunkov

Re: [RFC PATCH v3 10/12] tcp: RX path for devmem TCP

2023-12-08 Thread Pavel Begunkov
selected, io_uring or otherwise, I think the concise notification encoding would remain as is. Since this is an operation on a socket, I find a setsockopt the fitting interface. -- Pavel Begunkov

Re: [RFC PATCH v3 10/12] tcp: RX path for devmem TCP

2023-12-08 Thread Pavel Begunkov
the RX ring" behaviour even with TCP sockets. -- Pavel Begunkov

Re: [RFC PATCH v3 10/12] tcp: RX path for devmem TCP

2023-12-08 Thread Pavel Begunkov
rly optimised, and we can't use it with some important features like multishot recv because of cmsg. I'm not really concerned with faster. I would prefer something cleaner :-) Or maybe we should just have it documented. With some kind of path towards beautiful world where we can create dynamic

Re: [RFC PATCH v3 05/12] netdev: netdevice devmem allocator

2023-11-14 Thread Pavel Begunkov
On 11/11/23 17:19, David Ahern wrote: On 11/10/23 7:26 AM, Pavel Begunkov wrote: On 11/7/23 23:03, Mina Almasry wrote: On Tue, Nov 7, 2023 at 2:55 PM David Ahern wrote: On 11/7/23 3:10 PM, Mina Almasry wrote: On Mon, Nov 6, 2023 at 3:44 PM David Ahern wrote: On 11/5/23 7:44 PM, Mina

Re: [RFC PATCH v3 05/12] netdev: netdevice devmem allocator

2023-11-10 Thread Pavel Begunkov
patch set can work with any memory; only device memory is unreadable. -- Pavel Begunkov

Re: [RFC PATCH v2 00/11] Device Memory TCP

2023-08-18 Thread Pavel Begunkov
to look into the details deeper. Overall I like the intent and possibilities for extensions, but a lot of details are missing - perhaps some are answered by seeing an end-to-end implementation. -- Pavel Begunkov