From patchwork Sat Sep 23 18:38:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 144004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp378756vqu; Sat, 23 Sep 2023 14:41:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNfKJCnRzJeyqY6wJAy7a/Fd2L6r4Itw5/iOdDqm+btZF26In1l9iDPLVScl9RUyGQaxxe X-Received: by 2002:a05:6870:c10a:b0:1d5:6161:76f2 with SMTP id f10-20020a056870c10a00b001d5616176f2mr3942344oad.27.1695505270030; Sat, 23 Sep 2023 14:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695505269; cv=none; d=google.com; s=arc-20160816; b=kmknA31QYP6YsqQyflJB1z30trh8zh7ILcpJE/Q6rD/OzGdFaW9Cd1/NCJdEVzteue OYMiZeMVQ/rVUcniJPntJ50QGSZvOcL7wdrcxYAismKrrxnelZ5QJupnNT0sX1GJUapa uM52PoZa3FGautU9WM/IGkreyTnDANQYMVNcspXmUZek0PPmEsmP5gbK3aV1Q7PNORXO zsWQEiEjYpu7QqkVsXvNTpVzDJgXqUn+KqZ70+0pCJVcqpppjIJ5+ulkBJGzoo4ALng6 tgbWOSnX6ZXOn+S9QZWf9rE9h19iLo7LtoufXW+oQtm19ONupxZmo7o50anlUkVXSGKS FrQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=ClXqT8Uh8EdDamPSJYkPDkToktmXy2eMl0T39P8sMUs=; fh=IpLtk81S9mGJINKi6hACXaRCvRu93XY3N1ES609gpDw=; b=DHanvYuTa+Kh2iXu/5LQ9me3E2njLgfYlSg9B9KQfBb5JrdCSAs9YW8UfAKlkx6okA iVEnXmiWkZmGjAItk8MbdxLbnm1tMT97duDu+CDaBqHkezyDdZvmsT1I2SY83bHlW8VW T+ValghoX7SC/nW6tSrcIv1PB+bQVgyekaKa2pWA9dND6pnis6mLNHTbDKx86aMtbudw qesZxSZmVqcqN4o/EKN9RvycbhsvwAqK4gJ+YzNs1RTPQFz7TOr3OFqc0dBfshclckQc FN/OQph3zf58twCPKxakTxQZ2pI2G4qxViHrgs5hA+UAiOqv6JeWg/Gtg/78YD7J+8bS 7ZgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ST5Z3m6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b5-20020a056a000cc500b0068fbace5bfcsi7183609pfv.149.2023.09.23.14.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 14:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ST5Z3m6t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CEEDA80AEFDD; Sat, 23 Sep 2023 11:38:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjIWSie (ORCPT + 30 others); Sat, 23 Sep 2023 14:38:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjIWSid (ORCPT ); Sat, 23 Sep 2023 14:38:33 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0279F136 for ; Sat, 23 Sep 2023 11:38:27 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-502a4f33440so6575264e87.1 for ; Sat, 23 Sep 2023 11:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695494305; x=1696099105; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=ClXqT8Uh8EdDamPSJYkPDkToktmXy2eMl0T39P8sMUs=; b=ST5Z3m6tMYh/mIJwP27f5ZCoXdmYVRNjQglFa/ROzeRBkNJ+MgRRpG34+iHsPBLAW/ 1z4C/DYlUq27ZsJXViS9Itz0NYGTWSr9kEbIlhtPEyy4uTooWKJyItrLZNXMsqV2Raq0 klHvi2XGsqHzz9gxkTwWG0yBOL6L0k7GJZxzgy+MtQS7uOrin60hknZI4mGugDgHCU2m x1lxntrZf6M2mP6HjLepcfZ0MuAo2F0GNZruR0pn4t0/XfCaBYdkHuP9HbIorP8h5Hzy 7HIMC8EhSLZ1XVBrBu/E/oSjFoqmlk5tfgJOAHJmhYv5/F/aMA7C4WiccmSHF1IxZXP7 JICQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695494305; x=1696099105; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ClXqT8Uh8EdDamPSJYkPDkToktmXy2eMl0T39P8sMUs=; b=OjB4lwaMFjI0Olh+3dBmlFh4v/jORy4qj8Wi0YDZz96TFJDUQ+hs0mReSSe3zNZ9TO yexAFKNFOxqGOOwyMfaQ4xsP+ty6P76gqshvMWiSlnVz5em5p8AudgaubL8h6VEuHHVz yRQ+Vfch3it19qq7ejyDicw2hDVpMwG4JOQbEseUZ985NIKGt1inbdSaQJCbR/f2uzlD Jf7byjyQFSY9kG+ZX86w7k0NX3cQqJV4fT/VWCIgUKMhGHYbAsus5osvQlrIXuB8XUM3 9chBCbAHvNJzWBDtqEHEc9t2D72qucxT4eBx2wbbzXF3pDbiPXENEnsV8Ikart5K7oqX Q9Eg== X-Gm-Message-State: AOJu0YwsTSYRG081dKfiJW3PEm8knptoct8h2h8qnRIzrq8fxdrGUIOk ow/jRz7Hgh7w+hhmloEfN2k3AA== X-Received: by 2002:a05:6512:32a3:b0:500:91ac:c0b5 with SMTP id q3-20020a05651232a300b0050091acc0b5mr2274668lfe.30.1695494305141; Sat, 23 Sep 2023 11:38:25 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id v15-20020a056512048f00b004fe5c7d40dbsm1147959lfq.273.2023.09.23.11.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 11:38:24 -0700 (PDT) From: Linus Walleij Date: Sat, 23 Sep 2023 20:38:22 +0200 Subject: [PATCH net-next] net: ixp4xx_eth: Specify min/max MTU MIME-Version: 1.0 Message-Id: <20230923-ixp4xx-eth-mtu-v1-1-9e88b908e1b2@linaro.org> X-B4-Tracking: v=1; b=H4sIAJ0wD2UC/x3MQQ5AMBBG4avIrE1SrUS4ilgIP2ahpC2ZRNxdY /kt3nsoIggidcVDAbdEOXxGVRY0baNfwTJnkzXWmdY6Fj1rVUbaeE8XT6au5gYLWmcpR2fAIvo Pe/JI7KGJhvf9ABtOVV1qAAAA To: Krzysztof Halasa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 23 Sep 2023 11:38:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777866134239781174 X-GMAIL-MSGID: 1777866134239781174 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 --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d change-id: 20230923-ixp4xx-eth-mtu-c041d7efe932 Best regards, diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 3b0c5f177447..8f40287c8d58 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))))