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: <20241212181129.7156d39b@kernel.org>
Date: Thu, 12 Dec 2024 18:11:29 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann
 <daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>, Andrii
 Nakryiko <andrii@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Josh
 Poimboeuf <jpoimboe@...nel.org>, "Jose E. Marchesi"
 <jose.marchesi@...cle.com>, Toke Høiland-Jørgensen
 <toke@...hat.com>, Magnus Karlsson <magnus.karlsson@...el.com>, Maciej
 Fijalkowski <maciej.fijalkowski@...el.com>, Przemek Kitszel
 <przemyslaw.kitszel@...el.com>, Jason Baron <jbaron@...mai.com>, Casey
 Schaufler <casey@...aufler-ca.com>, Nathan Chancellor <nathan@...nel.org>,
 nex.sw.ncis.osdt.itp.upstreaming@...el.com, bpf@...r.kernel.org,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 05/12] xdp: add generic
 xdp_build_skb_from_buff()

On Wed, 11 Dec 2024 18:26:42 +0100 Alexander Lobakin wrote:
> +	if (rxq->mem.type == MEM_TYPE_PAGE_POOL && is_page_pool_compiled_in())
> +		skb_mark_for_recycle(skb);

I feel like the check for mem.type is unnecessary. I can't think of 
a driver that would build a skb out of pp pages, and not own pp
refs on those pages. Setting pp_recycle on non-pp skb should be safe,
even if slightly wasteful.

Also:

static inline void skb_mark_for_recycle(struct sk_buff *skb)
{
#ifdef CONFIG_PAGE_POOL
	skb->pp_recycle = 1;
#endif
}

You don't have to check if PP is complied in explicitly.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ