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] [day] [month] [year] [list]
Message-ID: <20250122125755.GD390877@kernel.org>
Date: Wed, 22 Jan 2025 12:57:55 +0000
From: Simon Horman <horms@...nel.org>
To: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
Cc: wei.fang@....com, shenwei.wang@....com, xiaoning.wang@....com,
	andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, imx@...ts.linux.dev,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: fec: remove unnecessary DMA mapping of TSO
 header

On Wed, Jan 22, 2025 at 04:13:07PM +0530, Dheeraj Reddy Jonnalagadda wrote:
> The TSO header buffer is pre-allocated DMA memory, so there's no need to
> map it again with dma_map_single() in fec_enet_txq_put_hdr_tso(). Remove
> this redundant mapping operation.
> 
> Fixes: 79f339125ea3 ("net: fec: Add software TSO support")
> Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 68725506a095..039de4c5044e 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -805,15 +805,6 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq,
>  
>  		if (fep->quirks & FEC_QUIRK_SWAP_FRAME)
>  			swap_buffer(bufaddr, hdr_len);
> -
> -		dmabuf = dma_map_single(&fep->pdev->dev, bufaddr,
> -					hdr_len, DMA_TO_DEVICE);
> -		if (dma_mapping_error(&fep->pdev->dev, dmabuf)) {
> -			dev_kfree_skb_any(skb);
> -			if (net_ratelimit())
> -				netdev_err(ndev, "Tx DMA memory map failed\n");
> -			return NETDEV_TX_OK;
> -		}
>  	}
>  
>  	bdp->cbd_bufaddr = cpu_to_fec32(dmabuf);

Hi Dheeraj,

It seems to me that at this point of execution, without your patch, dmabuf
can be one of two values:

	1. txq->tso_hdrs_dma + index * TSO_HEADER_SIZE
	   This is the default case.

	2. txq->tx_bounce[index]
	   This is the special case, which is handed in the conditional
	   block that your patch updates.

In case 1, I agree that tso_hdrs_dma is already mapped.
But this case is not affected by your patch as the
conditional block that includes dma_map_single() is not executed.

In case 2, I do not see where txq->tx_bounce[index] is already mapped.

Am I missing something?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ