From 13efc44ca644257dd35c1b380294086505e69e7e Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sat, 23 Sep 2023 20:38:22 +0200 Subject: net: ixp4xx_eth: Specify min/max MTU As we don't specify the MTU in the driver, the framework will fall back to 1500 bytes and this doesn't work very well when we try to attach a DSA switch: eth1: mtu greater than device maximum ixp4xx_eth c800a000.ethernet eth1: error -22 setting MTU to 1504 to include DSA overhead I checked the developer docs and the hardware can actually do really big frames, so update the driver accordingly. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230923-ixp4xx-eth-mtu-v1-1-9e88b908e1b2@linaro.org Signed-off-by: Paolo Abeni --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/net/ethernet/xscale/ixp4xx_eth.c') diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index b242aa61d8ab..5c2fd2852e32 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1488,6 +1489,13 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) ndev->dev.dma_mask = dev->dma_mask; ndev->dev.coherent_dma_mask = dev->coherent_dma_mask; + /* Maximum frame size is 16320 bytes and includes VLAN and + * ethernet headers. See "IXP400 Software Programmer's Guide" + * section 10.3.2, page 161. + */ + ndev->min_mtu = ETH_MIN_MTU; + ndev->max_mtu = 16320 - VLAN_ETH_HLEN; + netif_napi_add_weight(ndev, &port->napi, eth_poll, NAPI_WEIGHT); if (!(port->npe = npe_request(NPE_ID(port->id)))) -- cgit