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: <ZxEH7/+6sSSTCHIK@boxer>
Date: Thu, 17 Oct 2024 14:49:51 +0200
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, Toke Høiland-Jørgensen
	<toke@...hat.com>, Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann
	<daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>, "Andrii
 Nakryiko" <andrii@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>, "Magnus
 Karlsson" <magnus.karlsson@...el.com>,
	<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 v2 13/18] xsk: allow attaching XSk pool via
 xdp_rxq_info_reg_mem_model()

On Tue, Oct 15, 2024 at 04:53:45PM +0200, Alexander Lobakin wrote:
> When you register an XSk pool as XDP Rxq info memory model, you then
> need to manually attach it after the registration.
> Let the user combine both actions into one by just passing a pointer
> to the pool directly to xdp_rxq_info_reg_mem_model(), which will take
> care of calling xsk_pool_set_rxq_info(). This looks similar to how a
> &page_pool gets registered and reduce repeating driver code.
> 
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@...el.com>

Makes sense, but why not address callsites in drivers while at it?
Otherwise in case this would be merged this would be called twice. Not a
big deal though.

Acked-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>

> ---
>  net/core/xdp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/core/xdp.c b/net/core/xdp.c
> index 9dc103a09b5c..371c26c203b2 100644
> --- a/net/core/xdp.c
> +++ b/net/core/xdp.c
> @@ -358,6 +358,9 @@ int xdp_rxq_info_reg_mem_model(struct xdp_rxq_info *xdp_rxq,
>  	if (IS_ERR(xdp_alloc))
>  		return PTR_ERR(xdp_alloc);
>  
> +	if (type == MEM_TYPE_XSK_BUFF_POOL && allocator)
> +		xsk_pool_set_rxq_info(allocator, xdp_rxq);
> +
>  	if (trace_mem_connect_enabled() && xdp_alloc)
>  		trace_mem_connect(xdp_alloc, xdp_rxq);
>  	return 0;
> -- 
> 2.46.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ