Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3691221ybv; Mon, 10 Feb 2020 04:47:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwuMzeAERx2w9/nnEHSURJcegDvYDkqUwMctpKhEF+rtDpjBhmYqYAzxufpqI+XIFCly0Yp X-Received: by 2002:aca:5094:: with SMTP id e142mr670202oib.101.1581338854874; Mon, 10 Feb 2020 04:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581338854; cv=none; d=google.com; s=arc-20160816; b=tOsGePFbu3lzJKlWFr8p1zM5gfeWDj6kLmU04vbkpqGWCgJ1NpZtttGBgxDazYgIzw lvAhoxW3zq1AnqNWCkxFLkZfbjrdg4YYYtfKPePylhIQtxZyjQJbw8Qk2KP25UynFJ8I ehD71J5H3UmwYQSB3CoGXZOY0ZyOyWP+eJC+rNgghJhun0o3xFmzyvR7vSwq5+i6oWPS nwlm3nHeMR3lxYU3ApSJm8EXmA9OuGtfdlfeqCov0IQfIFYki7HVLIAw4ip1HSCl4Tf5 CYgSjshgAog1diIZTN5AZ835IH9io9z58e3G7f4GDlSAoj0XHxGjxjSlYBxfz/zGqima W95Q== 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=DRZjIMdxB0CqUdlh2FbSgRhn6jnoVVG5ZkqHyaEQAak=; b=weeSmUP8QIBt3OGw9hRByqsTU5Wy5IDy1NrIpOfI3oxfm5TRF5OoOvhb8m7Jhn5WWJ qCbazERRlsjCQbMG7ZHyK8nFUnHeRPLJoS9LueAlSTO+kdRj3b5KE/7mKysPnETC1Wge wUOKMrl5lNfMq568pU7Y99GWovC/7ML12utesdJ9EvVwXlC5giKm2f/w+PArIo1D8Sx7 nWUszz/Dy+sTKgclm6oKnKxwcIZgvcqSaFXpG89iujAr2rA3p+K69VpjXCHsmzCCuAzC vgFC1C5XOY3nEzpGZgJB+kBUupJ9yoM11TdHphaNCeFQxJsG6xv+bg5r/9CbLgyrHXC1 vxxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RdAO1yVL; 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 u13si166225otg.56.2020.02.10.04.47.23; Mon, 10 Feb 2020 04:47:34 -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=RdAO1yVL; 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 S1727989AbgBJMrP (ORCPT + 99 others); Mon, 10 Feb 2020 07:47:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:45772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbgBJMmF (ORCPT ); Mon, 10 Feb 2020 07:42:05 -0500 Received: from localhost (unknown [209.37.97.194]) (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 5B71320838; Mon, 10 Feb 2020 12:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338525; bh=q0jTh8NA67CL22jjqtJ3TlVzbORChLP+p/Zwt+T7Fl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RdAO1yVLEQgk0HR06rSl7GFg47lFl+IAdbyLegs+QalL1Rg5X1ygHmrXe9jCX0YmF 3odCNYoy4LSnWCxmofakrWCHiS1FG2G7USax3QmgokA2+47Hq056CH8g+8PG0M9b2E /Qp6TIfn/sqZUFeq4dVdYrLA9jme0sPSdak525+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" Subject: [PATCH 5.5 345/367] r8169: fix performance regression related to PCIe max read request size Date: Mon, 10 Feb 2020 04:34:18 -0800 Message-Id: <20200210122454.429284951@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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: Heiner Kallweit [ Upstream commit 21b5f672fb2eb1366dedc4ac9d32431146b378d3 ] It turned out that on low performance systems the original change can cause lower tx performance. On a N3450-based mini-PC tx performance in iperf3 was reduced from 950Mbps to ~900Mbps. Therefore effectively revert the original change, just use pcie_set_readrq() now instead of changing the PCIe capability register directly. Fixes: 2df49d365498 ("r8169: remove fiddling with the PCIe max read request size") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169_main.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -3865,15 +3865,18 @@ static void rtl_hw_jumbo_enable(struct r switch (tp->mac_version) { case RTL_GIGA_MAC_VER_12: case RTL_GIGA_MAC_VER_17: + pcie_set_readrq(tp->pci_dev, 512); r8168b_1_hw_jumbo_enable(tp); break; case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: + pcie_set_readrq(tp->pci_dev, 512); r8168c_hw_jumbo_enable(tp); break; case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28: r8168dp_hw_jumbo_enable(tp); break; case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: + pcie_set_readrq(tp->pci_dev, 512); r8168e_hw_jumbo_enable(tp); break; default: @@ -3903,6 +3906,9 @@ static void rtl_hw_jumbo_disable(struct break; } rtl_lock_config_regs(tp); + + if (pci_is_pcie(tp->pci_dev) && tp->supports_gmii) + pcie_set_readrq(tp->pci_dev, 4096); } static void rtl_jumbo_config(struct rtl8169_private *tp, int mtu)