Skip to content

Abstract page from net stack

Mina Almasry lkml netdev 9 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 0 repliesApplied 2/2
  2. v72 patches 2 repliesSuperseded
  3. v62 patches 4 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v5 RFC2 patches17 repliesSuperseded
v4 RFC2 patches1 replySuperseded
v3 posting 2/21 patch0 repliesApplied 1/1
v3 posting 1/23 patches12 repliesSuperseded
v23 patches2 repliesSuperseded
v1 RFC4 patches28 repliesSuperseded

Changes in v8 from the cover letter

- Moved back skb_add_rx_frag_netmem to .c file (Paolo).
- Applied Paolo's Acked-by.

Patches in v8 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: introduce abstraction for network memoryinclude/net/netmem.h+41 -00 repliesApplied
2/2net: add netmem to skb_frag_tinclude/linux/skbuff.h net/core/skbuff.c net/kcm/kcmsock.c+102 -390 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchShakeel ButtPaolo Abeni
1/2R-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH net-next v8 0/2] Abstract page from net stack

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/[email protected]/T/#u
https://lore.kernel.org/netdev/[email protected]/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/[email protected]/

Cc Jason Gunthorpe <[email protected]>
Cc Christian König <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Yunsheng Lin <[email protected]>
Cc Willem de Bruijn <[email protected]>

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
Signature · 1 line
2.43.0.687.g38aa6559b0-goog