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

2024-06-07 Thread Mina Almasry
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 any objection against

[PATCH net-next v11 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-06 Thread Mina Almasry
, ncdevmem has a validation mode, where it sends a specific pattern and validates this pattern on the receiver side to ensure data integrity. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-15-almasrym...@google.com/ - Remove

[PATCH net-next v11 12/13] net: add devmem TCP documentation

2024-06-06 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-14-almasrym...@google.com/ - Bagas doc suggestions. v8: - Applied docs suggestions (Randy). Thanks! v7

[PATCH net-next v11 10/13] tcp: RX path for devmem TCP

2024-06-06 Thread Mina Almasry
sed to userspace is get_page()'d. This reference is dropped once the userspace indicates that it is done reading this page. All pages are released when the socket is destroyed. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v11: - Refactor to common function

[PATCH net-next v11 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-06 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

[PATCH net-next v11 09/13] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
frags of devmem skbs and avoid coalescing devmem skbs with non devmem skbs. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v11: - drop excessive checks for frag 0 pull (Paolo) v9: https://lore.kernel.org/netdev/20240403002053.2376017-11-al

[PATCH net-next v11 07/13] memory-provider: dmabuf devmem memory provider

2024-06-06 Thread Mina Almasry
DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v11: - Rebase to not use the ops. (Christoph) v8: - Use skb_frag_size instead of frag->bv_len to fix patch-by-patch build error v6: - refactor

[PATCH net-next v11 08/13] net: support non paged skb frags

2024-06-06 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section of the functions I touched

[PATCH net-next v11 05/13] page_pool: convert to use netmem

2024-06-06 Thread Mina Almasry
is factored out on its own to limit the code churn to this 1 patch, for ease of code review. Signed-off-by: Mina Almasry --- v11: - Fix typing to remove sparse warning. (Paolo/Steven) v9: - Fix sparse error (Simon). v8: - Fix napi_pp_put_page() taking netmem instead of page to fix patch

[PATCH net-next v11 06/13] page_pool: devmem support

2024-06-06 Thread Mina Almasry
the underlying type is page or net_iov. Implement checks for net_iov in netmem helpers which delegate to mm APIs, to ensure net_iov are never passed to the mm stack. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-8-almasrym...@google.com/ - Remove CONFIG

[PATCH net-next v11 04/13] netdev: netdevice devmem allocator

2024-06-06 Thread Mina Almasry
-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->pp_magic/pp/pp_ref_counter usage to later

[PATCH net-next v11 03/13] netdev: support binding dma-buf to netdevice

2024-06-06 Thread Mina Almasry
d re-initializes its page pool. 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 --- v11: - Fix build error with CONFIG_DMA_SHARED_BU

[PATCH net-next v11 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-06-06 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

[PATCH net-next v11 01/13] netdev: add netdev_rx_queue_restart()

2024-06-06 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry --- v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_free call that passed the wrong pointer (David). v9: https://lore.kernel.org/

[PATCH net-next v11 00/13] Device Memory TCP

2024-06-06 Thread Mina Almasry
Kernel: net-next with this series and memory provider API cherry-picked locally. Hardware: Google Cloud A3 VMs. NIC: GVE with header split & RSS & flow steering support. Cc: Pavel Begunkov Cc: David Wei Cc: Jason Gunthorpe Cc: Yunsheng Lin Cc: Shailend Chand Cc: Harshitha Ramamurthy Cc:

Re: [PATCH net-next v10 10/14] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
On Thu, Jun 6, 2024 at 9:49 AM Mina Almasry wrote: > > On Tue, Jun 4, 2024 at 3:46 AM Paolo Abeni wrote: > > > > On Thu, 2024-05-30 at 20:16 +, Mina Almasry wrote: > > > diff --git a/net/core/gro.c b/net/core/gro.c > > > index 26f09c3e830b7..7b9d018f552

Re: [PATCH net-next v10 10/14] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
On Tue, Jun 4, 2024 at 3:46 AM Paolo Abeni wrote: > > On Thu, 2024-05-30 at 20:16 +, Mina Almasry wrote: > > diff --git a/net/core/gro.c b/net/core/gro.c > > index 26f09c3e830b7..7b9d018f552bd 100644 > > --- a/net/core/gro.c > > +++ b/net/core/gro.c >

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

2024-06-03 Thread Mina Almasry
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'

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

2024-06-03 Thread Mina Almasry
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 resolved yet. Sending the series > > anyway to get reviews/feedback on the (unrelated) rest of the series.

[PATCH net-next v10 14/14] selftests: add ncdevmem, netcat for devmem TCP

2024-05-30 Thread Mina Almasry
, ncdevmem has a validation mode, where it sends a specific pattern and validates this pattern on the receiver side to ensure data integrity. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-15-almasrym...@google.com/ - Remove

[PATCH net-next v10 13/14] net: add devmem TCP documentation

2024-05-30 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-14-almasrym...@google.com/ - Bagas doc suggestions. v8: - Applied docs suggestions (Randy). Thanks! v7: - Applied docs suggestions

[PATCH net-next v10 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-05-30 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

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

2024-05-30 Thread Mina Almasry
sed to userspace is get_page()'d. This reference is dropped once the userspace indicates that it is done reading this page. All pages are released when the socket is destroyed. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v7: - Updated the SO_DEVMEM_* u

[PATCH net-next v10 10/14] net: add support for skbs with unreadable frags

2024-05-30 Thread Mina Almasry
frags of devmem skbs and avoid coalescing devmem skbs with non devmem skbs. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-11-almasrym...@google.com/ - change skb->readable to skb->unrea

[PATCH net-next v10 09/14] net: support non paged skb frags

2024-05-30 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section of the functions I touched

[PATCH net-next v10 08/14] memory-provider: dmabuf devmem memory provider

2024-05-30 Thread Mina Almasry
DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Use skb_frag_size instead of frag->bv_len to fix patch-by-patch build error v6: - refactor new memory provider functions into net/core/devme

[PATCH net-next v10 07/14] page_pool: devmem support

2024-05-30 Thread Mina Almasry
the underlying type is page or net_iov. Implement checks for net_iov in netmem helpers which delegate to mm APIs, to ensure net_iov are never passed to the mm stack. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-8-almasrym...@google.com/ - Remove CONFIG

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

2024-05-30 Thread Mina Almasry
is factored out on its own to limit the code churn to this 1 patch, for ease of code review. Signed-off-by: Mina Almasry --- v9: - Fix sparse error (Simon). v8: - Fix napi_pp_put_page() taking netmem instead of page to fix patch-by-patch build error. - Add net/netmem.h include in this patch

[PATCH net-next v10 04/14] netdev: support binding dma-buf to netdevice

2024-05-30 Thread Mina Almasry
d re-initializes its page pool. 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 --- v10: - Moved net_iov_dma_addr() to devmem.h and

[PATCH net-next v10 05/14] netdev: netdevice devmem allocator

2024-05-30 Thread Mina Almasry
-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->pp_magic/pp/pp_ref_counter usage to later patch to avoid patch-by-patch build erro

[PATCH net-next v10 03/14] net: netdev netlink api to bind dma-buf to a net device

2024-05-30 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

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

2024-05-30 Thread Mina Almasry
references to be gone before feeding this page back into the pool. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- - This is implemented by Jakub in his RFC: https://lore.kernel.org/netdev/f8270765-a27b-6ccf-33ea-cda097168...@redhat.com/T/ I take no credit for the idea or impleme

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

2024-05-30 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/all/20240502045410.3524155-4...@davidwei.uk/ (submitted by David). - fixed SPDX license identifier (Simon). - Rebased on top of merged queue API

[PATCH net-next v10 00/14] Device Memory TCP

2024-05-30 Thread Mina Almasry
t Cc: Jeroen de Borst Cc: Praveen Kaligineedi Jakub Kicinski (1): net: page_pool: create hooks for custom page providers Mina Almasry (13): netdev: add netdev_rx_queue_restart() net: netdev netlink api to bind dma-buf to a net device netdev: support binding dma-buf to netdevice

Re: [PATCH net-next v9 04/14] netdev: support binding dma-buf to netdevice

2024-05-29 Thread Mina Almasry
On Sat, May 18, 2024 at 11:46 AM David Wei wrote: > > On 2024-05-10 16:21, Mina Almasry wrote: > > +void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding) > > +{ > > + struct netdev_rx_queue *rxq; > > + unsigned long xa_idx;

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

2024-05-29 Thread Mina Almasry
On Tue, May 28, 2024 at 7:42 PM Pavel Begunkov wrote: > > On 5/28/24 18:36, Mina Almasry wrote: > > On Wed, May 22, 2024 at 11:02 PM David Wei wrote: > ... > >>> + */ > >>> +

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

2024-05-28 Thread Mina Almasry
On Wed, May 22, 2024 at 11:02 PM David Wei wrote: > > On 2024-05-10 16:21, Mina Almasry wrote: > > +/* On error, returns the -errno. On success, returns number of bytes sent > > to the > > + * user. May not consume all of @remaining_len. > > + */ > > +stati

Re: [PATCH net-next v9 00/14] Device Memory TCP

2024-05-14 Thread Mina Almasry
On Mon, May 13, 2024 at 4:31 PM Jakub Kicinski wrote: > > On Fri, 10 May 2024 16:21:11 -0700 Mina Almasry wrote: > > Device Memory TCP > > Sorry Mina, this is too big to apply during the merge window :( No worries at all. I'll repost once it re-opens with any feedback I g

[PATCH net-next v9 14/14] selftests: add ncdevmem, netcat for devmem TCP

2024-05-10 Thread Mina Almasry
, ncdevmem has a validation mode, where it sends a specific pattern and validates this pattern on the receiver side to ensure data integrity. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-15-almasrym...@google.com/ - Remove

[PATCH net-next v9 13/14] net: add devmem TCP documentation

2024-05-10 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-14-almasrym...@google.com/ - Bagas doc suggestions. v8: - Applied docs suggestions (Randy). Thanks! v7: - Applied docs suggestions

[PATCH net-next v9 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-05-10 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

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

2024-05-10 Thread Mina Almasry
sed to userspace is get_page()'d. This reference is dropped once the userspace indicates that it is done reading this page. All pages are released when the socket is destroyed. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v7: - Updated the SO_DEVMEM_* u

[PATCH net-next v9 10/14] net: add support for skbs with unreadable frags

2024-05-10 Thread Mina Almasry
frags of devmem skbs and avoid coalescing devmem skbs with non devmem skbs. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-11-almasrym...@google.com/ - change skb->readable to skb->unrea

[PATCH net-next v9 09/14] net: support non paged skb frags

2024-05-10 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v6: - Rebased on top of the merged netmem changes. Changes in v1: - Fix illegal_highdma() (Yunsheng). - Rework napi_pp_put_page

[PATCH net-next v9 08/14] memory-provider: dmabuf devmem memory provider

2024-05-10 Thread Mina Almasry
DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Use skb_frag_size instead of frag->bv_len to fix patch-by-patch build error v6: - refactor new memory provider functions into net/core/devme

[PATCH net-next v9 07/14] page_pool: devmem support

2024-05-10 Thread Mina Almasry
the underlying type is page or net_iov. Implement checks for net_iov in netmem helpers which delegate to mm APIs, to ensure net_iov are never passed to the mm stack. Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-8-almasrym...@google.com/ - Remove CONFIG

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

2024-05-10 Thread Mina Almasry
is factored out on its own to limit the code churn to this 1 patch, for ease of code review. Signed-off-by: Mina Almasry --- v9: - Fix sparse error (Simon). v8: - Fix napi_pp_put_page() taking netmem instead of page to fix patch-by-patch build error. - Add net/netmem.h include in this patch

[PATCH net-next v9 05/14] netdev: netdevice devmem allocator

2024-05-10 Thread Mina Almasry
-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->pp_magic/pp/pp_ref_counter usage to later patch to avoid patch-by-patch build erro

[PATCH net-next v9 04/14] netdev: support binding dma-buf to netdevice

2024-05-10 Thread Mina Almasry
d re-initializes its page pool. 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 --- v9: https://lore.kernel.org/all/20240403002053.23760

[PATCH net-next v9 03/14] net: netdev netlink api to bind dma-buf to a net device

2024-05-10 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

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

2024-05-10 Thread Mina Almasry
references to be gone before feeding this page back into the pool. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- - This is implemented by Jakub in his RFC: https://lore.kernel.org/netdev/f8270765-a27b-6ccf-33ea-cda097168...@redhat.com/T/ I take no credit for the idea or impleme

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

2024-05-10 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry --- v9: https://lore.kernel.org/all/20240502045410.3524155-4...@davidwei.uk/ (submitted by David). - fixed SPDX license identifier (Simon). - Rebased on top of merged queue API

[PATCH net-next v9 00/14] Device Memory TCP

2024-05-10 Thread Mina Almasry
Cc: Jason Gunthorpe Cc: Yunsheng Lin Cc: Shailend Chand Cc: Harshitha Ramamurthy Cc: Shakeel Butt Cc: Jeroen de Borst Cc: Praveen Kaligineedi Jakub Kicinski (1): net: page_pool: create hooks for custom page providers Mina Almasry (13): netdev: add netdev_rx_queue_restart() net: ne

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

2024-05-07 Thread Mina Almasry
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 enough rope, and they

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

2024-05-07 Thread Mina Almasry
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 > > > > that rope when the

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

2024-05-03 Thread Mina Almasry
Sorry for the late reply. On Wed, May 1, 2024 at 12:55 AM Christoph Hellwig wrote: > > Still NAK to creating aⅺbitrary hooks here. Is the concern still that folks may be able to hook proprietary stuff into this like you mentioned before[1]? I don't see how that can be done as currently

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

2024-04-30 Thread Mina Almasry
On Tue, Apr 30, 2024 at 11:55 AM Jens Axboe wrote: > > On 4/30/24 12:29 PM, Mina Almasry wrote: > > On Tue, Apr 30, 2024 at 6:46?AM Jens Axboe wrote: > >> > >> On 4/26/24 8:11 PM, Mina Almasry wrote: > >>> On Fri, Apr 26, 2024 at 5:18?PM David Wei

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

2024-04-30 Thread Mina Almasry
On Tue, Apr 30, 2024 at 6:46 AM Jens Axboe wrote: > > On 4/26/24 8:11 PM, Mina Almasry wrote: > > On Fri, Apr 26, 2024 at 5:18?PM David Wei wrote: > >> > >> On 2024-04-02 5:20 pm, Mina Almasry wrote: > >>> @@ -69,20 +106,26 @@ net_iov_binding(const struc

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

2024-04-26 Thread Mina Almasry
On Fri, Apr 26, 2024 at 5:18 PM David Wei wrote: > > On 2024-04-02 5:20 pm, Mina Almasry wrote: > > @@ -69,20 +106,26 @@ net_iov_binding(const struct net_iov *niov) > > */ > > typedef unsigned long __bitwise netmem_ref; > > > > +static inline bool netme

Re: [RFC PATCH net-next v8 04/14] netdev: support binding dma-buf to netdevice

2024-04-24 Thread Mina Almasry
On Wed, Apr 24, 2024 at 10:36 AM David Wei wrote: > > On 2024-04-02 5:20 pm, Mina Almasry wrote: > > + /* We hold the rtnl_lock while binding/unbinding dma-buf, so we can't > > + * race with another thread that is also modifying this value. > > However, > >

[RFC PATCH net-next v8 14/14] selftests: add ncdevmem, netcat for devmem TCP

2024-04-02 Thread Mina Almasry
, ncdevmem has a validation mode, where it sends a specific pattern and validates this pattern on the receiver side to ensure data integrity. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v6: - Updated to bind 8 queues. - Added RSS configuration. - Added some more tests

[RFC PATCH net-next v8 13/14] net: add devmem TCP documentation

2024-04-02 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry --- v8: - Applied docs suggestions (Randy). Thanks! v7: - Applied docs suggestions (Jakub). v2: - Missing spdx (simon) - add to index.rst (simon) fix docs --- Documentation/networking/devmem.rst

[RFC PATCH net-next v8 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-04-02 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

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

2024-04-02 Thread Mina Almasry
sed to userspace is get_page()'d. This reference is dropped once the userspace indicates that it is done reading this page. All pages are released when the socket is destroyed. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v7: - Updated the SO_DEVMEM_* u

[RFC PATCH net-next v8 10/14] net: add support for skbs with unreadable frags

2024-04-02 Thread Mina Almasry
frags of devmem skbs and avoid coalescing devmem skbs with non devmem skbs. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v6 - skb->dmabuf -> skb->readable (Pavel). Pavel's original suggestion was to remove the skb->dmabuf flag en

[RFC PATCH net-next v8 09/14] net: support non paged skb frags

2024-04-02 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v6: - Rebased on top of the merged netmem changes. Changes in v1: - Fix illegal_highdma() (Yunsheng). - Rework napi_pp_put_page

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

2024-04-02 Thread Mina Almasry
DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Use skb_frag_size instead of frag->bv_len to fix patch-by-patch build error v6: - refactor new memory provider functions into net/core/devme

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

2024-04-02 Thread Mina Almasry
the underlying type is page or net_iov. Implement checks for net_iov in netmem helpers which delegate to mm APIs, to ensure net_iov are never passed to the mm stack. Signed-off-by: Mina Almasry --- v7: - Remove static_branch_unlikely from netmem_to_net_iov(). We're getting better results from the fast

[RFC PATCH net-next v8 06/14] page_pool: convert to use netmem

2024-04-02 Thread Mina Almasry
is factored out on its own to limit the code churn to this 1 patch, for ease of code review. Signed-off-by: Mina Almasry --- v8: - Fix napi_pp_put_page() taking netmem instead of page to fix patch-by-patch build error. - Add net/netmem.h include in this patch to fix patch-by-patch build error

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

2024-04-02 Thread Mina Almasry
-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->pp_magic/pp/pp_ref_counter usage to later patch to avoid patch-by-patch build erro

[RFC PATCH net-next v8 04/14] netdev: support binding dma-buf to netdevice

2024-04-02 Thread Mina Almasry
d re-initializes its page pool. 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 --- v8: - move dmabuf_devmem_ops usage to later patch to a

[RFC PATCH net-next v8 03/14] net: netdev netlink api to bind dma-buf to a net device

2024-04-02 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

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

2024-04-02 Thread Mina Almasry
references to be gone before feeding this page back into the pool. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- This is implemented by Jakub in his RFC: https://lore.kernel.org/netdev/f8270765-a27b-6ccf-33ea-cda097168...@redhat.com/T/ I take no credit for the idea or impleme

[RFC PATCH net-next v8 01/14] queue_api: define queue api

2024-04-02 Thread Mina Almasry
This API enables the net stack to reset the queues used for devmem TCP. Signed-off-by: Mina Almasry --- include/linux/netdevice.h | 3 +++ include/net/netdev_queues.h | 27 +++ 2 files changed, 30 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux

[RFC PATCH net-next v8 00/14] Device Memory TCP

2024-04-02 Thread Mina Almasry
amp; flow steering support. Cc: Pavel Begunkov Cc: David Wei Cc: Jason Gunthorpe Cc: Yunsheng Lin Cc: Shailend Chand Cc: Harshitha Ramamurthy Cc: Shakeel Butt Cc: Jeroen de Borst Cc: Praveen Kaligineedi Jakub Kicinski (1): net: page_pool: create hooks for custom page providers Mina Al

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

2024-04-01 Thread Mina Almasry
On Thu, Mar 28, 2024 at 12:31 AM Christoph Hellwig wrote: > > On Tue, Mar 26, 2024 at 01:19:20PM -0700, Mina Almasry wrote: > > > > Are you envisioning that dmabuf support would be added to the block > > layer > > Yes. > > > (which I understand is

Re: [RFC PATCH net-next v7 04/14] netdev: support binding dma-buf to netdevice

2024-03-28 Thread Mina Almasry
On Thu, Mar 28, 2024 at 11:28 AM Simon Horman wrote: > > On Tue, Mar 26, 2024 at 03:50:35PM -0700, Mina Almasry wrote: > > Add a netdev_dmabuf_binding struct which represents the > > dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to > > rx

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

2024-03-27 Thread Mina Almasry
On Tue, Mar 26, 2024 at 3:51 PM Mina Almasry wrote: > > Convert netmem to be a union of struct page and struct netmem. Overload > the LSB of struct netmem* to indicate that it's a net_iov, otherwise > it's a page. > > Currently these entries in struct page are rented by the pa

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

2024-03-27 Thread Mina Almasry
On Tue, Mar 26, 2024 at 3:51 PM Mina Almasry wrote: > > Abstrace the memory type from the page_pool so we can later add support > for new memory types. Convert the page_pool to use the new netmem type > abstraction, rather than use struct page directly. > > As of this pat

[RFC PATCH net-next v7 14/14] selftests: add ncdevmem, netcat for devmem TCP

2024-03-26 Thread Mina Almasry
, ncdevmem has a validation mode, where it sends a specific pattern and validates this pattern on the receiver side to ensure data integrity. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v6: - Updated to bind 8 queues. - Added RSS configuration. - Added some more tests

[RFC PATCH net-next v7 13/14] net: add devmem TCP documentation

2024-03-26 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry --- v7: - Applied docs suggestions (Jakub). v2: - Missing spdx (simon) - add to index.rst (simon) --- Documentation/networking/devmem.rst | 256 Documentation

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

2024-03-26 Thread Mina Almasry
sed to userspace is get_page()'d. This reference is dropped once the userspace indicates that it is done reading this page. All pages are released when the socket is destroyed. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v7: - Updated the SO_DEVMEM_* u

[RFC PATCH net-next v7 12/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-03-26 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry

[RFC PATCH net-next v7 10/14] net: add support for skbs with unreadable frags

2024-03-26 Thread Mina Almasry
frags of devmem skbs and avoid coalescing devmem skbs with non devmem skbs. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v6 - skb->dmabuf -> skb->readable (Pavel). Pavel's original suggestion was to remove the skb->dmabuf flag en

[RFC PATCH net-next v7 09/14] net: support non paged skb frags

2024-03-26 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v6: - Rebased on top of the merged netmem changes. Changes in v1: - Fix illegal_highdma() (Yunsheng). - Rework napi_pp_put_page

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

2024-03-26 Thread Mina Almasry
the underlying type is page or net_iov. Implement checks for net_iov in netmem helpers which delegate to mm APIs, to ensure net_iov are never passed to the mm stack. Signed-off-by: Mina Almasry --- v7: - Remove static_branch_unlikely from netmem_to_net_iov(). We're getting better results from the fast

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

2024-03-26 Thread Mina Almasry
DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v6: - refactor new memory provider functions into net/core/devmem.c (Pavel) v2: - Disable devmem for p.order != 0 v1: - static_branc

[RFC PATCH net-next v7 06/14] page_pool: convert to use netmem

2024-03-26 Thread Mina Almasry
is factored out on its own to limit the code churn to this 1 patch, for ease of code review. Signed-off-by: Mina Almasry --- v6: - Rebased on top of the merged netmem_ref type. To: linux...@kvack.org Cc: Matthew Wilcox --- include/linux/skbuff.h | 4 +- include/net/netmem.h

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

2024-03-26 Thread Mina Almasry
-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- v7: - netdev_ -> net_devmem_* naming (Yunsheng). v6: - Add comment on net_iov_dma_addr to explain why we don't use niov->dma_addr (Pavel) - Refactor new functions into net/core/devmem.c (Pavel) v1: - Rename

[RFC PATCH net-next v7 04/14] netdev: support binding dma-buf to netdevice

2024-03-26 Thread Mina Almasry
d re-initializes its page pool. 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 --- v7: - Use IS_ERR() instead of IS_ERR_OR_

[RFC PATCH net-next v7 03/14] net: netdev netlink api to bind dma-buf to a net device

2024-03-26 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

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

2024-03-26 Thread Mina Almasry
references to be gone before feeding this page back into the pool. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- This is implemented by Jakub in his RFC: https://lore.kernel.org/netdev/f8270765-a27b-6ccf-33ea-cda097168...@redhat.com/T/ I take no credit for the idea or impleme

[RFC PATCH net-next v7 01/14] queue_api: define queue api

2024-03-26 Thread Mina Almasry
This API enables the net stack to reset the queues used for devmem TCP. Signed-off-by: Mina Almasry --- include/linux/netdevice.h | 3 +++ include/net/netdev_queues.h | 27 +++ 2 files changed, 30 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux

[RFC PATCH net-next v7 00/14] Device Memory TCP

2024-03-26 Thread Mina Almasry
rthy Cc: Shakeel Butt Cc: Jeroen de Borst Cc: Praveen Kaligineedi Jakub Kicinski (1): net: page_pool: create hooks for custom page providers Mina Almasry (13): queue_api: define queue api net: netdev netlink api to bind dma-buf to a net device netdev: support binding dma-buf to

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

2024-03-26 Thread Mina Almasry
On Sun, Mar 24, 2024 at 4:37 PM Christoph Hellwig wrote: > > On Fri, Mar 22, 2024 at 10:54:54AM -0700, Mina Almasry wrote: > > Sorry I don't mean to argue but as David mentioned, there are some > > plans in the works and ones not in the works to extend this to other >

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

2024-03-26 Thread Mina Almasry
On Tue, Mar 26, 2024 at 5:47 AM Yunsheng Lin wrote: > > 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: > >>> &

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

2024-03-25 Thread Mina Almasry
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: > > > > ... > > > > > > > > Perf - page-pool benchmark: > > >

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

2024-03-22 Thread Mina Almasry
On Sun, Mar 17, 2024 at 7:03 PM Christoph Hellwig wrote: > > On Mon, Mar 04, 2024 at 06:01:37PM -0800, Mina Almasry wrote: > > From: Jakub Kicinski > > > > The page providers which try to reuse the same pages will > > need to hold onto the ref, even if page g

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

2024-03-22 Thread Mina Almasry
Hi Christoph, Sorry for the late reply, I've been out for a few days. On Mon, Mar 18, 2024 at 4:22 PM Christoph Hellwig wrote: > > On Sun, Mar 17, 2024 at 07:49:43PM -0700, David Wei wrote: > > I'm working on a similar proposal for zero copy Rx but to host memory > > and depend on this memory

Re: [RFC PATCH net-next v6 01/15] queue_api: define queue api

2024-03-08 Thread Mina Almasry
On Fri, Mar 8, 2024 at 3:48 PM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > This API enables the net stack to reset the queues used for devmem. > > > > Signed-off-by: Mina Almasry > > > > --- > > include/linux/netdevice.h | 24 ++

  1   2   3   >