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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813164847.62ade421@kernel.org>
Date: Wed, 13 Aug 2025 16:48:47 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Dipayaan Roy <dipayanroy@...ux.microsoft.com>
Cc: horms@...nel.org, kys@...rosoft.com, haiyangz@...rosoft.com,
 wei.liu@...nel.org, decui@...rosoft.com, andrew+netdev@...n.ch,
 davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
 longli@...rosoft.com, 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,
 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, dipayanroy@...rosoft.com
Subject: Re: [PATCH net-next v4] net: mana: Use page pool fragments for RX
 buffers instead of full pages to improve memory efficiency.

On Mon, 11 Aug 2025 15:29:19 -0700 Dipayaan Roy wrote:
> -	if (apc->port_is_up)
> +	if (apc->port_is_up) {
> +		/* Re-create rxq's after xdp prog was loaded or unloaded.
> +		 * Ex: re create rxq's to switch from full pages to smaller
> +		 * size page fragments when xdp prog is unloaded and
> +		 * vice-versa.
> +		 */
> +
> +		/* Pre-allocate buffers to prevent failure in mana_attach */
> +		err = mana_pre_alloc_rxbufs(apc, ndev->mtu, apc->num_queues);
> +		if (err) {
> +			NL_SET_ERR_MSG_MOD
> +			    (extack,
> +			    "XDP: Insufficient memory for tx/rx re-config");

This weird line breaking is not necessary, checkpatch understands that
string can go over line limit:

			NL_SET_ERR_MSG_MOD(extack,
					   "XDP: Insufficient memory for tx/rx re-config");

> +			return err;

I think you already replaced the bpf program at this point? 
So the allocation should happen earlier. On failure changes
to the driver state should be undone.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ