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: <20230413130428.GO17993@unreal>
Date:   Thu, 13 Apr 2023 16:04:28 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Haiyang Zhang <haiyangz@...rosoft.com>
Cc:     linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
        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, 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, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3,net-next, 2/4] net: mana: Refactor RX buffer
 allocation code to prepare for various MTU

On Wed, Apr 12, 2023 at 02:16:01PM -0700, Haiyang Zhang wrote:
> Move out common buffer allocation code from mana_process_rx_cqe() and
> mana_alloc_rx_wqe() to helper functions.
> Refactor related variables so they can be changed in one place, and buffer
> sizes are in sync.
> 
> Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
> ---
> V3:
> Refectored to multiple patches for readability. Suggested by Jacob Keller.
> 
> V2:
> Refectored to multiple patches for readability. Suggested by Yunsheng Lin.
> 
> ---
>  drivers/net/ethernet/microsoft/mana/mana_en.c | 154 ++++++++++--------
>  include/net/mana/mana.h                       |   6 +-
>  2 files changed, 91 insertions(+), 69 deletions(-)

<...>

> +static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev,
> +			     dma_addr_t *da, bool is_napi)
> +{
> +	struct page *page;
> +	void *va;
> +
> +	/* Reuse XDP dropped page if available */
> +	if (rxq->xdp_save_va) {
> +		va = rxq->xdp_save_va;
> +		rxq->xdp_save_va = NULL;
> +	} else {
> +		page = dev_alloc_page();

Documentation/networking/page_pool.rst
   10 Basic use involves replacing alloc_pages() calls with the
   11 page_pool_alloc_pages() call.  Drivers should use page_pool_dev_alloc_pages()
   12 replacing dev_alloc_pages().

General question, is this sentence applicable to all new code or only
for XDP related paths?

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ