From patchwork Mon Aug 3 12:19:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266800 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,DKIMWL_WL_HIGH, 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 F07F2C433E0 for ; Mon, 3 Aug 2020 12:48:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C13F620738 for ; Mon, 3 Aug 2020 12:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596458910; bh=6EPqKZcKMj1r5rp1Qtz9O/AAQmR92Y7S/UwFmjjsyWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=n0JLH50ysqCFWGmrI/SWZBwM8nj/nWwIIoN8/GkqhiTvCDEBmgvic8Xv3+AUh41nq E3Ellt8oBsrP5k1PqGMUoyUW9fJ2MFeLI3GidrkW0nULkwZsyFA3QE89PTytk7G5+O i7f367g1Czjxs/4+LrOxyEYEvqPQg21YqhcUl9/k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbgHCMsO (ORCPT ); Mon, 3 Aug 2020 08:48:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:49390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728100AbgHCMYw (ORCPT ); Mon, 3 Aug 2020 08:24:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7211622B47; Mon, 3 Aug 2020 12:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596457491; bh=6EPqKZcKMj1r5rp1Qtz9O/AAQmR92Y7S/UwFmjjsyWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMU1FOLH7w7pfumrpGeqJtLBk6neOSnxc9QKhgquesM1ZXYI7nYBSzbyCuTU567Fd 2wH+nKRcbLrQTHNLFBicaHcYN24wxwHTtFoqCXaRi+bRbz3+27Ci7G+LVbSdci1AK2 b1bO7fJ3SOTEBemxj7U3ou+IY5dIJr5PCTnSDo74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Landen Chao , Frank Wunderlich , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 087/120] net: ethernet: mtk_eth_soc: fix MTU warnings Date: Mon, 3 Aug 2020 14:19:05 +0200 Message-Id: <20200803121907.107316147@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121902.860751811@linuxfoundation.org> References: <20200803121902.860751811@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Landen Chao [ Upstream commit 555a893303872e044fb86f0a5834ce78d41ad2e2 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 09047109d0daa..b743d8b56c848 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2882,6 +2882,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: