lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231214020530.2267499-1-almasrymina@google.com>
Date: Wed, 13 Dec 2023 18:05:23 -0800
From: Mina Almasry <almasrymina@...gle.com>
To: linux-kernel@...r.kernel.org, netdev@...r.kernel.org, bpf@...r.kernel.org
Cc: Mina Almasry <almasrymina@...gle.com>, Thomas Gleixner <tglx@...utronix.de>, 
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, 
	"H. Peter Anvin" <hpa@...or.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	"Rafael J. Wysocki" <rafael@...nel.org>, Sumit Semwal <sumit.semwal@...aro.org>, 
	"Christian König" <christian.koenig@....com>, Michael Chan <michael.chan@...adcom.com>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Alexei Starovoitov <ast@...nel.org>, 
	Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard Brouer <hawk@...nel.org>, 
	John Fastabend <john.fastabend@...il.com>, Wei Fang <wei.fang@....com>, 
	Shenwei Wang <shenwei.wang@....com>, Clark Wang <xiaoning.wang@....com>, 
	NXP Linux Team <linux-imx@....com>, Jeroen de Borst <jeroendb@...gle.com>, 
	Praveen Kaligineedi <pkaligineedi@...gle.com>, Shailend Chand <shailend@...gle.com>, 
	Yisen Zhuang <yisen.zhuang@...wei.com>, Salil Mehta <salil.mehta@...wei.com>, 
	Jesse Brandeburg <jesse.brandeburg@...el.com>, Tony Nguyen <anthony.l.nguyen@...el.com>, 
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>, Marcin Wojtas <mw@...ihalf.com>, 
	Russell King <linux@...linux.org.uk>, Sunil Goutham <sgoutham@...vell.com>, 
	Geetha sowjanya <gakula@...vell.com>, Subbaraya Sundeep <sbhatta@...vell.com>, 
	hariprasad <hkelam@...vell.com>, Felix Fietkau <nbd@....name>, John Crispin <john@...ozen.org>, 
	Sean Wang <sean.wang@...iatek.com>, Mark Lee <Mark-MC.Lee@...iatek.com>, 
	Lorenzo Bianconi <lorenzo@...nel.org>, Matthias Brugger <matthias.bgg@...il.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
	Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>, 
	Horatiu Vultur <horatiu.vultur@...rochip.com>, UNGLinuxDriver@...rochip.com, 
	"K. Y. Srinivasan" <kys@...rosoft.com>, Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, 
	Dexuan Cui <decui@...rosoft.com>, Jassi Brar <jaswinder.singh@...aro.org>, 
	Ilias Apalodimas <ilias.apalodimas@...aro.org>, 
	Alexandre Torgue <alexandre.torgue@...s.st.com>, Jose Abreu <joabreu@...opsys.com>, 
	Maxime Coquelin <mcoquelin.stm32@...il.com>, Siddharth Vadapalli <s-vadapalli@...com>, 
	Ravi Gunasekaran <r-gunasekaran@...com>, Roger Quadros <rogerq@...nel.org>, 
	Jiawen Wu <jiawenwu@...stnetic.com>, Mengyuan Lou <mengyuanlou@...-swift.com>, 
	Ronak Doshi <doshir@...are.com>, VMware PV-Drivers Reviewers <pv-drivers@...are.com>, 
	Ryder Lee <ryder.lee@...iatek.com>, Shayne Chen <shayne.chen@...iatek.com>, 
	Kalle Valo <kvalo@...nel.org>, Juergen Gross <jgross@...e.com>, 
	Stefano Stabellini <sstabellini@...nel.org>, 
	Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>, Andrii Nakryiko <andrii@...nel.org>, 
	Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>, 
	Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>, 
	Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>, 
	Stefan Hajnoczi <stefanha@...hat.com>, Stefano Garzarella <sgarzare@...hat.com>, Shuah Khan <shuah@...nel.org>, 
	"Mickaël Salaün" <mic@...ikod.net>, Nathan Chancellor <nathan@...nel.org>, 
	Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>, 
	Justin Stitt <justinstitt@...gle.com>, Jason Gunthorpe <jgg@...dia.com>, 
	Shakeel Butt <shakeelb@...gle.com>, Yunsheng Lin <linyunsheng@...wei.com>, 
	Willem de Bruijn <willemdebruijn.kernel@...il.com>
Subject: [RFC PATCH net-next v1 0/4] Abstract page from net stack

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@...dia.com>
Cc: Christian König <christian.koenig@....com>
Cc: Shakeel Butt <shakeelb@...gle.com>
Cc: Yunsheng Lin <linyunsheng@...wei.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ