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

2024-06-12 Thread Mina Almasry
er_frags, and each page passed 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 ---

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

2024-06-12 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 v12 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-12 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

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

2024-06-13 Thread Mina Almasry
On Thu, Jun 13, 2024 at 1:36 AM Paul Barker wrote: > > On 13/06/2024 02:35, Mina Almasry wrote: > > Abstrace the memory type from the page_pool so we can later add support > > s/Abstrace/Abstract/ > Thanks, will do. > > for new memory types. Convert the page_pool

Re: [PATCH net-next v12 00/13] Device Memory TCP

2024-06-13 Thread Mina Almasry
On Thu, Jun 13, 2024 at 6:35 PM Jakub Kicinski wrote: > > On Thu, 13 Jun 2024 01:35:37 +0000 Mina Almasry wrote: > > v12: > > https://patchwork.kernel.org/project/netdevbpf/list/?series=859747&state=* > > patches 5 and 6 transiently break the build > > ../incl

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

2024-06-21 Thread Mina Almasry
On Mon, Jun 17, 2024 at 7:17 AM Pavel Begunkov wrote: > > On 6/13/24 02:35, 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.

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

2024-06-21 Thread Mina Almasry
On Mon, Jun 17, 2024 at 9:36 AM Pavel Begunkov wrote: > > On 6/13/24 02:35, Mina Almasry wrote: > > > > The pages awaiting freeing are stored in the newly added > > sk->sk_user_frags, and each page passed to userspace is get_page()'d. > > This reference i

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

2024-06-24 Thread Mina Almasry
ovider. ** Test Setup 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:

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

2024-06-24 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_f

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

2024-06-24 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 v13 03/13] netdev: support binding dma-buf to netdevice

2024-06-24 Thread Mina Almasry
s, and 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 Reviewed-by: Pavel Begunkov # excluding netlink

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

2024-06-24 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->

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

2024-06-24 Thread Mina Almasry
hange 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 Reviewed-by: Pavel Begunkov --- v13: - Fix allmodconfig build error. NET_IOV was not defined as of this patch. - Removed unnecessary update of page_pool_alloc() API. I

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

2024-06-24 Thread Mina Almasry
hether 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 Reviewed-by: Pavel Begunkov --- v13: - Move NET_IOV dependent changes to this patch. - Fixed comm

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

2024-06-24 Thread Mina Almasry
is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Return on warning (Pavel). - Fixed pool->recycle_stats not being freed on error (Pavel). - Applied reviewed-by

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

2024-06-24 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 to

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

2024-06-24 Thread Mina Almasry
ags 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 v13 10/13] tcp: RX path for devmem TCP

2024-06-24 Thread Mina Almasry
er_frags, and each page passed 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 ---

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

2024-06-24 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 v13 12/13] net: add devmem TCP documentation

2024-06-24 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 v13 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-24 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

Re: [PATCH net-next v13 00/13] Device Memory TCP

2024-06-25 Thread Mina Almasry
On Mon, Jun 24, 2024 at 7:47 PM Mina Almasry wrote: > > v13: > https://patchwork.kernel.org/project/netdevbpf/list/?series=861406&archive=both&state=* > > > Major changes: > -- > > This iteration addresses Pavel's review comments, appli

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

2024-06-25 Thread Mina Almasry
entire data path end to end without a dependency on a specific dmabuf provider. ** Test Setup 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:

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

2024-06-25 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_f

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

2024-06-25 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 v14 03/13] netdev: support binding dma-buf to netdevice

2024-06-25 Thread Mina Almasry
s, and 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 Reviewed-by: Pavel Begunkov # excluding netlink

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

2024-06-25 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->

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

2024-06-25 Thread Mina Almasry
hange 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 Reviewed-by: Pavel Begunkov --- v13: - Fix allmodconfig build error. NET_IOV was not defined as of this patch. - Removed unnecessary update of page_pool_alloc() API. I

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

2024-06-25 Thread Mina Almasry
hether 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 Reviewed-by: Pavel Begunkov --- v13: - Move NET_IOV dependent changes to this patch. - Fixed comm

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

2024-06-25 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 to

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

2024-06-25 Thread Mina Almasry
is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Return on warning (Pavel). - Fixed pool->recycle_stats not being freed on error (Pavel). - Applied reviewed-by

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

2024-06-25 Thread Mina Almasry
er_frags, and each page passed 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 ---

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

2024-06-25 Thread Mina Almasry
ags 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 v14 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-25 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 v14 12/13] net: add devmem TCP documentation

2024-06-25 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 v14 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-25 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

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

2024-06-27 Thread Mina Almasry
On Wed, Jun 26, 2024 at 5:46 PM Jakub Kicinski wrote: > > On Wed, 26 Jun 2024 15:08:22 -0700 Jakub Kicinski wrote: > > On Tue, 25 Jun 2024 19:54:01 + Mina Almasry wrote: > > > +CFLAGS += -I../../../net/ynl/generated/ > > > +CFLAGS += -I../../../net/

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

2024-06-27 Thread Mina Almasry
On Thu, Jun 27, 2024 at 12:55 PM Mina Almasry wrote: > > On Wed, Jun 26, 2024 at 5:46 PM Jakub Kicinski wrote: > > > > On Wed, 26 Jun 2024 15:08:22 -0700 Jakub Kicinski wrote: > > > On Tue, 25 Jun 2024 19:54:01 + Mina Almasry wrote: > > > >

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

2024-06-27 Thread Mina Almasry
d 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: Shakeel Butt Cc: Jeroen de

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

2024-06-27 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_f

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

2024-06-27 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 v15 03/14] netdev: support binding dma-buf to netdevice

2024-06-27 Thread Mina Almasry
s, and 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 Reviewed-by: Pavel Begunkov # excluding netlink

[PATCH net-next v15 04/14] netdev: netdevice devmem allocator

2024-06-27 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->

[PATCH net-next v15 06/14] page_pool: devmem support

2024-06-27 Thread Mina Almasry
hether 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 Reviewed-by: Pavel Begunkov --- v13: - Move NET_IOV dependent changes to this patch. - Fixed comm

[PATCH net-next v15 05/14] page_pool: convert to use netmem

2024-06-27 Thread Mina Almasry
hange 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 Reviewed-by: Pavel Begunkov --- v13: - Fix allmodconfig build error. NET_IOV was not defined as of this patch. - Removed unnecessary update of page_pool_alloc() API. I

[PATCH net-next v15 08/14] net: support non paged skb frags

2024-06-27 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 to

[PATCH net-next v15 07/14] memory-provider: dmabuf devmem memory provider

2024-06-27 Thread Mina Almasry
is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v13: - Return on warning (Pavel). - Fixed pool->recycle_stats not being freed on error (Pavel). - Applied reviewed-by

[PATCH net-next v15 10/14] tcp: RX path for devmem TCP

2024-06-27 Thread Mina Almasry
er_frags, and each page passed 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 ---

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

2024-06-27 Thread Mina Almasry
ags 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 v15 11/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-27 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 v15 12/14] net: add devmem TCP documentation

2024-06-27 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 v15 13/14] tools: net: package libynl for use in selftests

2024-06-27 Thread Mina Almasry
From: Jakub Kicinski Support building the C YNL userspace library into one big static file. We can then link selftests against it for easy to use C netlink interface. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- v15: - Added this patch from Jakub to fix linking against ynl

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

2024-06-27 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 --- v15: - Fix linking against libynl. (Jakub) v9: https://lore.kernel.org/netdev

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

2024-06-27 Thread Mina Almasry
On Thu, Jun 27, 2024 at 5:32 PM Mina Almasry wrote: > > v15: > https://patchwork.kernel.org/project/netdevbpf/list/?series=865481&state=* > > > No material changes in this version, only a fix to linking against > libynl.a from the last version. Per Jakub's ins

Re: [PATCH net-next v15 12/14] net: add devmem TCP documentation

2024-07-01 Thread Mina Almasry
On Fri, Jun 28, 2024 at 3:10 AM Donald Hunter wrote: > > Mina Almasry writes: > > + > > +The user must bind a dmabuf to any number of RX queues on a given NIC using > > +the netlink API:: > > + > > + /* Bind dmabuf to NIC RX queue 15 */ > > + str

Re: [PATCH net-next v15 02/14] net: netdev netlink api to bind dma-buf to a net device

2024-07-01 Thread Mina Almasry
On Fri, Jun 28, 2024 at 3:10 AM Donald Hunter wrote: > > Mina Almasry writes: > > + - > > +name: bind-dmabuf > > +attributes: > > + - > > +name: ifindex > > +doc: netdev ifindex to bind the dma-buf to. > > Minor nit:

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

2024-07-02 Thread Mina Almasry
On Tue, Jul 2, 2024 at 8:25 AM Arnd Bergmann wrote: > > On Fri, Jun 28, 2024, at 02:32, Mina Almasry wrote: > > --- a/arch/alpha/include/uapi/asm/socket.h > > +++ b/arch/alpha/include/uapi/asm/socket.h > > @@ -140,6 +140,11 @@ > > #define SO_PASSPIDFD

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

2024-07-03 Thread Mina Almasry
On Tue, Jul 2, 2024 at 6:09 PM Jakub Kicinski wrote: > > On Fri, 28 Jun 2024 00:32:40 +0000 Mina Almasry wrote: > > + if (binding->list.next) > > + list_del(&binding->list); > > + > > + xa_for_each(&binding->bound_rxq_list, xa_i

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

2024-07-08 Thread Mina Almasry
On Thu, Jul 4, 2024 at 10:57 AM Taehee Yoo wrote: > > I found several locking warnings while testing. > Thanks for Testing Taehee! And sorry for the late reply. I was off for a couple of days. With some minor tweaks to my test setup I was able to reproduce and fix all 3 warnings. > [ 1135.125874

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

2024-07-09 Thread Mina Almasry
On Tue, Jul 9, 2024 at 8:37 AM Taehee Yoo wrote: > ... > And I found another bug. > > [ 236.625141] BUG: KASAN: slab-use-after-free in > net_devmem_unbind_dmabuf+0x364/0x440 ... > Reproducer: > ./ncdevmem -f -l -p 5201 -v 7 -t 0 -q 2 & > sleep 10 > modprobe -rv bnxt_en > killall ncdevmem > > I th

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

2024-07-09 Thread Mina Almasry
end to end without a dependency on a specific dmabuf provider. ** Test Setup 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: Jas

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

2024-07-09 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_

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

2024-07-09 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 --- v16: - Use subset-of: queue queue-id instead of queue-dmabuf (Jakub). - Rename attribute 'bind-d

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

2024-07-09 Thread Mina Almasry
s, and 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 Reviewed-by: Pavel Begunkov # excluding netlink Acked-b

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

2024-07-09 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_binding to avoid patch-by-patch build error. - Move niov->

[PATCH net-next v16 05/13] page_pool: devmem support

2024-07-09 Thread Mina Almasry
hether 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 Reviewed-by: Pavel Begunkov --- v13: - Move NET_IOV dependent changes to this patch. - Fixed comm

[PATCH net-next v16 07/13] net: support non paged skb frags

2024-07-09 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 Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return se

[PATCH net-next v16 06/13] memory-provider: dmabuf devmem memory provider

2024-07-09 Thread Mina Almasry
is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v16: - Add DEBUG_NET_WARN_ON_ONCE(!rtnl_is_locked()), to catch cases if page_pool_init without rtnl_locking when the q

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

2024-07-09 Thread Mina Almasry
ags 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 Reviewed-by: Eric Dumazet --- v16: - Fix unreadable handling in skb_split_no_header() (Eric). v11: - drop excessive checks for

[PATCH net-next v16 09/13] tcp: RX path for devmem TCP

2024-07-09 Thread Mina Almasry
er_frags, and each page passed 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 Re

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

2024-07-09 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 v16 11/13] net: add devmem TCP documentation

2024-07-09 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https://lore.kernel.org/netdev

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

2024-07-09 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 --- v16: - Remove outdated -n option (Taehee). - Use 'ifname' instead of accidentally hardc

[PATCH net-next v16 13/13] netdev: add dmabuf introspection

2024-07-09 Thread Mina Almasry
7;inflight': 1023, 'inflight-mem': 4190208}, And queue stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump queue-get ... {'dmabuf': 10, 'id': 8, 'ifindex': 3, 'type': 'rx'}, {'dmabuf': 10, 'id

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

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 9:37 AM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 00:17:37 +0000 Mina Almasry wrote: > > + net_devmem_dmabuf_binding_get(binding); > > Why does every iov need to hold a ref? pp holds a ref and does its own > accounting, so it won't disa

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 9:49 AM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 00:17:38 +0000 Mina Almasry wrote: > > @@ -68,17 +107,103 @@ static inline netmem_ref page_to_netmem(struct page > > *page) > > > > static inline int netmem_ref_count(netmem_ref netmem)

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

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 12:55 PM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 12:29:58 -0700 Mina Almasry wrote: > > On Wed, Jul 10, 2024 at 9:37 AM Jakub Kicinski wrote: > > > On Wed, 10 Jul 2024 00:17:37 + Mina Almasry wrote: > > > > + net_

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 9:49 AM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 00:17:38 +0000 Mina Almasry wrote: > > +static inline struct net_iov *__netmem_clear_lsb(netmem_ref netmem) > > +{ > > + return (struct net_iov *)((__force unsigned long)netmem & ~NET_IO

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

2024-07-11 Thread Mina Almasry
On Wed, Jul 10, 2024 at 5:44 PM John Hubbard wrote: > > On 7/9/24 5:17 PM, Mina Almasry wrote: > ... > > diff --git a/tools/testing/selftests/net/Makefile > > b/tools/testing/selftests/net/Makefile > > index bc3925200637c..39420a6e86b7f 100644 > > --- a/too

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-11 Thread Mina Almasry
On Wed, Jul 10, 2024 at 6:23 PM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 16:42:04 -0700 Mina Almasry wrote: > > > > +static inline void netmem_set_pp(netmem_ref netmem, struct page_pool > > > > *pool) > > > > +{ > > > > + __netmem_cl

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

2024-07-23 Thread Mina Almasry
for you. It should apply on top of v16: commit 795b8ff01906d ("fix for release issue") Author: Mina Almasry Date: Tue Jul 23 00:18:23 2024 + fix for release issue Change-Id: Ib45a0aa6cba2918db5f7ba535414ffa860911fa4 diff --git a/include/net/devmem.h b/include/net/devmem.h i

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

2024-07-29 Thread Mina Almasry
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: Shakeel Butt Cc: Jeroen de Borst Cc: Praveen Kaligineedi Mina Almasry (14): netdev: ad

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

2024-07-29 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not

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

2024-07-29 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 Reviewed-by: Donald Hunter Reviewed-by: Jakub Kicinski --- v16: - Use subset-of: queue queue-id instead

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

2024-07-29 Thread Mina Almasry
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 Reviewed-by: Pavel Begunkov # excluding netlink Acked-by: Daniel Vetter --- v17: - Add missing kfree(o

[PATCH net-next v17 04/14] netdev: netdevice devmem allocator

2024-07-29 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v17: - Don't acquire a binding ref for every allocation (Jakub). v11: - Fix extraneous inline directive (Paolo) v8: - Rename netdev_dmabuf_binding -> net_devmem_dmabuf_bin

[PATCH net-next v17 05/14] page_pool: move dmaddr helpers to .c file

2024-07-29 Thread Mina Almasry
These helpers are used for setup and init of buffers, and their implementation need not be static inline in the header file. Moving the implementation to the .c file allows us to hide netmem implementation details in internal header files rather than the public file. Signed-off-by: Mina Almasry

[PATCH net-next v17 06/14] page_pool: devmem support

2024-07-29 Thread Mina Almasry
hether 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 Reviewed-by: Pavel Begunkov --- v17: - Rename netmem_to_pfn to netmem_pfn_trace (Jakub) - Move some

[PATCH net-next v17 07/14] memory-provider: dmabuf devmem memory provider

2024-07-29 Thread Mina Almasry
is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v17: - Use ASSERT_RTNL (Jakub) v16: - Add DEBUG_NET_WARN_ON_ONCE(!rtnl_is_locked()), to catch cases if page_pool_init

[PATCH net-next v17 08/14] net: support non paged skb frags

2024-07-29 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 Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return se

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

2024-07-29 Thread Mina Almasry
ags 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 Reviewed-by: Eric Dumazet --- v16: - Fix unreadable handling in skb_split_no_header() (Eric). v11: - drop excessive checks for

[PATCH net-next v17 10/14] tcp: RX path for devmem TCP

2024-07-29 Thread Mina Almasry
er_frags, and each page passed 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 Re

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

2024-07-29 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 v17 12/14] net: add devmem TCP documentation

2024-07-29 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya Reviewed-by: Donald Hunter --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https

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

2024-07-29 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 --- v16: - Remove outdated -n option (Taehee). - Use 'ifname' instead of accidentally hardc

[PATCH net-next v17 14/14] netdev: add dmabuf introspection

2024-07-29 Thread Mina Almasry
7;inflight': 1023, 'inflight-mem': 4190208}, And queue stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump queue-get ... {'dmabuf': 10, 'id': 8, 'ifindex': 3, 'type': 'rx'}, {'dmabuf': 10, 'id': 9,

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

2024-07-31 Thread Mina Almasry
On Tue, Jul 30, 2024 at 4:17 AM Xuan Zhuo wrote: > > On Tue, 30 Jul 2024 02:26:05 +, Mina Almasry > wrote: > > Add netdev_rx_queue_restart() function to netdev_rx_queue.h > > > Can you say more? As far as I understand, we just release the buffer > submitted to the

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, >

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 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

<    1   2   3   4   5   >