Skip to content

Commit ec82347

Browse files
pbrkrPaolo Abeni
authored andcommitted
net: ravb: Fix R-Car RX frame size limit
The RX frame size limit should not be based on the current MTU setting. Instead it should be based on the hardware capabilities. While we're here, improve the description of the receive frame length setting as suggested by Niklas. Fixes: c156633 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 1d63864 commit ec82347

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,16 @@ static void ravb_emac_init_gbeth(struct net_device *ndev)
555555

556556
static void ravb_emac_init_rcar(struct net_device *ndev)
557557
{
558-
/* Receive frame limit set register */
559-
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
558+
struct ravb_private *priv = netdev_priv(ndev);
559+
560+
/* Set receive frame length
561+
*
562+
* The length set here describes the frame from the destination address
563+
* up to and including the CRC data. However only the frame data,
564+
* excluding the CRC, are transferred to memory. To allow for the
565+
* largest frames add the CRC length to the maximum Rx descriptor size.
566+
*/
567+
ravb_write(ndev, priv->info->rx_max_frame_size + ETH_FCS_LEN, RFLR);
560568

561569
/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
562570
ravb_write(ndev, ECMR_ZPF | ECMR_DM |

0 commit comments

Comments
 (0)