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 v3:
- Support binding multiple rx rx-queues
---
Documentation/netlink/specs/netdev.yaml
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
From: Jakub Kicinski
Releasing the DMA mapping will be useful for other types
of pages, so factor it out. Make sure compiler inlines it,
to avoid any regressions.
Signed-off-by: Jakub Kicinski
Signed-off-by: Mina Almasry
---
This is implemented by Jakub in his RFC:
https://lore.kernel.org
-next with this RFC and memory provider API cherry-picked
locally.
Hardware: Google Cloud A3 VMs.
NIC: GVE with header split & RSS & flow steering support.
Jakub Kicinski (2):
net: page_pool: factor out releasing DMA from releasing the page
net: page_pool: create hooks for custom page provide
gures its queues, 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 v3:
- Support multi rx-queu
truct.
page_pool_iov are refcounted and are freed back to the binding when the
refcount drops to 0.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
include/linux/netdevice.h | 13
include/net/page_pool/helpers.h
for
the provider in the page_pool_params.
The provider obtains a reference on the netdev_dmabuf_binding which
guarantees the binding and the underlying mapping remains alive until
the provider is destroyed.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Alma
check for special
handling of page_pool_iov.
Signed-off-by: Mina Almasry
---
include/net/page_pool/helpers.h | 74 -
net/core/page_pool.c| 63
2 files changed, 118 insertions(+), 19 deletions(-)
diff --git a/include/net/page
Make skb_frag_page() fail in the case where the frag is not backed
by a page, and fix its relevent callers to handle this case.
Correctly handle skb_frag refcounting in the page_pool_iovs case.
Signed-off-by: Mina Almasry
---
include/linux/skbuff.h | 42
frags of
devmem skbs and avoid coalescing devmem skbs with non devmem skbs.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
include/linux/skbuff.h | 14 +++-
include/net/tcp.h | 5 +--
net/core/datagram.c| 6
net/core
er_pages, 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
--
Add an interface for the user to notify the kernel that it is done
reading the NET_RX dmabuf pages returned as cmsg. The kernel will
drop the reference on the NET_RX pages to make them available for
re-use.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: 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
---
RFC v2:
- General cleanups (Willem).
---
tools/testing/selftests/net/.gitignore | 1 +
tools
On Mon, Nov 6, 2023 at 10:44 AM Stanislav Fomichev wrote:
>
> On 11/05, Mina Almasry wrote:
> > 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 MSG_SOCK_DEVMEM
> > flag - pass it to tcp_rec
On Mon, Nov 6, 2023 at 11:34 AM David Ahern wrote:
>
> On 11/6/23 11:47 AM, Stanislav Fomichev wrote:
> > On 11/05, Mina Almasry wrote:
> >> For device memory TCP, we expect the skb headers to be available in host
> >> memory for access, and we expect the skb frags t
On Mon, Nov 6, 2023 at 1:59 PM Stanislav Fomichev wrote:
>
> On 11/06, Mina Almasry wrote:
> > On Mon, Nov 6, 2023 at 11:34 AM David Ahern wrote:
> > >
> > > On 11/6/23 11:47 AM, Stanislav Fomichev wrote:
> > > > On 11/05, Mina Almasry wrote:
> &g
On Mon, Nov 6, 2023 at 2:59 PM Stanislav Fomichev wrote:
>
> On 11/06, Mina Almasry wrote:
> > On Mon, Nov 6, 2023 at 1:59 PM Stanislav Fomichev wrote:
> > >
> > > On 11/06, Mina Almasry wrote:
> > > > On Mon, Nov 6, 2023 at 11:34 AM David Ahern wrot
On Mon, Nov 6, 2023 at 3:37 PM David Ahern wrote:
>
> On 11/6/23 3:18 PM, Mina Almasry wrote:
> >>>>>> @@ -991,7 +993,7 @@ struct sk_buff {
> >>>>>> #if IS_ENABLED(CONFIG_IP_SCTP)
> >>>>>> __u8
On Mon, Nov 6, 2023 at 4:08 PM Willem de Bruijn
wrote:
>
> On Mon, Nov 6, 2023 at 3:55 PM Stanislav Fomichev wrote:
> >
> > On Mon, Nov 6, 2023 at 3:27 PM Mina Almasry wrote:
> > >
> > > On Mon, Nov 6, 2023 at 2:59 PM Stanislav Fomichev wrote:
> >
On Mon, Nov 6, 2023 at 4:16 PM David Ahern wrote:
>
> On 11/5/23 7:44 PM, Mina Almasry wrote:
> > diff --git a/net/core/datagram.c b/net/core/datagram.c
> > index 176eb5834746..cdd4fb129968 100644
> > --- a/net/core/datagram.c
> > +++ b/net/core/datagram.c
>
On Mon, Nov 6, 2023 at 5:06 PM Stanislav Fomichev wrote:
[..]
> > > > And the socket has to know this association; otherwise those tokens
> > > > are useless since they don't carry anything to identify the dmabuf.
> > > >
> > > > I think my other issue with MSG_SOCK_DEVMEM being on recvmsg is that
On Tue, Nov 7, 2023 at 1:00 AM Yunsheng Lin wrote:
>
> On 2023/11/6 10:44, Mina Almasry wrote:
> > Make skb_frag_page() fail in the case where the frag is not backed
> > by a page, and fix its relevent callers to handle this case.
> >
> > Correctly hand
On Tue, Nov 7, 2023 at 12:00 AM Yunsheng Lin wrote:
>
> On 2023/11/6 10:44, Mina Almasry wrote:
> > Overload the LSB of struct page* to indicate that it's a page_pool_iov.
> >
> > Refactor mm calls on struct page* into helpers, and add page_pool_iov
> > handli
On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote:
>
> On 2023/11/6 10:44, Mina Almasry wrote:
> > +
> > +void __netdev_devmem_binding_free(struct netdev_dmabuf_binding *binding)
> > +{
> > + size_t size, avail;
> > +
> > + g
On Mon, Nov 6, 2023 at 3:44 PM David Ahern wrote:
>
> On 11/5/23 7:44 PM, Mina Almasry wrote:
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index eeeda849115c..1c351c138a5b 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/l
On Tue, Nov 7, 2023 at 2:55 PM David Ahern wrote:
>
> On 11/7/23 3:10 PM, Mina Almasry wrote:
> > On Mon, Nov 6, 2023 at 3:44 PM David Ahern wrote:
> >>
> >> On 11/5/23 7:44 PM, Mina Almasry wrote:
> >>> diff --git a/include/linux/netdevice.h b/include/
On Mon, Nov 6, 2023 at 4:03 PM Willem de Bruijn
wrote:
>
> On Mon, Nov 6, 2023 at 3:55 PM David Ahern wrote:
> >
> > On 11/6/23 4:32 PM, Stanislav Fomichev wrote:
> > >> The concise notification API returns tokens as a range for
> > >> compression, encoding as two 32-bit unsigned integers start +
On Mon, Nov 6, 2023 at 1:02 PM Stanislav Fomichev wrote:
>
> On 11/05, Mina Almasry wrote:
> > +static inline bool page_is_page_pool_iov(const struct page *page)
> > +{
> > + return (unsigned long)page & PP_DEVMEM;
> > +}
>
> Speaking of bpf: one t
> > On Mon, Nov 6, 2023 at 11:45 PM Yunsheng Lin wrote:
> >>
> >> On 2023/11/6 10:44, Mina Almasry wrote:
> >>> +
> >>> +void netdev_free_devmem(struct page_pool_iov *ppiov)
> >>> +{
> >>> + st
On Tue, Nov 7, 2023 at 7:40 PM Yunsheng Lin wrote:
>
> On 2023/11/8 5:59, Mina Almasry wrote:
> > On Mon, Nov 6, 2023 at 11:46 PM Yunsheng Lin wrote:
> >>
> >> On 2023/11/6 10:44, Mina Almasry wrote:
> >>> +
> >>> +void __netdev_dev
On Wed, Nov 8, 2023 at 3:47 PM David Wei wrote:
>
> On 2023-11-05 18:44, 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 on the netdevice. On the bin
On Tue, Nov 7, 2023 at 4:01 PM David Ahern wrote:
>
> On 11/7/23 4:55 PM, Mina Almasry wrote:
> > On Mon, Nov 6, 2023 at 4:03 PM Willem de Bruijn
> > wrote:
> >>
> >> On Mon, Nov 6, 2023 at 3:55 PM David Ahern wrote:
> >>>
> >>> On 11
On Wed, Nov 8, 2023 at 2:56 AM Yunsheng Lin wrote:
>
> On 2023/11/8 5:56, Mina Almasry wrote:
> > On Tue, Nov 7, 2023 at 12:00 AM Yunsheng Lin wrote:
> >>
> >> On 2023/11/6 10:44, Mina Almasry wrote:
> >>> Overload the LSB of struct p
On Thu, Nov 9, 2023 at 1:30 AM Yunsheng Lin wrote:
>
> On 2023/11/9 11:20, Mina Almasry wrote:
> > On Wed, Nov 8, 2023 at 2:56 AM Yunsheng Lin wrote:
>
> >
> > Agreed everything above is undoable.
> >
> >> But we might be able to do something as foli
On Thu, Nov 9, 2023 at 12:30 AM Paolo Abeni wrote:
>
> I'm trying to wrap my head around the whole infra... the above line is
> confusing. Why do you increment dma_addr? it will be re-initialized in
> the next iteration.
>
That is just a mistake, sorry. Will remove this increment.
On Thu, Nov 9,
On Thu, Nov 9, 2023 at 11:38 PM Yunsheng Lin wrote:
>
> On 2023/11/10 10:59, Mina Almasry wrote:
> > On Thu, Nov 9, 2023 at 12:30 AM Paolo Abeni wrote:
> >>
> >> I'm trying to wrap my head around the whole infra... the above line is
> >> confusing.
On Thu, Nov 9, 2023 at 1:15 AM Paolo Abeni wrote:
>
> On Sun, 2023-11-05 at 18:44 -0800, Mina Almasry wrote:
> [...]
> > @@ -3421,7 +3446,7 @@ static inline struct page *skb_frag_page(const
> > skb_frag_t *frag)
> > */
> > static inline voi
On Fri, Nov 10, 2023 at 3:20 PM Jakub Kicinski wrote:
>
> On Sun, 5 Nov 2023 18:44:03 -0800 Mina Almasry wrote:
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -52,6 +52,8 @@
> > #include
> > #include
> > #include
>
On Fri, Nov 10, 2023 at 3:13 PM Jakub Kicinski wrote:
>
> My brain is slightly fried after trying to catch up on the thread
> for close to 2h. So forgive me if I'm missing something.
> This applies to all emails I'm about to send :)
>
> On Sun, 5 Nov 2023 18:44
On Fri, Nov 10, 2023 at 3:19 PM Jakub Kicinski wrote:
>
> On Sun, 5 Nov 2023 18:44:01 -0800 Mina Almasry wrote:
> > diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> > index 6fc5134095ed..d4bea053bb7e 100644
> > --- a/include/net/page_pool/types
j
On Fri, Nov 10, 2023 at 6:36 PM Jakub Kicinski wrote:
>
> On Fri, 10 Nov 2023 18:27:08 -0800 Mina Almasry wrote:
> > Thanks for the clear requirement. I clearly had something different in mind.
> >
> > Might be dumb suggestions, but instead of creating a new ndo
On Fri, Nov 10, 2023 at 3:16 PM Jakub Kicinski wrote:
>
> On Sun, 5 Nov 2023 18:44:05 -0800 Mina Almasry wrote:
> > +static int mp_dmabuf_devmem_init(struct page_pool *pool)
> > +{
> > + struct netdev_dmabuf_binding *binding = pool->mp_priv;
&
On Fri, Nov 10, 2023 at 3:19 PM Jakub Kicinski wrote:
>
> On Sun, 5 Nov 2023 18:44:07 -0800 Mina Almasry wrote:
> > #include
> > #include
> > +#include
> > +#include
>
> > /**
> > * DOC: skb checksums
> > @@ -3402,15 +3404,38
p; RSS & flow steering support.
Jakub Kicinski (2):
net: page_pool: factor out releasing DMA from releasing the page
net: page_pool: create hooks for custom page providers
Mina Almasry (14):
queue_api: define queue api
gve: implement queue api
net: netdev netlink api to bind dma-bu
From: Jakub Kicinski
Releasing the DMA mapping will be useful for other types
of pages, so factor it out. Make sure compiler inlines it,
to avoid any regressions.
Signed-off-by: Jakub Kicinski
Signed-off-by: Mina Almasry
---
This is implemented by Jakub in his RFC:
https://lore.kernel.org
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
This API enables the net stack to reset the queues used for devmem.
Signed-off-by: Mina Almasry
---
include/linux/netdevice.h | 24
1 file changed, 24 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1b935ee341b4..316f7dee86ce
the future.
For simplicity the queue API is only supported by the diorite queue
out-of-order (DQO) format without queue-page-lists (QPL). Support for
other GVE formats can be added in the future as well.
Signed-off-by: Mina Almasry
---
drivers/net/ethernet/google/gve/gve_adminq.c | 6
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
gures its queues, 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
---
v1:
- Introduce devmem.h instead of
truct.
page_pool_iov are refcounted and are freed back to the binding when the
refcount drops to 0.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
v1:
- Rename devmem -> dmabuf (David).
---
include/net/devmem.h| 13
inc
DEV is omitted for simplicity.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
v1:
- static_branch check in page_is_page_pool_iov() (Willem & Paolo).
- PP_DEVMEM -> PP_IOV (David).
- Require PP_FLAG_DMA_MAP (Jakub).
---
include/net/page_pool
the page, and so no devmem
iovs get recycled.
To fix this, don't release iovs on elevated refcount.
Signed-off-by: Mina Almasry
---
net/core/page_pool.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index f014
check for special
handling of page_pool_iov.
Signed-off-by: Mina Almasry
---
v1:
- Disable fragmentation support for iov properly.
- fix napi_pp_put_page() path (Yunsheng).
---
include/net/page_pool/helpers.h | 78 -
net/core/page_pool.c
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.
Correctly handle skb_frag refcounting in the page_pool_iovs case.
Signed-off-by: Mina Almasry
---
Changes in v1:
- Fix illegal_highdma() (Yunsheng).
- Rework
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 re-use.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
frags of
devmem skbs and avoid coalescing devmem skbs with non devmem skbs.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
Changes in v1:
- Rename devmem -> dmabuf (David).
- Flip skb_frags_not_readable (Jakub).
---
include/linux/skbu
er_pages, 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
--
, 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
---
Changes in v1:
- Many more general cleanups (Willem).
- Removed driver reset (Jakub).
- Removed
Signed-off-by: Mina Almasry
---
Documentation/networking/devmem.rst | 270
1 file changed, 270 insertions(+)
create mode 100644 Documentation/networking/devmem.rst
diff --git a/Documentation/networking/devmem.rst
b/Documentation/networking/devmem.rst
new file mode
On Thu, Dec 7, 2023 at 4:52 PM Mina Almasry wrote:
>
> Major changes in v1:
> --
>
> 1. Implemented MVP queue API ndos to remove the userspace-visible
>driver reset.
>
> 2. Fixed issues in the napi_pp_put_page() devmem frag unref path.
>
> 3. Rem
On Fri, Dec 8, 2023 at 1:30 AM Yunsheng Lin wrote:
>
>
> As mentioned before, it seems we need to have the above checking every
> time we need to do some per-page handling in page_pool core, is there
> a plan in your mind how to remove those kind of checking in the future?
>
I see 2 ways to remov
On Fri, Dec 8, 2023 at 9:48 AM David Ahern wrote:
>
> On 12/7/23 5:52 PM, Mina Almasry wrote:
...
> > +
> > + xa_for_each(&binding->bound_rxq_list, xa_idx, rxq) {
> > + if (rxq->binding == binding) {
> > + /* We ho
On Fri, Dec 8, 2023 at 9:55 AM David Ahern wrote:
>
> On 12/7/23 5:52 PM, Mina Almasry wrote:
> > 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 MSG_SOCK_DEVMEM
> > flag - pass it to
On Fri, Dec 8, 2023 at 9:56 AM David Ahern wrote:
>
> On 12/7/23 5:52 PM, Mina Almasry wrote:
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index b8c8be5a912e..30667e4c3b95 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> &g
On Fri, Dec 8, 2023 at 9:57 AM David Ahern wrote:
>
> On 12/7/23 5:52 PM, Mina Almasry wrote:
> > Major changes in v1:
> > --
> >
> > 1. Implemented MVP queue API ndos to remove the userspace-visible
> >driver reset.
> >
> > 2. Fi
On Fri, Dec 8, 2023 at 11:22 AM Mina Almasry wrote:
>
> On Fri, Dec 8, 2023 at 9:48 AM David Ahern wrote:
> >
> > On 12/7/23 5:52 PM, Mina Almasry wrote:
> ...
> > > +
> > > + xa_for_each(&binding->bound_rxq_list, xa_idx, rxq) {
&
On Fri, Dec 8, 2023 at 2:56 PM Pavel Begunkov wrote:
>
> On 12/8/23 00:52, Mina Almasry wrote:
...
> > + if (pool->p.queue)
> > + binding = READ_ONCE(pool->p.queue->binding);
> > +
> > + if (binding) {
> > + pool->mp_
On Sat, Dec 9, 2023 at 3:29 PM David Ahern wrote:
>
> On 12/8/23 12:22 PM, Mina Almasry wrote:
> > On Fri, Dec 8, 2023 at 9:48 AM David Ahern wrote:
> >>
> >> On 12/7/23 5:52 PM, Mina Almasry wrote:
> > ...
> >>> +
> >>
On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin wrote:
>
> On 2023/12/9 0:05, Mina Almasry wrote:
> > On Fri, Dec 8, 2023 at 1:30 AM Yunsheng Lin wrote:
> >>
> >>
> >> As mentioned before, it seems we need to have the above checking every
> >> time w
On Sat, Dec 9, 2023 at 7:05 PM Pavel Begunkov wrote:
>
> On 12/8/23 23:25, Mina Almasry wrote:
> > On Fri, Dec 8, 2023 at 2:56 PM Pavel Begunkov
> > wrote:
> >>
> >> On 12/8/23 00:52, Mina Almasry wrote:
> > ...
> >>> + if (pool-
On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote:
>
> On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin wrote:
> >
> > On 2023/12/9 0:05, Mina Almasry wrote:
> > > On Fri, Dec 8, 2023 at 1:30 AM Yunsheng Lin
> > > wrote:
> > >>
> > >>
&g
On Mon, Dec 11, 2023 at 3:51 AM Yunsheng Lin wrote:
>
> On 2023/12/11 12:04, Mina Almasry wrote:
> > On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote:
> >>
> >> On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin
> >> wrote:
> >>>
> >>&
On Tue, Dec 12, 2023 at 4:25 AM Jason Gunthorpe wrote:
>
> On Thu, Dec 07, 2023 at 04:52:39PM -0800, Mina Almasry wrote:
>
> > +static inline struct page_pool_iov *page_to_page_pool_iov(struct page
> > *page)
> > +{
> > + if (page_is_page_pool_iov(page))
On Tue, Dec 12, 2023 at 3:17 AM Yunsheng Lin wrote:
>
> On 2023/12/12 2:14, Mina Almasry wrote:
> > On Mon, Dec 11, 2023 at 3:51 AM Yunsheng Lin wrote:
> >>
> >> On 2023/12/11 12:04, Mina Almasry wrote:
> >>> On Sun, Dec 10, 2023 at 6:26 PM Mina Almasr
On Tue, Dec 12, 2023 at 12:07 AM Ilias Apalodimas
wrote:
>
> Hi Mina,
>
> Apologies for not participating in the party earlier.
>
No worries, thanks for looking.
> On Fri, 8 Dec 2023 at 02:52, Mina Almasry wrote:
> >
> > From: Jakub Kicinski
> >
> >
On Tue, Dec 12, 2023 at 6:39 AM Jason Gunthorpe wrote:
>
> On Tue, Dec 12, 2023 at 06:26:51AM -0800, Mina Almasry wrote:
> > On Tue, Dec 12, 2023 at 4:25 AM Jason Gunthorpe wrote:
> > >
> > > On Thu, Dec 07, 2023 at 04:52:39PM -0800, Mina Almasry wrote:
>
On Tue, Dec 12, 2023 at 7:08 AM Jason Gunthorpe wrote:
>
> On Tue, Dec 12, 2023 at 06:58:17AM -0800, Mina Almasry wrote:
>
> > Jason, we set the LSB on page_pool_iov pointers before casting it to
> > struct page pointers. The resulting pointers are not useable as page
>
On Sun, Dec 10, 2023 at 8:04 PM Mina Almasry wrote:
>
> On Sun, Dec 10, 2023 at 6:26 PM Mina Almasry wrote:
> >
> > On Sun, Dec 10, 2023 at 6:04 PM Yunsheng Lin wrote:
> > >
> > > On 2023/12/9 0:05, Mina Almasry wrote:
> > > > On Fri, Dec
On Wed, Dec 13, 2023 at 10:49 PM Christoph Hellwig wrote:
>
> On Thu, Dec 14, 2023 at 06:20:27AM +, patchwork-bot+netdev...@kernel.org
> wrote:
> > Hello:
> >
> > This series was applied to netdev/net-next.git (main)
> > by Jakub Kicinski :
>
> Umm, this is still very broken in intraction wit
On Mon, Dec 11, 2023 at 12:37 PM Pavel Begunkov wrote:
...
> >> If you remove the branch, let it fall into ->release and rely
> >> on refcounting there, then the callback could also fix up
> >> release_cnt or ask pp to do it, like in the patch I linked above
> >>
> >
> > Sadly I don't think this i
n Kaligineedi
Jakub Kicinski (1):
net: page_pool: create hooks for custom page providers
Mina Almasry (13):
net: page_pool: factor out page_pool recycle check
net: netdev netlink api to bind dma-buf to a net device
netdev: support binding dma-buf to netdevice
netdev: netdevice devm
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
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 45bb4210412d..0edb9251d98d 100644
--- a
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
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 v5:
- Renamed page_pool_iov to net_iov, and m
ff-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
v1:
- Rename devmem -> dmabuf (David).
---
include/net/devmem.h | 12
include/net/netmem.h | 26 ++
net/core/dev.c | 38 ++
ge 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
---
include/linux/skbuff.h | 4 +-
include/net/netmem.h | 15 ++
include/net/page_pool/helpers.h | 106
include/net/page_pool/ty
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
---
RFCv5:
- Use netmem instead of page* with LSB set.
- Use pp_ref_count for refcounting net_iov.
is omitted for simplicity & p.order !=
0.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: Mina Almasry
---
v2:
- Disable devmem for p.order != 0
v1:
- static_branch check in page_is_page_pool_iov() (Willem & Paolo).
- PP_DEVMEM -> PP_IOV (Dav
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
---
Changes in v1:
- Fix illegal_highdma() (Yunsheng).
- Rework napi_pp_put_page() slightly to reduce code churn (Willem).
(cherry
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
---
Changes in v1:
- Rename devmem -> dmabuf (David).
- Flip skb_frags_not_readable (Jakub).
---
include/linux/skbu
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
--
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 re-use.
Signed-off-by: Willem de Bruijn
Signed-off-by: Kaiyuan Zhang
Signed-off-by: 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
, 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
---
Changes in v1:
- Many more general cleanups (Willem).
- Removed driver reset (Jakub).
- Removed
On Tue, Feb 13, 2024 at 5:24 AM Pavel Begunkov wrote:
>
> On 12/18/23 02:40, Mina Almasry wrote:
> > Implement netdev devmem allocator. The allocator takes a given struct
> > netdev_dmabuf_binding as input and allocates net_iov from that
> > binding.
> >
> > Th
On Tue, Feb 13, 2024 at 5:28 AM Pavel Begunkov wrote:
>
> On 12/18/23 02:40, 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.
p; flow steering support.
Cc: Pavel Begunkov
Cc: David Wei
Cc: Jason Gunthorpe
Cc: Yunsheng Lin
Cc: Shailend Chand
Cc: Harshitha Ramamurthy
Cc: Shakeel Butt
Cc: Jeroen de Borst
Cc: Praveen Kaligineedi
Jakub Kicinski (1):
net: page_pool: create hooks for custom page providers
Mina Almasry (14
This API enables the net stack to reset the queues used for devmem.
Signed-off-by: Mina Almasry
---
include/linux/netdevice.h | 24
1 file changed, 24 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c41019f34179..3105c586355d
1 - 100 of 462 matches
Mail list logo