Re: [RFC PATCH net-next v6 00/15] Device Memory TCP

2024-03-26 Thread Yunsheng Lin
On 2024/3/26 8:28, Mina Almasry wrote: > On Tue, Mar 5, 2024 at 11:38 AM Mina Almasry wrote: >> >> On Tue, Mar 5, 2024 at 4:54 AM Yunsheng Lin wrote: >>> >>> On 2024/3/5 10:01, Mina Almasry wrote: >>> >&g

Re: [RFC PATCH net-next v6 05/15] netdev: support binding dma-buf to netdevice

2024-03-07 Thread Yunsheng Lin
On 2024/3/7 6:10, Mina Almasry wrote: ... > +static int netdev_restart_rx_queue(struct net_device *dev, int rxq_idx) > +{ > + void *new_mem; > + void *old_mem; > + int err; > + > + if (!dev || !dev->netdev_ops) > + return -EINVAL; >

Re: [RFC PATCH net-next v6 05/15] netdev: support binding dma-buf to netdevice

2024-03-06 Thread Yunsheng Lin
On 2024/3/6 5:17, Mina Almasry wrote: > On Tue, Mar 5, 2024 at 4:55 AM Yunsheng Lin wrote: >> >> On 2024/3/5 10:01, Mina Almasry wrote: >> >> ... >> >>> >>> The netdev_dmabuf_binding struct is refcounted, and releases its >>> resou

Re: [RFC PATCH net-next v6 00/15] Device Memory TCP

2024-03-06 Thread Yunsheng Lin
On 2024/3/6 3:38, Mina Almasry wrote: > On Tue, Mar 5, 2024 at 4:54 AM Yunsheng Lin wrote: >> >> On 2024/3/5 10:01, Mina Almasry wrote: >> >> ... >> >>> >>> Perf - page-pool benchmark: >>> --- >>&g

Re: [RFC PATCH net-next v6 05/15] netdev: support binding dma-buf to netdevice

2024-03-05 Thread Yunsheng Lin
On 2024/3/5 10:01, Mina Almasry wrote: ... > > The netdev_dmabuf_binding struct is refcounted, and releases its > resources only when all the refs are released. > > Signed-off-by: Willem de Bruijn > Signed-off-by: Kaiyuan Zhang > Signed-off-by: Mina Almasry > > --- > > RFC v6: > -

Re: [RFC PATCH net-next v6 03/15] net: page_pool: factor out page_pool recycle check

2024-03-05 Thread Yunsheng Lin
On 2024/3/5 10:01, Mina Almasry wrote: > The check is duplicated in 2 places, factor it out into a common helper. Reviewed-by: Yunsheng Lin

Re: [RFC PATCH net-next v6 00/15] Device Memory TCP

2024-03-05 Thread Yunsheng Lin
On 2024/3/5 10:01, Mina Almasry wrote: ... > > Perf - page-pool benchmark: > --- > > bench_page_pool_simple.ko tests with and without these changes: > https://pastebin.com/raw/ncHDwAbn > > AFAIK the number that really matters in the perf tests is the >

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-13 Thread Yunsheng Lin
On 2023/12/12 22:28, Mina Almasry wrote: ... >> >> the page_ref_*() API may be avoided using the below patch: >> https://patchwork.kernel.org/project/netdevbpf/patch/20231113130041.58124-7-linyunsh...@huawei.com/ >> > > Even after the patch above, you're still calling page_ref_count() in > the

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-12 Thread Yunsheng Lin
On 2023/12/12 2:14, Mina Almasry wrote: > On Mon, Dec 11, 2023 at 3:51 AM Yunsheng Lin wrote: >> >> On 2023/12/11 12:04, Mina Almasry wrote: >>> On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote: >>>> >>>> On Sun, Dec 10, 2023 at 6:04 PM Yunsheng

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-11 Thread Yunsheng Lin
On 2023/12/11 12:04, Mina Almasry wrote: > On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote: >> >> On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin wrote: >>> >>> On 2023/12/9 0:05, Mina Almasry wrote: >>>> On Fri, Dec 8, 2023 at 1:30 AM Yunsheng Lin

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-10 Thread Yunsheng Lin
On 2023/12/9 0:05, Mina Almasry wrote: > On Fri, Dec 8, 2023 at 1:30 AM Yunsheng Lin wrote: >> >> >> As mentioned before, it seems we need to have the above checking every >> time we need to do some per-page handling in page_pool core, is there >> a plan in y

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-08 Thread Yunsheng Lin
On 2023/12/8 8:52, Mina Almasry wrote: > Overload the LSB of struct page* to indicate that it's a page_pool_iov. > > Refactor mm calls on struct page* into helpers, and add page_pool_iov > handling on those helpers. Modify callers of these mm APIs with calls to > these helpers instead. > > In

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-10 Thread Yunsheng Lin
ation. >> > > That is just a mistake, sorry. Will remove this increment. You seems to be combining comments in different thread and replying in one thread, I am not sure that is a good practice and I almost missed the reply below as I don't seem to be cc'ed. > > On Th

Re: [RFC PATCH v3 07/12] page-pool: device memory support

2023-11-09 Thread Yunsheng Lin
On 2023/11/9 20:20, Mina Almasry wrote: > On Thu, Nov 9, 2023 at 1:30 AM Yunsheng Lin wrote: >> >> On 2023/11/9 11:20, Mina Almasry wrote: >>> On Wed, Nov 8, 2023 at 2:56 AM Yunsheng Lin wrote: >> >>> >>> Agreed everything above is undoable. >&g

Re: [RFC PATCH v3 07/12] page-pool: device memory support

2023-11-09 Thread Yunsheng Lin
On 2023/11/9 11:20, Mina Almasry wrote: > On Wed, Nov 8, 2023 at 2:56 AM Yunsheng Lin wrote: > > Agreed everything above is undoable. > >> But we might be able to do something as folio is doing now, mm subsystem >> is still seeing 'struct folio/page', but other subs

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-09 Thread Yunsheng Lin
On 2023/11/9 10:22, Mina Almasry wrote: > On Tue, Nov 7, 2023 at 7:40 PM Yunsheng Lin wrote: >> >> On 2023/11/8 5:59, Mina Almasry wrote: >>> On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: >>>> >>>> On 2023/11/6 10:44, Mina Almasry wrote:

Re: [RFC PATCH v3 08/12] net: support non paged skb frags

2023-11-08 Thread Yunsheng Lin
On 2023/11/8 5:19, Mina Almasry wrote: >> >> > > My personal immediate reaction is that this may just introduce code > churn without significant benefit. If an unsuspecting caller call > skb_frag_page() on devmem frag and doesn't correctly handle NULL > return, it will crash or error out anyway,

Re: [RFC PATCH v3 07/12] page-pool: device memory support

2023-11-08 Thread Yunsheng Lin
On 2023/11/8 5:56, Mina Almasry wrote: > On Tue, Nov 7, 2023 at 12:00 AM Yunsheng Lin wrote: >> >> On 2023/11/6 10:44, Mina Almasry wrote: >>> Overload the LSB of struct page* to indicate that it's a page_pool_iov. >>> >>> Refactor mm calls on struct

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

2023-11-07 Thread Yunsheng Lin
mabuf is device memory. >> > > In my limited experience dma-buf is generally device memory, and > that's really its use case. CONFIG_UDMABUF is a driver that mocks > dma-buf with a memfd which I think is used for testing. But I can do > the rename, it's more clear anyway, I

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-07 Thread Yunsheng Lin
On 2023/11/8 5:59, Mina Almasry wrote: > On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote: >> >> On 2023/11/6 10:44, Mina Almasry wrote: >>> + >>> +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) &g

Re: [RFC PATCH v3 08/12] net: support non paged skb frags

2023-11-07 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > Make skb_frag_page() fail in the case where the frag is not backed > by a page, and fix its relevent callers to handle this case. > > Correctly handle skb_frag refcounting in the page_pool_iovs case. > > Signed-off-by: Mina Almasry > ... > /** > *

Re: [RFC PATCH v3 07/12] page-pool: device memory support

2023-11-07 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > Overload the LSB of struct page* to indicate that it's a page_pool_iov. > > Refactor mm calls on struct page* into helpers, and add page_pool_iov > handling on those helpers. Modify callers of these mm APIs with calls to > these helpers instead. > > In

Re: [RFC PATCH v3 04/12] netdev: support binding dma-buf to netdevice

2023-11-06 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > + > +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding) > +{ > + size_t size, avail; > + > + gen_pool_for_each_chunk(binding->chunk_pool, > + netdev_devmem_free_chunk_owner, NULL); > + > + size

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

2023-11-06 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > + > +void netdev_free_devmem(struct page_pool_iov *ppiov) > +{ > + struct netdev_dmabuf_binding *binding = page_pool_iov_binding(ppiov); > + > + refcount_set(>refcount, 1); > + > + if (gen_pool_has_addr(binding->chunk_pool, > +

Re: [RFC PATCH v3 02/12] net: page_pool: create hooks for custom page providers

2023-11-06 Thread Yunsheng Lin
On 2023/11/6 10:44, Mina Almasry wrote: > > diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h > index 6fc5134095ed..d4bea053bb7e 100644 > --- a/include/net/page_pool/types.h > +++ b/include/net/page_pool/types.h > @@ -60,6 +60,8 @@ struct page_pool_params { > int