[PATCH] net: ethernet: ti: cpsw: Set max and min MTU sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These fields need to be set in order for the userspace or DSA drivers to
change the MTU to bigger or smaller values. They default to 68 and 1500
respectively. Since the hardware supports wider limits, it is all
benefit to set them.

Specially when connecting a DSA switch, the DSA code wants to set the
MTU of the cpsw port to 1500 + tag size. This was failing without this
change.

Signed-off-by: Alexandre Bard <alexandre.bard@xxxxxxxxxxxxx>
---
 drivers/net/ethernet/ti/cpsw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index ed66c4d4d830..83d8c6a8a527 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1631,6 +1631,9 @@ static int cpsw_probe(struct platform_device *pdev)
 
 	eth_hw_addr_set(ndev, priv->mac_addr);
 
+	ndev->min_mtu = CPSW_MIN_PACKET_SIZE;
+	ndev->max_mtu = CPSW_MAX_PACKET_SIZE;
+
 	cpsw->slaves[0].ndev = ndev;
 
 	ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_CTAG_RX;
-- 
2.20.1




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux