From: Mina Almasry <almasrymina@google.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: "Mina Almasry" <almasrymina@google.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Jason Gunthorpe" <jgg@nvidia.com>,
"Christian König" <christian.koenig@amd.com>,
"Shakeel Butt" <shakeelb@google.com>,
"Yunsheng Lin" <linyunsheng@huawei.com>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>
Subject: [PATCH net-next v8 0/2] Abstract page from net stack
Date: Wed, 14 Feb 2024 14:34:01 -0800 [thread overview]
Message-ID: <20240214223405.1972973-1-almasrymina@google.com> (raw)
Changes in v8:
- Moved back skb_add_rx_frag_netmem to .c file (Paolo).
- Applied Paolo's Acked-by.
-----------
Changes in v7;
- Addressed comments from Paolo.
- Moved skb_add_rx_frag* to header file.
- Moved kcmsock.c check.
-----------
Changes in v6:
- Non-RFC as net-next opened.
- static_assert skb_frag_t compatibility with bio_vec.
-----------
Changes in RFC v5:
- RFC due to merge window
- Changed netmem to __bitwise unsigned long.
-----------
Changes in v4:
- Forked off the trivial fixes to skb_frag_t field access to their own
patches and changed this to RFC that depends on these fixes:
https://lore.kernel.org/netdev/20240102205905.793738-1-almasrymina@google.com/T/#u
https://lore.kernel.org/netdev/20240102205959.794513-1-almasrymina@google.com/T/#u
- Use an empty struct for netmem instead of void* __bitwise as that's
not a correct use of __bitwise.
-----------
Changes in v3:
- Replaced the struct netmem union with an opaque netmem_ref type.
- Added func docs to the netmem helpers and type.
- Renamed the skb_frag_t fields since it's no longer a bio_vec
-----------
Changes in v2:
- Reverted changes to the page_pool. The page pool now retains the same
API, so that we don't have to touch many existing drivers. The devmem
TCP series will include the changes to the page pool.
- Addressed comments.
This series is a prerequisite to the devmem TCP series. For a full
snapshot of the code which includes these changes, feel free to check:
https://github.com/mina/linux/commits/tcpdevmem-rfcv5/
-----------
Currently these components in the net stack use the struct page
directly:
1. Drivers.
2. Page pool.
3. skb_frag_t.
To add support for new (non struct page) memory types to the net stack, we
must first abstract the current memory type.
Originally the plan was to reuse struct page* for the new memory types,
and to set the LSB on the page* to indicate it's not really a page.
However, for safe compiler type checking we need to introduce a new type.
struct netmem is introduced to abstract the underlying memory type.
Currently it's a no-op abstraction that is always a struct page underneath.
In parallel there is an undergoing effort to add support for devmem to the
net stack:
https://lore.kernel.org/netdev/20231208005250.2910004-1-almasrymina@google.com/
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Yunsheng Lin <linyunsheng@huawei.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Mina Almasry (2):
net: introduce abstraction for network memory
net: add netmem to skb_frag_t
include/linux/skbuff.h | 100 +++++++++++++++++++++++++++++------------
include/net/netmem.h | 41 +++++++++++++++++
net/core/skbuff.c | 34 +++++++++++---
net/kcm/kcmsock.c | 7 +--
4 files changed, 143 insertions(+), 39 deletions(-)
create mode 100644 include/net/netmem.h
--
2.43.0.687.g38aa6559b0-goog
next reply other threads:[~2024-02-14 22:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 22:34 Mina Almasry [this message]
2024-02-14 22:34 ` [PATCH net-next v8 1/2] net: introduce abstraction for network memory Mina Almasry
2024-02-14 22:34 ` [PATCH net-next v8 2/2] net: add netmem to skb_frag_t Mina Almasry
2024-02-20 8:40 ` [PATCH net-next v8 0/2] Abstract page from net stack patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240214223405.1972973-1-almasrymina@google.com \
--to=almasrymina@google.com \
--cc=christian.koenig@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jgg@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shakeelb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).