diff mbox series

[net-next] ravb: Correct buffer size to map for R-Car Rx

Message ID 20240308224237.496924-1-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State Accepted
Commit a290d4cb892da3e9e163a40d0ab70ed1531cdc58
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ravb: Correct buffer size to map for R-Car Rx | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 940 this patch: 940
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: paul.barker.ct@bp.renesas.com; 1 maintainers not CCed: paul.barker.ct@bp.renesas.com
netdev/build_clang success Errors and warnings before: 956 this patch: 956
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 956 this patch: 956
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-10--00-00 (tests: 888)

Commit Message

Niklas Söderlund March 8, 2024, 10:42 p.m. UTC
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(-)

Comments

Sergey Shtylyov March 9, 2024, 7:32 p.m. UTC | #1
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
Simon Horman March 11, 2024, 9:24 a.m. UTC | #2
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>
Geert Uytterhoeven March 11, 2024, 9:39 a.m. UTC | #3
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
patchwork-bot+netdevbpf@kernel.org March 11, 2024, 10:50 p.m. UTC | #4
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!
diff mbox series

Patch

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