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

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 on

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 sh

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

2024-05-10 Thread Mina Almasry
plit & 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 Jakub Kicinski (1): net: page_pool: create hooks for custom page

[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 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 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 04/14] netdev: support binding dma-buf to netdevice

2024-05-10 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 --- v9: https://lore.kernel.org/all/20240403002053.

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

2024-05-10 Thread Mina Almasry
ff-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

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

2024-05-10 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 --- 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 pat

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

2024-05-10 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 --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-8-almasrym...@google.com/ - Rem

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

2024-05-10 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 --- 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 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 10/14] net: add support for skbs with unreadable frags

2024-05-10 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 --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-11-almasrym...@google.com/ - change skb->readable to skb->unrea

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

2024-05-10 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 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 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 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

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 feedbac

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

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

2024-05-30 Thread Mina Almasry
son 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: netdev netlink

[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 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 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 05/14] netdev: netdevice devmem allocator

2024-05-30 Thread Mina Almasry
ff-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

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

2024-05-30 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 --- v10: - Moved net_iov_dma_addr() to devmem.h an

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

2024-05-30 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 --- 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 pat

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

2024-05-30 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 --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-8-almasrym...@google.com/ - Rem

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

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

2024-05-30 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 --- 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 10/14] net: add support for skbs with unreadable frags

2024-05-30 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 --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-11-almasrym...@google.com/ - change skb->readable to skb->unrea

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

2024-05-30 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 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 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 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

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 se

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

2024-08-05 Thread Mina Almasry
On Tue, Jul 30, 2024 at 4:38 AM Markus Elfring wrote: > > … > > +++ b/include/net/devmem.h > > @@ -0,0 +1,115 @@ > … > > +#ifndef _NET_DEVMEM_H > > +#define _NET_DEVMEM_H > … > > I suggest to omit leading underscores from such identifiers. > https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+D

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

2024-08-05 Thread Mina Almasry
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: Jason Gunthorpe Cc

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

2024-08-05 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 v18 01/14] netdev: add netdev_rx_queue_restart()

2024-08-05 Thread Mina Almasry
ff-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v18: - Add more color to commit message (Xuan Zhuo). v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel

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

2024-08-05 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 v18 03/14] netdev: support binding dma-buf to netdevice

2024-08-05 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 v18 05/14] page_pool: move dmaddr helpers to .c file

2024-08-05 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 v18 06/14] page_pool: devmem support

2024-08-05 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 v18 07/14] memory-provider: dmabuf devmem memory provider

2024-08-05 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 v18 08/14] net: support non paged skb frags

2024-08-05 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 v18 09/14] net: add support for skbs with unreadable frags

2024-08-05 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 v18 10/14] tcp: RX path for devmem TCP

2024-08-05 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 v18 11/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-05 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 v18 12/14] net: add devmem TCP documentation

2024-08-05 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 v18 14/14] netdev: add dmabuf introspection

2024-08-05 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,

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

2024-08-05 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

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

2024-08-08 Thread Mina Almasry
On Tue, Aug 6, 2024 at 4:59 PM Jakub Kicinski wrote: > ... > On Mon, 5 Aug 2024 21:25:20 +0000 Mina Almasry wrote: > > + if (pool->p.queue) { > > + /* We rely on rtnl_lock()ing to make sure netdev_rx_queue > > + * configuration doesn't

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

2024-08-09 Thread Mina Almasry
On Thu, Aug 8, 2024 at 10:24 PM Jakub Kicinski wrote: > > On Thu, 8 Aug 2024 16:36:24 -0400 Mina Almasry wrote: > > > How do you know that the driver: > > > - supports net_iov at all (let's not make implicit assumptions based > > >on presence of qu

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

2024-08-10 Thread Mina Almasry
On Fri, Aug 9, 2024 at 11:52 PM Jakub Kicinski wrote: > > On Fri, 9 Aug 2024 16:45:50 +0100 Pavel Begunkov wrote: > > > I think this is good, and it doesn't seem hacky to me, because we can > > > check the page_pools of the netdev while we hold rtnl, so we can be > > > sure nothing is messing with

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

2024-08-12 Thread Mina Almasry
On Mon, Aug 12, 2024 at 1:57 PM Jakub Kicinski wrote: > > On Sun, 11 Aug 2024 22:51:13 +0100 Pavel Begunkov wrote: > > > I think we're talking about 2 slightly different flags, AFAIU.> > > > Pavel and I are suggesting the driver reports "I support memory > > > providers" directly to core (via the

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

2024-08-13 Thread Mina Almasry
On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > BTW, Mina, the core should probably also check that XDP isn't installed > before / while the netmem is bound to a queue. Sorry if noob question, but what is the proper check for this? I tried adding this to net_devmem_bind_dmabuf_to_queue():

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

2024-08-13 Thread Mina Almasry
On Tue, Aug 13, 2024 at 4:39 AM Mina Almasry wrote: > > On Mon, Aug 12, 2024 at 8:15 PM Jakub Kicinski wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. > > Sorry if noob question,

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

2024-08-13 Thread Mina Almasry
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: Jaso

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

2024-08-13 Thread Mina Almasry
ff-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v18: - Add more color to commit message (Xuan Zhuo). v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel

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

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

2024-08-13 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 --- v19: - Prevent deactiva

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

2024-08-13 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v19: - Don't reset dma_addr on allocation/free (Jakub) v17: - Don't acquire a binding ref for every allocation (Jakub). v11: - Fix extraneous inline directive (Paolo

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

2024-08-13 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 --- v19: - Move page_pool_set_dma_addr(_netmem) to page_pool_priv.h - D

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

2024-08-13 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 --- v19: - Add PP_FLAG_ALLOW_UNREADABLE_NETMEM flag. It serves 2 purposes, (a) it guards drivers that don't support unrea

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

2024-08-13 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 v19 08/13] net: add support for skbs with unreadable frags

2024-08-13 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 v19 09/13] tcp: RX path for devmem TCP

2024-08-13 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 v19 10/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-13 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 v19 11/13] net: add devmem TCP documentation

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

2024-08-13 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 --- v19: - Check return code of ethtool commands. - Add test for deactivating mp bound rx queues

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

2024-08-13 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 v19 06/13] memory-provider: dmabuf devmem memory provider

2024-08-14 Thread Mina Almasry
On Wed, Aug 14, 2024 at 10:11 AM Pavel Begunkov wrote: ... > > diff --git a/net/core/devmem.c b/net/core/devmem.c > > index 301f4250ca82..2f2a7f4dee4c 100644 > > --- a/net/core/devmem.c > > +++ b/net/core/devmem.c > > @@ -17,6 +17,7 @@ > > #include > > #include > > #include > > +#include

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

2024-08-16 Thread Mina Almasry
On Thu, Aug 15, 2024 at 9:22 PM Jakub Kicinski wrote: > > On Wed, 14 Aug 2024 17:32:53 +0100 Pavel Begunkov wrote: > > > This is where I get a bit confused. Jakub did mention that it is > > > desirable for core to verify that the driver did the right thing, > > > instead of trusting that a driver

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

2024-08-16 Thread Mina Almasry
On Thu, Aug 15, 2024 at 8:48 PM Jakub Kicinski wrote: > > On Tue, 13 Aug 2024 21:13:05 +0000 Mina Almasry wrote: > > +int dev_get_max_mp_channel(const struct net_device *dev) > > +{ > > + int i, max = -1; > > I presume the bug from yesterday is self eviden

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

2024-08-17 Thread Mina Almasry
On Sat, Aug 17, 2024 at 9:58 AM Taehee Yoo wrote: > > On Wed, Aug 14, 2024 at 6:13 AM Mina Almasry wrote: > > > > Hi Mina, > > > In tcp_recvmsg_locked(), detect if the skb being received by the user > > is a devmem skb. In this case - if the user provided the M

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

2024-08-18 Thread Mina Almasry
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: Jason Gunthor

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

2024-08-18 Thread Mina Almasry
ff-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v18: - Add more color to commit message (Xuan Zhuo). v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel

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

2024-08-18 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 v20 03/13] netdev: support binding dma-buf to netdevice

2024-08-18 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 --- v20: - re

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

2024-08-18 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov --- v20: - Removed dma_addr field in dmabuf_genpool_chunk_owner not used in this patch (moved to later patch where it's used). v19: - Don't reset dma_addr on allocation/fr

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

2024-08-18 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 --- v19: - Move page_pool_set_dma_addr(_netmem) to page_pool_priv.h - D

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

2024-08-18 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 v20 06/13] memory-provider: dmabuf devmem memory provider

2024-08-18 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 --- v20: - Moved queue pp_params field from fast path entries to slow path entries. - Moved page_pool_check_memory_provider()

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

2024-08-18 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 v20 09/13] tcp: RX path for devmem TCP

2024-08-18 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 v20 10/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-08-18 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 v20 11/13] net: add devmem TCP documentation

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

2024-08-18 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 --- v20: - Remove unnecessary sleep(1) - Add test to ensure dmabuf binding fails if header split is

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

2024-08-18 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 v20 00/13] Device Memory TCP

2024-08-19 Thread Mina Almasry
On Sun, Aug 18, 2024 at 11:54 PM Mina Almasry wrote: > > v20: > https://patchwork.kernel.org/project/netdevbpf/list/?series=879373&state=* > > > v20 aims to resolve a couple of bug reports against v19, and addresses > some review comments around the page_p

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

2024-08-19 Thread Mina Almasry
On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device *dev, > > > struct netlink_ext_ack *extack > > > NL_SET_ERR_MSG(extack, "Native and gener

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

2024-08-19 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 Borst Cc: P

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

2024-08-19 Thread Mina Almasry
ff-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v18: - Add more color to commit message (Xuan Zhuo). v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not checking dev->queue_mgmt_ops (Pavel

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

2024-08-19 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 v21 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 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 --- v21: - Move definitio

<    1   2   3   4   5   >