net: ravb: Fix maximum TX frame size for GbEth devices
BugLink: https://bugs.launchpad.net/bugs/2097301
[ Upstream commit 1d63864299cafa7c8cbde56491c9932afdbff7ea ]
The datasheets for all SoCs using the GbEth IP specify a maximum
transmission frame size of 1.5 kByte. I've confirmed through internal
discussions that support for 1522 byte frames has been validated, which
allows us to support the default MTU of 1500 bytes after reserving space
for the Ethernet header, frame checksums and an optional VLAN tag.
Fixes: 2e95e08ac0 ("ravb: Add rx_max_buf_size to struct ravb_hw_info")
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
dd9ce1e956
commit
b97e3b54c2
@@ -1027,6 +1027,7 @@ struct ravb_hw_info {
|
||||
int stats_len;
|
||||
size_t max_rx_len;
|
||||
u32 tccr_mask;
|
||||
u32 tx_max_frame_size;
|
||||
u32 rx_max_buf_size;
|
||||
unsigned aligned_tx: 1;
|
||||
|
||||
|
||||
@@ -2437,6 +2437,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
|
||||
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
|
||||
.max_rx_len = RX_BUF_SZ + RAVB_ALIGN - 1,
|
||||
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
|
||||
.tx_max_frame_size = SZ_2K,
|
||||
.rx_max_buf_size = SZ_2K,
|
||||
.internal_delay = 1,
|
||||
.tx_counters = 1,
|
||||
@@ -2463,6 +2464,7 @@ static const struct ravb_hw_info ravb_gen2_hw_info = {
|
||||
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
|
||||
.max_rx_len = RX_BUF_SZ + RAVB_ALIGN - 1,
|
||||
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
|
||||
.tx_max_frame_size = SZ_2K,
|
||||
.rx_max_buf_size = SZ_2K,
|
||||
.aligned_tx = 1,
|
||||
.gptp = 1,
|
||||
@@ -2509,6 +2511,7 @@ static const struct ravb_hw_info gbeth_hw_info = {
|
||||
.stats_len = ARRAY_SIZE(ravb_gstrings_stats_gbeth),
|
||||
.max_rx_len = ALIGN(GBETH_RX_BUFF_MAX, RAVB_ALIGN),
|
||||
.tccr_mask = TCCR_TSRQ0,
|
||||
.tx_max_frame_size = 1522,
|
||||
.rx_max_buf_size = SZ_8K,
|
||||
.aligned_tx = 1,
|
||||
.tx_counters = 1,
|
||||
@@ -2780,7 +2783,7 @@ static int ravb_probe(struct platform_device *pdev)
|
||||
clk_prepare_enable(priv->gptp_clk);
|
||||
}
|
||||
|
||||
ndev->max_mtu = info->rx_max_buf_size - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
|
||||
ndev->max_mtu = info->tx_max_frame_size - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
|
||||
ndev->min_mtu = ETH_MIN_MTU;
|
||||
|
||||
/* FIXME: R-Car Gen2 has 4byte alignment restriction for tx buffer
|
||||
|
||||
Reference in New Issue
Block a user