From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 6E771C433E0 for ; Wed, 20 Jan 2021 01:32:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FD0A20449 for ; Wed, 20 Jan 2021 01:32:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FD0A20449 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UIuwxI3IVLAOs2wnkrp+LYAUHBUrXHVSrG8tQ7guVNQ=; b=HgwOVxvFWsGWmuymcMIlkZkWF oMRbvu/MU2+MuvzJJ1cf9tJJ5BrS+T/rTinNq6+mSFvBzm3QTGSnAoU5UbhblpEw9XjTdEAaMvh2q V4kLXZYXBj0W+kF5+JX0AYG3RbWqaTQ6xcZPOKmKtyz0C5KAdmh+ozmJBKixXisGcwUNNKdPN8jnZ hTliVu6eS8PhzY/Dn6B8ifcMAovTDH8ifpl6wtIyX4R+g2LS7pXeNVFwrkV1u1ngiRocH6QQzxBw0 UUHsmKCqbEMnPWRoEh3J0Fm/gOQhRBrERXq1RFSicrzmqXCJmpgg6dqE+VtJ607xrutBpdtzdUuyE y45hf+EXQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l22KL-00055A-CJ; Wed, 20 Jan 2021 01:30:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l22IA-0003ly-MB for linux-arm-kernel@lists.infradead.org; Wed, 20 Jan 2021 01:28:20 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03C9A23602; Wed, 20 Jan 2021 01:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611106091; bh=N8kZanpn/GiXqno4kNSqiehgnZB79d0jgWhD+24tOA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LBWMYvYuAXdnRlWgiv6v1v9mt/5fCzERnAe6HKwOXisZKUSyQvYdk1MIq80j3HxzP ZDGvUqGfFQBRFEtMGNTmxS5fIO0mg1j3UlB04ibfJKJlst+Jbsk9KKK8OQTGIfrbw0 mIV7pUW44PyI3fUsPmCy0h2aMeEgUX7p+iureCpmr6NeAkSn+p+rb/3UrduIuzKCE4 WmkB4Cz1CQdicADE6noKleoXuUq6dI5IP2AxOyHzYu9t/O7c8/UcR8vCf+E1tl8092 la7EFq8DdLP/2wR56eOtt5Q6n70N6aaJE0JdYSy7iihL5M6iSJ62z+wBePzvodZ6T1 Z6lw93UGTTE3A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 6/9] net: stmmac: Fixed mtu channged by cache aligned Date: Tue, 19 Jan 2021 20:27:59 -0500 Message-Id: <20210120012802.770525-6-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210120012802.770525-1-sashal@kernel.org> References: <20210120012802.770525-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_202814_975142_59614307 X-CRM114-Status: GOOD ( 13.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , netdev@vger.kernel.org, David Wu , Jakub Kicinski , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: David Wu [ Upstream commit 5b55299eed78538cc4746e50ee97103a1643249c ] Since the original mtu is not used when the mtu is updated, the mtu is aligned with cache, this will get an incorrect. For example, if you want to configure the mtu to be 1500, but mtu 1536 is configured in fact. Fixed: eaf4fac478077 ("net: stmmac: Do not accept invalid MTU values") Signed-off-by: David Wu Link: https://lore.kernel.org/r/20210113034109.27865-1-david.wu@rock-chips.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d5ebaf62d12fe..a7b30f0605362 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3613,6 +3613,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) { struct stmmac_priv *priv = netdev_priv(dev); int txfifosz = priv->plat->tx_fifo_size; + const int mtu = new_mtu; if (txfifosz == 0) txfifosz = priv->dma_cap.tx_fifo_size; @@ -3630,7 +3631,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) return -EINVAL; - dev->mtu = new_mtu; + dev->mtu = mtu; netdev_update_features(dev); -- 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel