From patchwork Tue Aug 4 16:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 262726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00011C433E0 for ; Tue, 4 Aug 2020 17:07:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB32E207FC for ; Tue, 4 Aug 2020 17:07:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mailerdienst.de header.i=@mailerdienst.de header.b="G5QrEXus" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgHDRHX (ORCPT ); Tue, 4 Aug 2020 13:07:23 -0400 Received: from mxwww.masterlogin.de ([95.129.51.220]:46876 "EHLO mxwww.masterlogin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729853AbgHDRFq (ORCPT ); Tue, 4 Aug 2020 13:05:46 -0400 X-Greylist: delayed 570 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 Aug 2020 13:05:45 EDT Received: from mxout4.routing.net (unknown [192.168.10.112]) by forward.mxwww.masterlogin.de (Postfix) with ESMTPS id AD31796135; Tue, 4 Aug 2020 16:56:10 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id 65C451014A6; Tue, 4 Aug 2020 16:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1596560170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sO6tybaMOJ1Y/9jRMHEuMbPOV8G3l1zST2AlvdQbQc4=; b=G5QrEXusd7O180Uc4HbCX88/NhgIAjUvUG/poFT8KiVuY+bL5KLI7P/3YGHEXMXVv5TjT3 qhJxbMsqIrF5w4ESj438PffNefB0XFfEYy7yyKexhi36jJiz2qIRjPqK+POzfHiQ3Ie6AK op1YFQPXAET5ZGv7kQUNBgD8QrCh2YM= Received: from localhost.localdomain (fttx-pool-217.61.144.119.bambit.de [217.61.144.119]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 5B5443601C7; Tue, 4 Aug 2020 16:56:09 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Landen Chao , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Andrew Lunn Subject: [PATCH v4] net: ethernet: mtk_eth_soc: fix MTU warnings Date: Tue, 4 Aug 2020 18:55:50 +0200 Message-Id: <20200804165555.75159-3-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804165555.75159-1-linux@fw-web.de> References: <20200804165555.75159-1-linux@fw-web.de> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Landen Chao in recent kernel versions there are warnings about incorrect MTU size like these: 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: Landen Chao Signed-off-by: Frank Wunderlich Reviewed-by: Andrew Lunn --- v3->v4 - fix commit-message (hyphernations,capitalisation) as suggested by Russell - add Signed-off-by Landen - dropped wrong signed-off from rene (because previous v1/2 was from him) --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 85735d32ecb0..a1c45b39a230 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2891,6 +2891,8 @@ 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]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; + return 0; free_netdev: