Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4820933ybl; Wed, 22 Jan 2020 05:23:16 -0800 (PST) X-Google-Smtp-Source: APXvYqy7YJw9syX9eIURpTSwPMn5TBRe3dluqxdM6sZJLOyJARCxPMfIYKlu+5EukB0Sn1WWQd3z X-Received: by 2002:a05:6808:6d6:: with SMTP id m22mr6427077oih.138.1579699396242; Wed, 22 Jan 2020 05:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699396; cv=none; d=google.com; s=arc-20160816; b=ju8Aw5UYGMhM8dz25gBkr0jLGHUY3ZzbcvH6oxBZ5xRKhqjYiIunk23xlG4DK1xhT4 vTzX/T/KjJrdHsfv/OFDwL5SJP9g2fFv3kYp4cx0PSVdnpsIl9mSQU5l4VtZjMzThHkt CgIQp8TLraZsBRhVuB1l69RRBbtUpAWfIdzJQAxl/Z5ojDfANwVCY6teBAKKxfhqvzFO AeT7nO3QNHqhSlqELEDxVlpzQDdcaJjF0wK8KOWwZYMDuh4hk7WVUfqD6muJJGbSETUI iURknDsJAVee7Pt0p4A7IUI1RFQ0a1MQuF4AzHFIDzkdXtODS9lB4IWHaZgMCXdeEgMI FmNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q44U4Cz5hUDBbMis5SghEfq5fF0f2SAeZL/s80XbsvA=; b=qRpgmS11/vgToq1Fk92aDd3krxy2hZN1iQnpxa43oDqrk6aXzmyRevRbXfr/z0md9c yQXvMt7ju3wW0Y/RMLTRSy3+5/s3IBU2eFxyM7QTrX5J3OtWETEfYYBDqH5KqXIa2LEY qQQlKqf6usr1pqCRmcB4zn4qdKoyjzUSsQ3+3pxQGxjL9g11jn2wK7YElPC9AHcEIlF4 qnhNEvXDP8XMfkV9xzrWOUK43hhlQwmRP6M+5EzHJug01scSUI9R2qJcoJjBW1nqS1y7 LpLeaNrP8df72ySpMEUEhk5ixIbtnOMiW0ExIdUoCOa8gutWF2zaRctox1Ol8E4adQOA tTjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSeRLtTW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si23540338otr.102.2020.01.22.05.23.03; Wed, 22 Jan 2020 05:23:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSeRLtTW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729100AbgAVNVk (ORCPT + 99 others); Wed, 22 Jan 2020 08:21:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:38818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729777AbgAVNVi (ORCPT ); Wed, 22 Jan 2020 08:21:38 -0500 Received: from localhost (unknown [84.241.205.26]) (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 2AE6C205F4; Wed, 22 Jan 2020 13:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699297; bh=3NHg/j5Ylm3/V5vjjW3y4fiKoJeTEfYhg0I3kxwap98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSeRLtTWRevxLz15q0kwRpRKaoZB0Brr7MykJsOxbZ63FK5Et0Qp8CVhJnj4vfC0H XHtnoA/4VdGykoTk/aVQ3gcveIJmvIsX8UU+sIJHbsyLanb1Lt1033M7TliwZaHLYC RV5Hif8A9xivKAbnj2XQ7ALSctAz+FPMOfw8ohb8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jose Abreu , "David S. Miller" Subject: [PATCH 5.4 100/222] net: stmmac: Enable 16KB buffer size Date: Wed, 22 Jan 2020 10:28:06 +0100 Message-Id: <20200122092840.900104446@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jose Abreu commit b2f3a481c4cd62f78391b836b64c0a6e72b503d2 upstream. XGMAC supports maximum MTU that can go to 16KB. Lets add this check in the calculation of RX buffer size. Fixes: 7ac6653a085b ("stmmac: Move the STMicroelectronics driver") Signed-off-by: Jose Abreu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1108,7 +1108,9 @@ static int stmmac_set_bfsize(int mtu, in { int ret = bufsize; - if (mtu >= BUF_SIZE_4KiB) + if (mtu >= BUF_SIZE_8KiB) + ret = BUF_SIZE_16KiB; + else if (mtu >= BUF_SIZE_4KiB) ret = BUF_SIZE_8KiB; else if (mtu >= BUF_SIZE_2KiB) ret = BUF_SIZE_4KiB;