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-prev] [day] [month] [year] [list]
Message-ID:
 <SJ2PR21MB4013DD021CE6EE505366E83DCA5FA@SJ2PR21MB4013.namprd21.prod.outlook.com>
Date: Wed, 23 Jul 2025 19:55:49 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Dipayaan Roy <dipayanroy@...ux.microsoft.com>, "horms@...nel.org"
	<horms@...nel.org>, "kuba@...nel.org" <kuba@...nel.org>, KY Srinivasan
	<kys@...rosoft.com>, "wei.liu@...nel.org" <wei.liu@...nel.org>, Dexuan Cui
	<decui@...rosoft.com>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
	"davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
	<edumazet@...gle.com>, "pabeni@...hat.com" <pabeni@...hat.com>, Long Li
	<longli@...rosoft.com>, Konstantin Taranov <kotaranov@...rosoft.com>,
	"ast@...nel.org" <ast@...nel.org>, "daniel@...earbox.net"
	<daniel@...earbox.net>, "hawk@...nel.org" <hawk@...nel.org>,
	"john.fastabend@...il.com" <john.fastabend@...il.com>, "sdf@...ichev.me"
	<sdf@...ichev.me>, "lorenzo@...nel.org" <lorenzo@...nel.org>,
	"michal.kubiak@...el.com" <michal.kubiak@...el.com>,
	"ernis@...ux.microsoft.com" <ernis@...ux.microsoft.com>,
	"shradhagupta@...ux.microsoft.com" <shradhagupta@...ux.microsoft.com>, Shiraz
 Saleem <shirazsaleem@...rosoft.com>, "rosenp@...il.com" <rosenp@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
	"bpf@...r.kernel.org" <bpf@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "ssengar@...ux.microsoft.com"
	<ssengar@...ux.microsoft.com>, Dipayaan Roy <dipayanroy@...rosoft.com>
Subject: RE: [PATCH v2] net: mana: Use page pool fragments for RX buffers
 instead of full pages to improve memory efficiency.



> -----Original Message-----
> From: Dipayaan Roy <dipayanroy@...ux.microsoft.com>
> Sent: Wednesday, July 23, 2025 3:07 PM
> To: horms@...nel.org; kuba@...nel.org; KY Srinivasan <kys@...rosoft.com>;
> Haiyang Zhang <haiyangz@...rosoft.com>; wei.liu@...nel.org; Dexuan Cui
> <decui@...rosoft.com>; andrew+netdev@...n.ch; davem@...emloft.net;
> edumazet@...gle.com; pabeni@...hat.com; Long Li <longli@...rosoft.com>;
> Konstantin Taranov <kotaranov@...rosoft.com>; ast@...nel.org;
> daniel@...earbox.net; hawk@...nel.org; john.fastabend@...il.com;
> sdf@...ichev.me; lorenzo@...nel.org; michal.kubiak@...el.com;
> ernis@...ux.microsoft.com; shradhagupta@...ux.microsoft.com; Shiraz Saleem
> <shirazsaleem@...rosoft.com>; rosenp@...il.com; netdev@...r.kernel.org;
> linux-hyperv@...r.kernel.org; linux-rdma@...r.kernel.org;
> bpf@...r.kernel.org; linux-kernel@...r.kernel.org;
> ssengar@...ux.microsoft.com; Dipayaan Roy <dipayanroy@...rosoft.com>
> Subject: [PATCH v2] net: mana: Use page pool fragments for RX buffers
> instead of full pages to improve memory efficiency.
> 
> This patch enhances RX buffer handling in the mana driver by allocating
> pages from a page pool and slicing them into MTU-sized fragments, rather
> than dedicating a full page per packet. This approach is especially
> beneficial on systems with large page sizes like 64KB.
> 
> Key improvements:
> 
> - Proper integration of page pool for RX buffer allocations.
> - MTU-sized buffer slicing to improve memory utilization.
> - Reduce overall per Rx queue memory footprint.
> - Automatic fallback to full-page buffers when:
>    * Jumbo frames are enabled (MTU > PAGE_SIZE / 2).
>    * The XDP path is active, to avoid complexities with fragment reuse.
> - Removal of redundant pre-allocated RX buffers used in scenarios like MTU
>   changes, ensuring consistency in RX buffer allocation.
> 
> Testing on VMs with 64KB pages shows around 200% throughput improvement.
> Memory efficiency is significantly improved due to reduced wastage in page
> allocations. Example: We are now able to fit 35 rx buffers in a single
> 64kb
> page for MTU size of 1500, instead of 1 rx buffer per page previously.
> 
> Tested:
> 
> - iperf3, iperf2, and nttcp benchmarks.
> - Jumbo frames with MTU 9000.
> - Native XDP programs (XDP_PASS, XDP_DROP, XDP_TX, XDP_REDIRECT) for
>   testing the XDP path in driver.
> - Page leak detection (kmemleak).
> - Driver load/unload, reboot, and stress scenarios.
> 
> Signed-off-by: Dipayaan Roy <dipayanroy@...ux.microsoft.com>
> 
> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Reviewed-by: Saurabh Sengar <ssengar@...ux.microsoft.com>

Reviewed-by: Haiyang Zhang <haiyangz@...rosoft.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ