Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp906602pxb; Wed, 13 Jan 2021 20:13:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQFbBmwLvfIUF1BXjRCtaiVUTCocnXEkMBNLXlFQ0FnMgtjDrWOVkkC/OXs6Us3SNoGfTb X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr3955339ejb.284.1610597626226; Wed, 13 Jan 2021 20:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610597626; cv=none; d=google.com; s=arc-20160816; b=g56RmVp3ffxyy/DzsP+lwDUrYdw2+JdVUw3OOZQHYb0zPDP6c2hqU5MsSWJ9Za/bkv fI92UjwgYxg5ZaSC5ViUY4kazqr/+0P2nidRKhIDnHm5RcQ2bXG4SD5SbgHNsdb/ErDQ dF/CVeBnaPNqafNn0HHtaWZJQXKm/ORiiDyJH92NyfDtZPP7eDfMjw5tZhuLJbaAp6lY gdIm4IMQhBZ2mRy+G/Z3yeoJ6rwa9on4jtfWOM7TrAtvD2OUvSX92+FidbKe/9J3iixL Su3OxVG87PLxQV+KNob0pK85QQx0nXCMJTTHPMvtLg9RcRuXDe/Bl1y2gC1uxc6bnITZ n9pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9Ob/zJ7xakPh2vKZks83NBJZpmBZ0Injk7Ta6V837og=; b=ee7PQcRfrCk5EUceY1CLhRya6n/WCvOoRMluUQlpkGUe/rgQVTs6DZIdAKZs6z34TS X8gUbCU3vWPBoDguUn/aIck7NlCJAPGHsIV7ISXPnkvkJWxullkSTkj3tqlcvI0NCTDK +ahPIwa4xxbVV87cYGVMV9vBM6gllVw+GNQm6wWWOU7Knt2IF5kMybDiQ8k3mYyFDg9w u7mqzJPUCcmXB3/TuoyFEkVdQsXpVYSANP4Zvh+xCIdqoD5SId1jMuMelJDeVrFaENF6 15p71g8KSD86m+mvKKPwgkkwuBUl1KG3UXmfnjjherjD1YJWSNi7Bv40QBfyE7H0ijSv CHMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vHl0CcQM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si1963289edy.54.2021.01.13.20.13.22; Wed, 13 Jan 2021 20:13:46 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vHl0CcQM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725987AbhANELq (ORCPT + 99 others); Wed, 13 Jan 2021 23:11:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:60766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbhANELp (ORCPT ); Wed, 13 Jan 2021 23:11:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02CEB238E2; Thu, 14 Jan 2021 04:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610597465; bh=EcXltmbDH7agC/QQ9g8sTB1INtLzRk5tXb2WEeddGSg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vHl0CcQMjqieB74YQO0YRnLVCwZ/FExUmZrO2tImyB39Bj3QKNmKbll2FU+k3jwFF L5fe/HoRqpdvgASi4GKeuQsTwmGbu71xC/9uMe966LttBjzQ62oh5O7sguM7HrKG3Z CU1hQufVTsU/8qLG/y7JnYXfm1SH4wIKJdRh9s8s2Crh7ICE/Qd7VbcbbOI/cJGyfY VVVnctUTfGZyj83VwPuSloLivsLGwvrqlvs88E9TsjsNgZjNMC8Ena0K1McRscLQMS Lt/HG0MLxtSUqWvd3DLsDlt8dpN7wZP7HoxlnZDWP7sILGmhdkdUHyMHw1W2cInGMl QtLP1IylmXPgg== Date: Wed, 13 Jan 2021 20:11:03 -0800 From: Jakub Kicinski To: David Wu Cc: netdev@vger.kernel.org, davem@davemloft.net, joabreu@synopsys.com, alexandre.torgue@st.com, peppe.cavallaro@st.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Fixed mtu channged by cache aligned Message-ID: <20210113201103.721a80b6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210113034109.27865-1-david.wu@rock-chips.com> References: <20210113034109.27865-1-david.wu@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jan 2021 11:41:09 +0800 David Wu wrote: > 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 > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 5b1c12ff98c0..e8640123db76 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -4025,7 +4025,7 @@ static void stmmac_set_rx_mode(struct net_device *dev) > 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; > + int txfifosz = priv->plat->tx_fifo_size, mtu = new_mtu; Adjusted the code a little here to keep the variable declaration lines ordered longest to shortest, and applied. Thanks!