netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next v1 0/4] Abstract page from net stack
@ 2023-12-14  2:05 Mina Almasry
  2023-12-14  2:05 ` [RFC PATCH net-next v1 1/4] vsock/virtio: use skb_frag_page() helper Mina Almasry
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Mina Almasry @ 2023-12-14  2:05 UTC (permalink / raw)
  To: linux-kernel, netdev, bpf
  Cc: Mina Almasry, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Greg Kroah-Hartman,
	Rafael J. Wysocki, Sumit Semwal, Christian König,
	Michael Chan, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Wei Fang, Shenwei Wang,
	Clark Wang, NXP Linux Team, Jeroen de Borst, Praveen Kaligineedi,
	Shailend Chand, Yisen Zhuang, Salil Mehta, Jesse Brandeburg,
	Tony Nguyen, Thomas Petazzoni, Marcin Wojtas, Russell King,
	Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
	Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	Lorenzo Bianconi, Matthias Brugger, AngeloGioacchino Del Regno,
	Saeed Mahameed, Leon Romanovsky, Horatiu Vultur, UNGLinuxDriver,
	K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Jassi Brar,
	Ilias Apalodimas, Alexandre Torgue, Jose Abreu, Maxime Coquelin,
	Siddharth Vadapalli, Ravi Gunasekaran, Roger Quadros, Jiawen Wu,
	Mengyuan Lou, Ronak Doshi, VMware PV-Drivers Reviewers, Ryder Lee,
	Shayne Chen, Kalle Valo, Juergen Gross, Stefano Stabellini,
	Oleksandr Tyshchenko, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Stefan Hajnoczi, Stefano Garzarella, Shuah Khan,
	Mickaël Salaün, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Justin Stitt, Jason Gunthorpe, Shakeel Butt,
	Yunsheng Lin, Willem de Bruijn

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 (4):
  vsock/virtio: use skb_frag_page() helper
  net: introduce abstraction for network memory
  net: add netmem_t to skb_frag_t
  net: page_pool: use netmem_t instead of struct page in API

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 15 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |  8 ++-
 drivers/net/ethernet/engleder/tsnep_main.c    | 22 +++---
 drivers/net/ethernet/freescale/fec_main.c     | 33 ++++++---
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 14 ++--
 drivers/net/ethernet/intel/idpf/idpf_txrx.c   |  2 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.h   | 15 ++--
 drivers/net/ethernet/marvell/mvneta.c         | 24 ++++---
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 18 +++--
 .../marvell/octeontx2/nic/otx2_common.c       |  8 ++-
 drivers/net/ethernet/mediatek/mtk_eth_soc.c   | 22 +++---
 .../net/ethernet/mellanox/mlx5/core/en/xdp.c  | 27 ++++---
 .../net/ethernet/mellanox/mlx5/core/en_rx.c   | 28 ++++----
 .../ethernet/microchip/lan966x/lan966x_fdma.c | 16 +++--
 drivers/net/ethernet/microsoft/mana/mana_en.c | 10 +--
 drivers/net/ethernet/socionext/netsec.c       | 25 ++++---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 48 ++++++++-----
 drivers/net/ethernet/ti/cpsw.c                | 11 +--
 drivers/net/ethernet/ti/cpsw_new.c            | 11 +--
 drivers/net/ethernet/ti/cpsw_priv.c           | 12 ++--
 drivers/net/ethernet/wangxun/libwx/wx_lib.c   | 18 +++--
 drivers/net/veth.c                            |  5 +-
 drivers/net/vmxnet3/vmxnet3_drv.c             |  7 +-
 drivers/net/vmxnet3/vmxnet3_xdp.c             | 20 +++---
 drivers/net/wireless/mediatek/mt76/dma.c      |  4 +-
 drivers/net/wireless/mediatek/mt76/mt76.h     |  5 +-
 .../net/wireless/mediatek/mt76/mt7915/mmio.c  |  4 +-
 drivers/net/xen-netfront.c                    |  4 +-
 include/linux/skbuff.h                        | 11 ++-
 include/net/netmem.h                          | 35 +++++++++
 include/net/page_pool/helpers.h               | 72 ++++++++++---------
 include/net/page_pool/types.h                 |  9 +--
 net/bpf/test_run.c                            |  2 +-
 net/core/page_pool.c                          | 39 +++++-----
 net/core/skbuff.c                             |  2 +-
 net/core/xdp.c                                |  3 +-
 net/kcm/kcmsock.c                             |  9 ++-
 net/vmw_vsock/virtio_transport.c              |  2 +-
 38 files changed, 381 insertions(+), 239 deletions(-)
 create mode 100644 include/net/netmem.h

-- 
2.43.0.472.g3155946c3a-goog


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-01-05  8:40 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14  2:05 [RFC PATCH net-next v1 0/4] Abstract page from net stack Mina Almasry
2023-12-14  2:05 ` [RFC PATCH net-next v1 1/4] vsock/virtio: use skb_frag_page() helper Mina Almasry
2023-12-14  6:27   ` David Ahern
2023-12-14  8:19   ` Stefano Garzarella
2023-12-14  2:05 ` [RFC PATCH net-next v1 2/4] net: introduce abstraction for network memory Mina Almasry
2023-12-14  6:34   ` David Ahern
2023-12-16  2:51   ` Jakub Kicinski
2023-12-16 22:10     ` Mina Almasry
2023-12-17  1:45       ` David Ahern
2023-12-17  8:14         ` Mina Almasry
2023-12-18 22:06           ` Jakub Kicinski
2023-12-18 22:38             ` Mina Almasry
2023-12-19 17:27               ` Shakeel Butt
2023-12-14  2:05 ` [RFC PATCH net-next v1 3/4] net: add netmem_t to skb_frag_t Mina Almasry
2023-12-14  2:05 ` [RFC PATCH net-next v1 4/4] net: page_pool: use netmem_t instead of struct page in API Mina Almasry
2023-12-14 12:05   ` Yunsheng Lin
2023-12-14 16:27     ` Mina Almasry
2023-12-15  2:11       ` Shakeel Butt
2023-12-15 11:04         ` Yunsheng Lin
2023-12-15 16:47           ` Shakeel Butt
2023-12-16  3:01         ` Jakub Kicinski
2023-12-16 19:46           ` Shakeel Butt
2023-12-16 22:06             ` Mina Almasry
2023-12-20  3:01               ` Mina Almasry
2023-12-21 11:32                 ` Yunsheng Lin
2023-12-21 21:22                   ` Mina Almasry
2023-12-22  6:42                     ` Yunsheng Lin
2024-01-02 16:14                       ` Mina Almasry
2024-01-03  9:47                         ` Yunsheng Lin
2024-01-03 18:38                           ` Mina Almasry
2024-01-04  8:48                             ` Yunsheng Lin
2024-01-04 18:24                               ` Mina Almasry
2024-01-05  8:40                                 ` Yunsheng Lin

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