Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1419186ybt; Thu, 9 Jul 2020 06:42:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmDKkTtQX/CoRFAGBtDJs7JR2KKDbRSo1QMwsfxHqUnVE/EMt6Pn+oBrni4KfGMgmyQUXr X-Received: by 2002:a17:906:a253:: with SMTP id bi19mr54582930ejb.338.1594302137737; Thu, 09 Jul 2020 06:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594302137; cv=none; d=google.com; s=arc-20160816; b=awuCUw6DPNXcNLJweWdtg2RS8FdTgUxizj1eRfrg4rC5mAlzgtvjhVAZYIBzd6zo63 VcT9Fmr+Yjo1TzfCKY59jtGY2D9xUNkXEAP625Zqal2K9TFAPsnai0+NWyv0WW3vKICG KbdG4Si8cPtDFtYWjhGn5p04+wjsdB6KhUjh1a85ovDJf1prMUR+LyRPsoxu3aFPAWFt 2v0MnTiKsxc2eavilOiMT+8cx7ZFspTL4r0oeoO9yC4v/V6mq0U2J0O2zLmFHHevu7U6 Zojo6vfvlNcuEp2ZFURxdlE60XTMYAwWqSIPvsAml2D00/D84Uh4/ReW5sa2L5eU/W8y UuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=M8zmuZvwEmzK+n3cYdvMYYVc5w2mYTqkNiJdZ8ibxNU=; b=RIyPO2TCK5+j/AGgPdX+LM/PZM9kxllYPMv7PCIQERFpJ1/tI+7oK3ym8MYCoFFfPu MGIi8B7hHiLNQhcW1f2D73gNWWKICdP+ihPBk97HvVt6AlyBRaKgAZxtZfqTCCLVSGTG vAJnxDlkSO54sS9tM9+re283vAHo1TVRghtt8Y/mm4uUvkXK2L7AYenOCVqRZ8CIqs2W mkFLn+krI6Fe9AVhmDsprH3ju/jHQIwLWyCqo6O8MlWIYXG3c0CRUbVRSWy5vKVpLXHh 0ZjFVWhtbH0L6xmSCzl3SPVQnBsQr+wI1XU3KnCOtojYalTiglxVPWa/DKAh6lrWWzXu o1ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si1859561ejc.288.2020.07.09.06.41.54; Thu, 09 Jul 2020 06:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbgGINlj (ORCPT + 99 others); Thu, 9 Jul 2020 09:41:39 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:55302 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgGINlj (ORCPT ); Thu, 9 Jul 2020 09:41:39 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jtWnb-004L5F-7c; Thu, 09 Jul 2020 15:41:15 +0200 Date: Thu, 9 Jul 2020 15:41:15 +0200 From: Andrew Lunn To: Frank Wunderlich Cc: linux-mediatek@lists.infradead.org, =?iso-8859-1?Q?Ren=E9?= van Dorst , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix mtu warning Message-ID: <20200709134115.GK928075@lunn.ch> References: <20200709055742.3425-1-frank-w@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200709055742.3425-1-frank-w@public-files.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2020 at 07:57:42AM +0200, Frank Wunderlich wrote: > From: Ren? van Dorst > > in recent Kernel-Versions there are warnings about incorrect MTU-Size > like these: > > mt7530 mdio-bus:00: nonfatal error -95 setting MTU on port x > eth0: mtu greater than device maximum > mtk_soc_eth 1b100000.ethernet eth0: error -22 setting MTU to include DSA overhead > > Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports") > Fixes: 72579e14a1d3 ("net: dsa: don't fail to probe if we couldn't set the MTU") > Fixes: 7a4c53bee332 ("net: report invalid mtu value via netlink extack") > Signed-off-by: Ren? van Dorst > Signed-off-by: Frank Wunderlich > --- > changes in v2: > Fixes: tag show 12-chars of sha1 and moved above other tags > --- > drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > index 85735d32ecb0..00e3d70f7d07 100644 > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > @@ -2891,6 +2891,10 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) > eth->netdev[id]->irq = eth->irq[0]; > eth->netdev[id]->dev.of_node = np; > > + eth->netdev[id]->mtu = 1536; Hi Frank Don't change to MTU from the default. Anybody using this interface for non-DSA traffic expects the default MTU. DSA will change it as needed. > + eth->netdev[id]->min_mtu = ETH_MIN_MTU; No need to set the minimum. ether_setup() will initialize it. > + eth->netdev[id]->max_mtu = 1536; I assume this is enough to make the DSA warning go away, but it is the true max? I have a similar patch for the FEC driver which i should post sometime. Reviewing the FEC code and after some testing, i found the real max was 2K - 64. Andrew