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: <28f05bbe-78f6-408a-ae53-c40f6a86eed9@nvidia.com>
Date: Tue, 1 Oct 2024 11:22:32 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: Furong Xu <0x1207@...il.com>, Ong Boon Leong <boon.leong.ong@...el.com>,
 "David S. Miller" <davem@...emloft.net>,
 Alexandre Torgue <alexandre.torgue@...s.st.com>,
 Jose Abreu <joabreu@...opsys.com>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>, Joao Pinto <jpinto@...opsys.com>
Cc: netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 rmk+kernel@...linux.org.uk, linux@...linux.org.uk, xfr@...look.com,
 "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
 regressions@...ts.linux.dev, Thierry Reding <treding@...dia.com>
Subject: Re: [PATCH net v2] net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP
 is enabled

Hi Furong,

On 19/09/2024 13:10, Furong Xu wrote:
> Commit 5fabb01207a2 ("net: stmmac: Add initial XDP support") sets
> PP_FLAG_DMA_SYNC_DEV flag for page_pool unconditionally,
> page_pool_recycle_direct() will call page_pool_dma_sync_for_device()
> on every page even the page is not going to be reused by XDP program.
> 
> When XDP is not enabled, the page which holds the received buffer
> will be recycled once the buffer is copied into new SKB by
> skb_copy_to_linear_data(), then the MAC core will never reuse this
> page any longer. Always setting PP_FLAG_DMA_SYNC_DEV wastes CPU cycles
> on unnecessary calling of page_pool_dma_sync_for_device().
> 
> After this patch, up to 9% noticeable performance improvement was observed
> on certain platforms.
> 
> Fixes: 5fabb01207a2 ("net: stmmac: Add initial XDP support")
> Signed-off-by: Furong Xu <0x1207@...il.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index f3a1b179aaea..95d3d1081727 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -2022,7 +2022,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv,
>   	rx_q->queue_index = queue;
>   	rx_q->priv_data = priv;
>   
> -	pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
> +	pp_params.flags = PP_FLAG_DMA_MAP | (xdp_prog ? PP_FLAG_DMA_SYNC_DEV : 0);
>   	pp_params.pool_size = dma_conf->dma_rx_size;
>   	num_pages = DIV_ROUND_UP(dma_conf->dma_buf_sz, PAGE_SIZE);
>   	pp_params.order = ilog2(num_pages);


We have noticed a boot regression in both -next and mainline v6.12-rc1. 
Bisect is pointing to this commit. Reverting this commit fixes the problem.

This boot regression is seen on our Tegra234 Jetson AGX Orin platform 
that uses the drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c driver. 
We are booting with NFS and although the network interface does come up, 
we fail to mount the rootfs via NFS.

So it would appear that we need to set this flag for this device. Any 
thoughts?

Thanks
Jon

-- 
nvpublic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ