]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: ravb: Fix max TX frame size for RZ/V2M
authorPaul Barker <paul.barker.ct@bp.renesas.com>
Thu, 9 Jan 2025 11:37:06 +0000 (11:37 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Jan 2025 02:15:03 +0000 (18:15 -0800)
When tx_max_frame_size was added to struct ravb_hw_info, no value was
set in ravb_rzv2m_hw_info so the default value of zero was used.

The maximum MTU is set by subtracting from tx_max_frame_size to allow
space for headers and frame checksums. As ndev->max_mtu is unsigned,
this subtraction wraps around leading to a ridiculously large positive
value that is obviously incorrect.

Before tx_max_frame_size was introduced, the maximum MTU was based on
rx_max_frame_size. So, we can restore the correct maximum MTU by copying
the rx_max_frame_size value into tx_max_frame_size for RZ/V2M.

Fixes: 1d63864299ca ("net: ravb: Fix maximum TX frame size for GbEth devices")
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://patch.msgid.link/20250109113706.1409149-1-paul.barker.ct@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/renesas/ravb_main.c

index ac0f093f647a52185df5a64ccde7e53fd73f581d..bc395294a32df954a5a7797bc6a2726f111a097f 100644 (file)
@@ -2763,6 +2763,7 @@ static const struct ravb_hw_info ravb_rzv2m_hw_info = {
        .net_features = NETIF_F_RXCSUM,
        .stats_len = ARRAY_SIZE(ravb_gstrings_stats),
        .tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
+       .tx_max_frame_size = SZ_2K,
        .rx_max_frame_size = SZ_2K,
        .rx_buffer_size = SZ_2K +
                          SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),