Skip to content

Commit e7e441a

Browse files
pbrkrkuba-moo
authored andcommitted
net: ravb: Fix max TX frame size for RZ/V2M
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: 1d63864 ("net: ravb: Fix maximum TX frame size for GbEth devices") Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent eaeea50 commit e7e441a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,6 +2763,7 @@ static const struct ravb_hw_info ravb_rzv2m_hw_info = {
27632763
.net_features = NETIF_F_RXCSUM,
27642764
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
27652765
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
2766+
.tx_max_frame_size = SZ_2K,
27662767
.rx_max_frame_size = SZ_2K,
27672768
.rx_buffer_size = SZ_2K +
27682769
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),

0 commit comments

Comments
 (0)