From nobody Wed Apr 05 08:08:43 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pry241sYjz443xm; Wed, 5 Apr 2023 08:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pry236rtsz4D77; Wed, 5 Apr 2023 08:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680682124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VEMIjmJHs6BrB/F3/aACxfY2em5/rhKg+9Co+qOXp8=; b=MZ3zqzquEhOSKqiVSox8wM0u2ZQfORiN24CIATlilDiBKLXguVBWcBf+N9pT/9urDlokU/ Ii85MuZiubbUWr0blFByQ3V07ZR15t0tsDSRo2LZO9u7sG3jc1LFjkQBIariQqmT+qTMDT /6JKrMkOwT5WQ+UF80MfphZ3LURBCgwty/Xt1HumGwmTWy/+ZdAb2Hy4ZiLfk8MTTtfLPb NpPFKT6lKKs+HWGoK+kSEGze95kY8sgPavbAA7bGHRMTTmB769n1+UJNU/lF3Ybnw3biDb 9jmM0GKm77vcBAM1CV8nPe16cT0TdSyYnEtGYaZrOqs9Jadbcw9oFeLpent83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680682124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VEMIjmJHs6BrB/F3/aACxfY2em5/rhKg+9Co+qOXp8=; b=sjOCvjJLurQ9KjrRhDjlYs1VIqNnUZF3NCoXBmc/TAOHL3Hi6ftqbQ2Xyz47srfeuWiKRC 0PHRcJcOZm2ucI4GTouLjPMwOcw1SsiSuUVii1vRwiN0hW9LRPGWhEEZM/dmRNDSc58D+s x496WsPvXF9079TNtydpGmphxSptLzjxKmkiycPML1k35DI8/bTJxDRvZz3azkg7dxvF26 mTygESfZKFZmFCyFO9tKfxc3r5rt4+tWUgjLvkTktAJkFqAt13N4INZ21rra87ZfZ0EuhH LQBznlW2z2H4NZzwHB48NHnjOm+OC7CxOz5ptvr5SpY/N/Xp0ko6uZa14CxvMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680682124; a=rsa-sha256; cv=none; b=heW0sRur3WPXNKovznXjil4V8pRaoNCTtc4jwWNehK8g6Jd7LBhcPp2jEQ6vG90TH8Rkyx Qga+VqQB8T3ors7BtqkLzYpmacuwpqI6vJ+HCHmG+EOciQI38aVWtUplp0tmv/B+Fih+M2 2Q103h0drWc1RNJK4gxQZ8u098gUKdse3yAcp4mYHFORUALEyyv6uJzY8EBqDW3Y0BHZ/e ibKODSN7yUZJK4S5zi8/2rRWnr06MNG1K/mGkwhd9J73m9aOHoHSAgCBQ84HxJJOAppSe1 iW1bylPz18sL0S08lXzKmp4k/11CxzAhCTyEMNSHqlTAOjmnFgPQoZ5Pzioq+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pry235xHmzFCK; Wed, 5 Apr 2023 08:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33588hIF044265; Wed, 5 Apr 2023 08:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33588hFG044264; Wed, 5 Apr 2023 08:08:43 GMT (envelope-from git) Date: Wed, 5 Apr 2023 08:08:43 GMT Message-Id: <202304050808.33588hFG044264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: df7798be4e38 - stable/13 - pci: add tunable hw.pci.enable_mps_tune List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df7798be4e388fe6d40184021c8885f5d43b769b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=df7798be4e388fe6d40184021c8885f5d43b769b commit df7798be4e388fe6d40184021c8885f5d43b769b Author: Corvin Köhne AuthorDate: 2023-02-06 09:26:33 +0000 Commit: Corvin Köhne CommitDate: 2023-04-05 07:15:26 +0000 pci: add tunable hw.pci.enable_mps_tune If the tunable is set to 0, the tuning of the MPS (maximum payload size) is disabled and the default MPS values set by the BIOS are used. In this case the system may use a lower speed or operate in a less optimized state, but it can resolve issues with stability and compatibility. With specific devices the tuning of the mps, can lead to a complete freeze of the system. Reviewed by: manu MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38397 (cherry picked from commit 48d70503bcae816eea6109c30ba79261eb47c9d0) --- sys/dev/pci/pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 97f6f4da1821..b38311e41d84 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -421,6 +421,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_aer_on_attach, CTLFLAG_RWTUN, &pci_clear_aer_on_attach, 0, "Clear port and device AER state on driver attach"); +static bool pci_enable_mps_tune = true; +SYSCTL_BOOL(_hw_pci, OID_AUTO, enable_mps_tune, CTLFLAG_RWTUN, + &pci_enable_mps_tune, 1, + "Enable tuning of MPS(maximum payload size)." ); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -4453,7 +4458,8 @@ pci_add_child(device_t bus, struct pci_devinfo *dinfo) pci_cfg_restore(dev, dinfo); pci_print_verbose(dinfo); pci_add_resources(bus, dev, 0, 0); - pcie_setup_mps(dev); + if (pci_enable_mps_tune) + pcie_setup_mps(dev); pci_child_added(dinfo->cfg.dev); if (pci_clear_aer_on_attach)