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

2024-03-04 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 v6 03/15] net: page_pool: factor out page_pool recycle check

2024-03-04 Thread Mina Almasry
The check is duplicated in 2 places, factor it out into a common helper. Signed-off-by: Mina Almasry --- net/core/page_pool.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 8776fcad064a..fe9de4ecce94 100644 --- a

[RFC PATCH net-next v6 04/15] net: netdev netlink api to bind dma-buf to a net device

2024-03-04 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 --- Changes in v1: - Add rx-queue-type to distingish rx from tx (Jakub) - Return dma-buf ID from netlink

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

2024-03-04 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 --- RFC v6: - Validate rx queue index - Refactor new

[RFC PATCH net-next v6 06/15] netdev: netdevice devmem allocator

2024-03-04 Thread Mina Almasry
ff-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry --- 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 devmem -> dmabuf (David). --- incl

[RFC PATCH net-next v6 08/15] page_pool: devmem support

2024-03-04 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 --- v6: - Rebased on top of the merged netmem_ref type. - Rebased on top of the merged skb_p

[RFC PATCH net-next v6 07/15] page_pool: convert to use netmem

2024-03-04 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 --- v6: - Rebased on top of the merged netmem_ref type. --- include/linux/skbuff.h | 4 +- include/net/netmem.h | 15 ++ include/net/page

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

2024-03-04 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 --- v6: - refactor new memory provider functions into net/core/devmem.c (Pavel) v2: - Disable devmem for p.order != 0 v1: - static_branch c

[RFC PATCH net-next v6 10/15] net: support non paged skb frags

2024-03-04 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 v6 11/15] net: add support for skbs with unreadable frags

2024-03-04 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 --- v6 - skb->dmabuf -> skb->readable (Pavel). Pavel's original suggestion was to remove the skb->dmabuf fl

[RFC PATCH net-next v6 12/15] tcp: RX path for devmem TCP

2024-03-04 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

[RFC PATCH net-next v6 13/15] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-03-04 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 v6 14/15] net: add devmem TCP documentation

2024-03-04 Thread Mina Almasry
Signed-off-by: Mina Almasry --- v1 -> v2: - Missing spdx (simon) - add to index.rst (simon) --- Documentation/networking/devmem.rst | 271 Documentation/networking/index.rst | 1 + 2 files changed, 272 insertions(+) create mode 100644 Documentation/network

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

2024-03-04 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 for the

Re: [RFC PATCH net-next v6 12/15] tcp: RX path for devmem TCP

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 12:42 AM Arnd Bergmann wrote: > > On Tue, Mar 5, 2024, at 03:01, Mina Almasry wrote: > > --- a/arch/alpha/include/uapi/asm/socket.h > > +++ b/arch/alpha/include/uapi/asm/socket.h > > #define SO_PEERPIDFD 77 > > +#define SO_DEV

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

2024-03-05 Thread Mina Almasry
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: > > --- > > > > bench_page_pool_simple.ko tests with and without these changes: > &

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

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 1:05 AM Arnd Bergmann wrote: > > On Tue, Mar 5, 2024, at 03:01, Mina Almasry wrote: > > > +int netdev_bind_dmabuf(struct net_device *dev, unsigned int dmabuf_fd, > > +struct netdev_dmabuf_binding **out) > > +{ > > +

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

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 4:55 AM Yunsheng Lin wrote: > > On 2024/3/5 10:01, Mina Almasry wrote: > > ... > > > > > The netdev_dmabuf_binding struct is refcounted, and releases its > > resources only when all the refs are released. > > > > Signed-off-by:

Re: [RFC PATCH net-next v6 07/15] page_pool: convert to use netmem

2024-03-05 Thread Mina Almasry
On Mon, Mar 4, 2024 at 6:02 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 patch the n

Re: [RFC PATCH net-next v6 08/15] page_pool: devmem support

2024-03-05 Thread Mina Almasry
On Mon, Mar 4, 2024 at 6:02 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

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

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 1:55 PM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > +struct memory_provider_ops { > > + int (*init)(struct page_pool *pool); > > + void (*destroy)(struct page_pool *pool); > > + struct page *(*alloc_pages)(str

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

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 6:28 PM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > + if (pool->p.queue) > > + binding = READ_ONCE(pool->p.queue->binding); > > + > > + if (binding) { > > + pool->mp_

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

2024-03-05 Thread Mina Almasry
On Tue, Mar 5, 2024 at 6:47 PM David Wei wrote: > > On 2024-03-05 18:42, Mina Almasry wrote: > > On Tue, Mar 5, 2024 at 6:28 PM David Wei wrote: > >> > >> On 2024-03-04 18:01, Mina Almasry wrote: > >>> + if (pool->p.queue) > >>>

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

2024-03-06 Thread Mina Almasry
On Wed, Mar 6, 2024 at 6:59 AM Pavel Begunkov wrote: > > On 3/6/24 02:42, Mina Almasry wrote: > > On Tue, Mar 5, 2024 at 6:28 PM David Wei wrote: > >> > >> On 2024-03-04 18:01, Mina Almasry wrote: > >>> + if (pool->p.queue) > >>>

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

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

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

2024-03-06 Thread Mina Almasry
On Wed, Mar 6, 2024 at 11:14 AM Pavel Begunkov wrote: > > On 3/6/24 17:04, Mina Almasry wrote: > > On Wed, Mar 6, 2024 at 6:30 AM Pavel Begunkov > > wrote: > >> > >> On 3/5/24 22:36, Mina Almasry wrote: > >>> On Tue, Mar 5, 2024 at 1:55 PM Dav

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

2024-03-06 Thread Mina Almasry
On Wed, Mar 6, 2024 at 4:38 AM Yunsheng Lin wrote: > > On 2024/3/6 5:17, Mina Almasry wrote: > > On Tue, Mar 5, 2024 at 4:55 AM Yunsheng Lin wrote: > >> > >> On 2024/3/5 10:01, Mina Almasry wrote: > >> > >> ... > >> > >>> &

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

2024-03-07 Thread Mina Almasry
On Thu, Mar 7, 2024 at 5:30 PM Jakub Kicinski wrote: > > On Mon, 4 Mar 2024 18:01:36 -0800 Mina Almasry wrote: > > + * void *(*ndo_queue_mem_alloc)(struct net_device *dev, int idx); > > + * Allocate memory for an RX queue. The memory returned in the form of > > + * a

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

2024-03-08 Thread Mina Almasry
On Thu, Mar 7, 2024 at 8:57 PM David Wei wrote: > > On 2024-03-04 18:01, 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 gets released from > > the pool

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

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 pr

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

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

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

2024-03-26 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): queue_api: define queue api net: netdev

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

2024-03-26 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 --- v7: - Use IS_ERR() instead of IS_ERR_OR_NULL(

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

2024-03-26 Thread Mina Almasry
ff-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:

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

2024-03-26 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 --- v6: - Rebased on top of the merged netmem_ref type. To: linux...@kvack.org Cc: Matthew Wilcox --- include/linux/skbuff.h | 4 +- include/net/net

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

2024-03-26 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 --- v6: - refactor new memory provider functions into net/core/devmem.c (Pavel) v2: - Disable devmem for p.order != 0 v1: - static_branch c

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

2024-03-26 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 --- v7: - Remove static_branch_unlikely from netmem_to_net_iov(). We're getting better result

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

2024-03-26 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 --- v6 - skb->dmabuf -> skb->readable (Pavel). Pavel's original suggestion was to remove the skb->dmabuf fl

[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 11/14] tcp: RX path for devmem TCP

2024-03-26 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 ---

[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 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 for the

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

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

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 queues

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 part of th

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

2024-04-02 Thread Mina Almasry
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: Praveen Kaligineedi Jakub

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

2024-04-02 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 --- v8: - move dmabuf_devmem_ops usage to later patch

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

2024-04-02 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

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

2024-04-02 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 --- 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

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

2024-04-02 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 --- v7: - Remove static_branch_unlikely from netmem_to_net_iov(). We're getting better result

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

2024-04-02 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

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

2024-04-02 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 --- v6 - skb->dmabuf -> skb->readable (Pavel). Pavel's original suggestion was to remove the skb->dmabuf fl

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

2024-04-02 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 ---

[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 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 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 for the

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

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

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

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

2024-06-06 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 --- v11: - Fix build error with CONFIG_DMA_SHAR

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

2024-06-06 Thread Mina Almasry
ff-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 lat

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

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

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

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

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

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

2024-06-06 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 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 10/13] tcp: RX path for devmem TCP

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

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

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

2024-06-10 Thread Mina Almasry
On Mon, Jun 10, 2024 at 5:38 AM Christian König wrote: > > Am 10.06.24 um 14:16 schrieb Jason Gunthorpe: > > On Mon, Jun 10, 2024 at 02:07:01AM +0100, Pavel Begunkov wrote: > >> On 6/10/24 01:37, David Wei wrote: > >>> On 2024-06-07 17:52, Jason Gunthorpe wrote: > IMHO it seems to compose poo

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

2024-06-11 Thread Mina Almasry
On Mon, Jun 10, 2024 at 11:26 PM Christoph Hellwig wrote: > > On Mon, Jun 10, 2024 at 09:16:43AM -0600, David Ahern wrote: > > > > exactly. io_uring, page_pool, dmabuf - all kernel building blocks for > > solutions. This why I was pushing for Mina's set not to be using the > > name `devmem` - it i

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

2024-06-11 Thread Mina Almasry
On Mon, Jun 10, 2024 at 3:15 PM Jason Gunthorpe wrote: > > On Mon, Jun 10, 2024 at 08:20:08PM +0100, Pavel Begunkov wrote: > > On 6/10/24 16:16, David Ahern wrote: > > > > > There is no reason you shouldn't be able to use your fast io_uring > > > > completion and lifecycle flow with DMABUF backed

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

2024-06-12 Thread Mina Almasry
oud 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 (13): netdev: add net

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

2024-06-12 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 v12 02/13] net: netdev netlink api to bind dma-buf to a net device

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

2024-06-12 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 --- v11: - Fix build error with CONFIG_DMA_SHAR

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

2024-06-12 Thread Mina Almasry
ff-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 lat

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

2024-06-12 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 --- v12: - Fix allmodconfig build error. Very recently renesas/ravb_main.c added a dependency on page_pool that I missed in my rebase. The dependency calls page_pool_

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

2024-06-12 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 v12 07/13] memory-provider: dmabuf devmem memory provider

2024-06-12 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 --- 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 v12 08/13] net: support non paged skb frags

2024-06-12 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 v12 09/13] net: add support for skbs with unreadable frags

2024-06-12 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 v12 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

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

<    1   2   3   4   5   >