netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path
@ 2025-10-16 13:58 Ioana Ciornei
  2025-10-17  9:03 ` Simon Horman
  2025-10-18  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Ioana Ciornei @ 2025-10-16 13:58 UTC (permalink / raw)
  To: Andrew Lunn, davem, Jakub Kicinski, Paolo Abeni, netdev
  Cc: linux-kernel, Mathew McBride

The blamed commit increased the needed headroom to account for
alignment. This means that the size required to always align a Tx buffer
was added inside the dpaa2_eth_needed_headroom() function. By doing
that, a manual adjustment of the pointer passed to PTR_ALIGN() was no
longer correct since the 'buffer_start' variable was already pointing
to the start of the skb's memory.

The behavior of the dpaa2-eth driver without this patch was to drop
frames on Tx even when the headroom was matching the 128 bytes
necessary. Fix this by removing the manual adjust of 'buffer_start' from
the PTR_MODE call.

Closes: https://lore.kernel.org/netdev/70f0dcd9-1906-4d13-82df-7bbbbe7194c6@app.fastmail.com/T/#u
Fixes: f422abe3f23d ("dpaa2-eth: increase the needed headroom to account for alignment")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Mathew McBride <matt@traverse.com.au>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index c96d1d6ba8fe..18d86badd6ea 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -1077,8 +1077,7 @@ static int dpaa2_eth_build_single_fd(struct dpaa2_eth_priv *priv,
 	dma_addr_t addr;
 
 	buffer_start = skb->data - dpaa2_eth_needed_headroom(skb);
-	aligned_start = PTR_ALIGN(buffer_start - DPAA2_ETH_TX_BUF_ALIGN,
-				  DPAA2_ETH_TX_BUF_ALIGN);
+	aligned_start = PTR_ALIGN(buffer_start, DPAA2_ETH_TX_BUF_ALIGN);
 	if (aligned_start >= skb->head)
 		buffer_start = aligned_start;
 	else
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path
  2025-10-16 13:58 [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path Ioana Ciornei
@ 2025-10-17  9:03 ` Simon Horman
  2025-10-18  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-10-17  9:03 UTC (permalink / raw)
  To: Ioana Ciornei
  Cc: Andrew Lunn, davem, Jakub Kicinski, Paolo Abeni, netdev,
	linux-kernel, Mathew McBride

On Thu, Oct 16, 2025 at 04:58:07PM +0300, Ioana Ciornei wrote:
> The blamed commit increased the needed headroom to account for
> alignment. This means that the size required to always align a Tx buffer
> was added inside the dpaa2_eth_needed_headroom() function. By doing
> that, a manual adjustment of the pointer passed to PTR_ALIGN() was no
> longer correct since the 'buffer_start' variable was already pointing
> to the start of the skb's memory.
> 
> The behavior of the dpaa2-eth driver without this patch was to drop
> frames on Tx even when the headroom was matching the 128 bytes
> necessary. Fix this by removing the manual adjust of 'buffer_start' from
> the PTR_MODE call.
> 
> Closes: https://lore.kernel.org/netdev/70f0dcd9-1906-4d13-82df-7bbbbe7194c6@app.fastmail.com/T/#u
> Fixes: f422abe3f23d ("dpaa2-eth: increase the needed headroom to account for alignment")
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> Tested-by: Mathew McBride <matt@traverse.com.au>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path
  2025-10-16 13:58 [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path Ioana Ciornei
  2025-10-17  9:03 ` Simon Horman
@ 2025-10-18  0:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-18  0:00 UTC (permalink / raw)
  To: Ioana Ciornei
  Cc: andrew+netdev, davem, kuba, pabeni, netdev, linux-kernel, matt

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 16 Oct 2025 16:58:07 +0300 you wrote:
> The blamed commit increased the needed headroom to account for
> alignment. This means that the size required to always align a Tx buffer
> was added inside the dpaa2_eth_needed_headroom() function. By doing
> that, a manual adjustment of the pointer passed to PTR_ALIGN() was no
> longer correct since the 'buffer_start' variable was already pointing
> to the start of the skb's memory.
> 
> [...]

Here is the summary with links:
  - [net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path
    https://git.kernel.org/netdev/net/c/902e81e679d8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-18  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 13:58 [PATCH net] dpaa2-eth: fix the pointer passed to PTR_ALIGN on Tx path Ioana Ciornei
2025-10-17  9:03 ` Simon Horman
2025-10-18  0:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).