netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next] ravb: Correct buffer size to map for R-Car Rx
@ 2024-03-08 22:42 Niklas Söderlund
  2024-03-09 19:32 ` Sergey Shtylyov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Niklas Söderlund @ 2024-03-08 22:42 UTC (permalink / raw)
  To: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Biju Das, Claudiu Beznea, Yoshihiro Shimoda, netdev
  Cc: linux-renesas-soc, Niklas Söderlund

When creating a helper to allocate and align an skb one location where
the skb data size was updated was missed. This can lead to a warning
being printed when the memory is being unmapped as it now always unmap
the maximum frame size, instead of the size after it have been
aligned.

This was correctly done for RZ/G2L but missed for R-Car.

Fixes: cfbad64706c1 ("ravb: Create helper to allocate skb and align it")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/net/ethernet/renesas/ravb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index fa48ff4aba2d..d1be030c8848 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -979,7 +979,7 @@ static bool ravb_rx_rcar(struct net_device *ndev, int *quota, int q)
 			if (!skb)
 				break;	/* Better luck next round. */
 			dma_addr = dma_map_single(ndev->dev.parent, skb->data,
-						  le16_to_cpu(desc->ds_cc),
+						  priv->info->rx_max_frame_size,
 						  DMA_FROM_DEVICE);
 			skb_checksum_none_assert(skb);
 			/* We just set the data size to 0 for a failed mapping
-- 
2.44.0


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

* Re: [net-next] ravb: Correct buffer size to map for R-Car Rx
  2024-03-08 22:42 [net-next] ravb: Correct buffer size to map for R-Car Rx Niklas Söderlund
@ 2024-03-09 19:32 ` Sergey Shtylyov
  2024-03-11  9:24 ` Simon Horman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2024-03-09 19:32 UTC (permalink / raw)
  To: Niklas Söderlund, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Biju Das, Claudiu Beznea,
	Yoshihiro Shimoda, netdev
  Cc: linux-renesas-soc

On 3/9/24 1:42 AM, Niklas Söderlund wrote:

> When creating a helper to allocate and align an skb one location where
> the skb data size was updated was missed. This can lead to a warning
> being printed when the memory is being unmapped as it now always unmap
> the maximum frame size, instead of the size after it have been
> aligned.
> 
> This was correctly done for RZ/G2L but missed for R-Car.
> 
> Fixes: cfbad64706c1 ("ravb: Create helper to allocate skb and align it")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey


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

* Re: [net-next] ravb: Correct buffer size to map for R-Car Rx
  2024-03-08 22:42 [net-next] ravb: Correct buffer size to map for R-Car Rx Niklas Söderlund
  2024-03-09 19:32 ` Sergey Shtylyov
@ 2024-03-11  9:24 ` Simon Horman
  2024-03-11  9:39 ` Geert Uytterhoeven
  2024-03-11 22:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2024-03-11  9:24 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Biju Das, Claudiu Beznea, Yoshihiro Shimoda, netdev,
	linux-renesas-soc

On Fri, Mar 08, 2024 at 11:42:37PM +0100, Niklas Söderlund wrote:
> When creating a helper to allocate and align an skb one location where
> the skb data size was updated was missed. This can lead to a warning
> being printed when the memory is being unmapped as it now always unmap
> the maximum frame size, instead of the size after it have been
> aligned.
> 
> This was correctly done for RZ/G2L but missed for R-Car.
> 
> Fixes: cfbad64706c1 ("ravb: Create helper to allocate skb and align it")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

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


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

* Re: [net-next] ravb: Correct buffer size to map for R-Car Rx
  2024-03-08 22:42 [net-next] ravb: Correct buffer size to map for R-Car Rx Niklas Söderlund
  2024-03-09 19:32 ` Sergey Shtylyov
  2024-03-11  9:24 ` Simon Horman
@ 2024-03-11  9:39 ` Geert Uytterhoeven
  2024-03-11 22:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-03-11  9:39 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Sergey Shtylyov, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Biju Das, Claudiu Beznea, Yoshihiro Shimoda, netdev,
	linux-renesas-soc

On Fri, Mar 8, 2024 at 11:43 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> When creating a helper to allocate and align an skb one location where
> the skb data size was updated was missed. This can lead to a warning
> being printed when the memory is being unmapped as it now always unmap
> the maximum frame size, instead of the size after it have been
> aligned.
>
> This was correctly done for RZ/G2L but missed for R-Car.
>
> Fixes: cfbad64706c1 ("ravb: Create helper to allocate skb and align it")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [net-next] ravb: Correct buffer size to map for R-Car Rx
  2024-03-08 22:42 [net-next] ravb: Correct buffer size to map for R-Car Rx Niklas Söderlund
                   ` (2 preceding siblings ...)
  2024-03-11  9:39 ` Geert Uytterhoeven
@ 2024-03-11 22:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-11 22:50 UTC (permalink / raw)
  To: =?utf-8?q?Niklas_S=C3=B6derlund_=3Cniklas=2Esoderlund+renesas=40ragnatech=2E?=,
	=?utf-8?q?se=3E?=
  Cc: s.shtylyov, davem, edumazet, kuba, pabeni, biju.das.jz,
	claudiu.beznea.uj, yoshihiro.shimoda.uh, netdev,
	linux-renesas-soc

Hello:

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

On Fri,  8 Mar 2024 23:42:37 +0100 you wrote:
> When creating a helper to allocate and align an skb one location where
> the skb data size was updated was missed. This can lead to a warning
> being printed when the memory is being unmapped as it now always unmap
> the maximum frame size, instead of the size after it have been
> aligned.
> 
> This was correctly done for RZ/G2L but missed for R-Car.
> 
> [...]

Here is the summary with links:
  - [net-next] ravb: Correct buffer size to map for R-Car Rx
    https://git.kernel.org/netdev/net-next/c/a290d4cb892d

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] 5+ messages in thread

end of thread, other threads:[~2024-03-11 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 22:42 [net-next] ravb: Correct buffer size to map for R-Car Rx Niklas Söderlund
2024-03-09 19:32 ` Sergey Shtylyov
2024-03-11  9:24 ` Simon Horman
2024-03-11  9:39 ` Geert Uytterhoeven
2024-03-11 22:50 ` 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).