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: <e1093991-6f54-2c8d-c713-babac0d216d4@intel.com>
Date:   Wed, 2 Aug 2023 18:44:00 -0700
From:   Jesse Brandeburg <jesse.brandeburg@...el.com>
To:     Haiyang Zhang <haiyangz@...rosoft.com>,
        <linux-hyperv@...r.kernel.org>, <netdev@...r.kernel.org>
CC:     <decui@...rosoft.com>, <kys@...rosoft.com>,
        <paulros@...rosoft.com>, <olaf@...fle.de>, <vkuznets@...hat.com>,
        <davem@...emloft.net>, <wei.liu@...nel.org>, <edumazet@...gle.com>,
        <kuba@...nel.org>, <pabeni@...hat.com>, <leon@...nel.org>,
        <longli@...rosoft.com>, <ssengar@...ux.microsoft.com>,
        <linux-rdma@...r.kernel.org>, <daniel@...earbox.net>,
        <john.fastabend@...il.com>, <bpf@...r.kernel.org>,
        <ast@...nel.org>, <sharmaajay@...rosoft.com>, <hawk@...nel.org>,
        <tglx@...utronix.de>, <shradhagupta@...ux.microsoft.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V5,net-next] net: mana: Add page pool for RX buffers

On 8/2/2023 11:07 AM, Haiyang Zhang wrote:
> Add page pool for RX buffers for faster buffer cycle and reduce CPU
> usage.
> 
> The standard page pool API is used.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
> ---
> V5:
> In err path, set page_pool_put_full_page(..., false) as suggested by
> Jakub Kicinski
> V4:
> Add nid setting, remove page_pool_nid_changed(), as suggested by
> Jesper Dangaard Brouer
> V3:
> Update xdp mem model, pool param, alloc as suggested by Jakub Kicinski
> V2:
> Use the standard page pool API as suggested by Jesper Dangaard Brouer
> ---

> diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> index 024ad8ddb27e..b12859511839 100644
> --- a/include/net/mana/mana.h
> +++ b/include/net/mana/mana.h
> @@ -280,6 +280,7 @@ struct mana_recv_buf_oob {
>  	struct gdma_wqe_request wqe_req;
>  
>  	void *buf_va;
> +	bool from_pool; /* allocated from a page pool */

suggest you use flags and not bools, as bools waste 7 bits each, plus
your packing of this struct will be full of holes, made worse by this
patch. (see pahole tool)


>  
>  	/* SGL of the buffer going to be sent has part of the work request. */
>  	u32 num_sge;
> @@ -330,6 +331,8 @@ struct mana_rxq {
>  	bool xdp_flush;
>  	int xdp_rc; /* XDP redirect return code */
>  
> +	struct page_pool *page_pool;
> +
>  	/* MUST BE THE LAST MEMBER:
>  	 * Each receive buffer has an associated mana_recv_buf_oob.
>  	 */


The rest of the patch looks ok and is remarkably compact for a
conversion to page pool. I'd prefer someone with more page pool exposure
review this for correctness, but FWIW

Reviewed-by: Jesse Brandeburg <jesse.brandeburg@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ