Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2338526ybz; Thu, 23 Apr 2020 16:18:11 -0700 (PDT) X-Google-Smtp-Source: APiQypIKibv0Wrr4MaeCUv1qeF5kROrs9AOjfevcPeSslwDVX/Mb4mKF0PyPvLy6ZEamflI9woRx X-Received: by 2002:a17:906:6944:: with SMTP id c4mr4783016ejs.96.1587683890906; Thu, 23 Apr 2020 16:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587683890; cv=none; d=google.com; s=arc-20160816; b=kSmQ8J7X5OkZoiEAHGN7VWpodxIxAoz4kj8BGJrmBqZvKGvG2EiYWzSCDOjbD6CaSa oAQ+NzvCCMhBdh2lCpe3uTNc3D8QAhFLPH+LePzWkunEJ238x1HTYXtGrTYvXB7nsJoG ztRg4NT/yK9a4IsM0y0FnEWErjblbIr9I+3zrPgS/rZVN7bYcwQXEc1BmvelsvCoDdNR s0YRFYtJKrdTTM7m+wXQ6X9k0apT0qYYziXSguHOBuuII7xBMTUWmxhVKek++49SmVkC iptudQnlD8pjbQn4PUF0cSkbTRhqTuAXWhPgCeLZRkpZwo6wWVm6LfAZAk88Wuq3YPme 2TJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Kr/I2rNy6Omk/7CQVsP2nRZjUTdeNLh8C8UxthSHYzQ=; b=EH7nZmFfqZ9zx4eEWXwAKvgEJaasLC9IZ1Tr6ZIFNafU6joQen8la8wMvYB0Ynu7jl JHTxJviHdgTyc4pupm9lW13W3nfpce0owsB6rRoNB6v9kLS6uWhUgGGt9YJB4uZwGdCQ oaI78gFtzIaj/bLuPxyN+XzFVAuiXD08chc3d/MBIVKFfb03wFRu66wvB9zdf9PuP3No jR8ylbE89sFrxp4+Ng06e4iFqg8DKog3wXobXx7v+jlOoxV08bRLKa18as5NTijxIwC2 BQTFKeYWlVhAczG5HstSB7J01YSveu4u2UkzKVhfh/QWRUMQrtGAeBhAIAYyVDKXFakd qj8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng3si2100246ejb.189.2020.04.23.16.17.48; Thu, 23 Apr 2020 16:18:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728423AbgDWXPk (ORCPT + 99 others); Thu, 23 Apr 2020 19:15:40 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49686 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbgDWXGr (ORCPT ); Thu, 23 Apr 2020 19:06:47 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvU-0004iX-BP; Fri, 24 Apr 2020 00:06:36 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvR-00E6ps-NY; Fri, 24 Apr 2020 00:06:33 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "David S. Miller" , "Jose Abreu" Date: Fri, 24 Apr 2020 00:06:02 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 135/245] net: stmmac: Enable 16KB buffer size In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ 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: Ben Hutchings --- 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 @@ -904,7 +904,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;