From nobody Mon Mar 27 09:28:33 2023 X-Original-To: dev-commits-src-main@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 4PlSDK4pMsz4221y; Mon, 27 Mar 2023 09:28:33 +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 4PlSDK4HQWz4MHR; Mon, 27 Mar 2023 09:28:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679909313; 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=oEJy7Y0wJeE5eR2Jdepz2xKDaD0yu1z/3Fu65TSZEMs=; b=Oautlqk9Z343Lm/kIXBlAQeI/r70mtQNMR3FXKatlqAQ1q4qBl0SXnbm7QvoqgHmVzQR6s puGzoLzCScayICeIUvOjc3zF+qUjW5muKntpp9TPSuB9WZzCic755yE94qBYS0uED4Tuy3 m82/fKPN+Cu/ZwzfdkLVQ1HuRwQZfhu22P70OeCatvkonL2GuBuxXYoItmtFRRhgHmoxTH REJYPfZXigXqYzFWIzc+3y4RoIB3FWNPipdaTo14QTRDQ4YLvNuaXrl5/iT/kU8A5o/sAH qWv2Rox+AEN0W7qNKk4dk1eDu8C7by9P+Hg2JOHWMR5vg1OE+Vsg0ng3YNojng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679909313; 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=oEJy7Y0wJeE5eR2Jdepz2xKDaD0yu1z/3Fu65TSZEMs=; b=ZTE5QoHOggK5XT+H7Ck807ML6LVB1tla8r76mz/4SLFR2Cbrw56LA75+dLjIvei6YpZew4 SSoFMfB0WYSaS0agWHQ8tl6mUteznbaRJ/eJfLdXmpCMJ/rcJ6ISd7ZrYt8oWHQz18YBMy lMq4XloVV39amrwNDnfbJIymK7XucXFITCypg9TEvg3rBXnYTwHmdgBj9tF5f89MKsl2GH 9cvCRqKcBLA3rUCql1NsIbZ6cPPliePnwkTe5rEYwRGjSQh853hepFMA4lh4VDE3HaVEmT bmHKFXLPQQb+8hag/l7TTjh3puXdf+WWTncWXWJsBSgjdWK8CwNXW3KOMVnMRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679909313; a=rsa-sha256; cv=none; b=RYPkUNujuvydmgJsv1nPBHhhfGrmKrsKsTKwRfOnsL0kan+dFHtbRoB4HWX2pMN4Fg1gfp rxq/3IpBs00/D3peTmn/KnELd5FQj3fOmrVePKxnpPvSPhrKeEyV8YRzKl64L8YHkocaTz 7he0pKD/rvQF6Y0Fj35OC8kFr2L5PVpzBBWwyMf3dgl3jAzAb9cTeDlUGOLcfaseJTQMry zESKtKgqj7KHngfczrjSHC13x32tlyXucgJY3vYnVwJg0fJ5BUvX/BryTSnKJskvd90PIQ X8psLyw8Hqz4wPhpiElKmieC6A4SbqqkRXp28bYmHaKTI+x2DHLLIywsgxFwFQ== 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 4PlSDK3Kx4zGvy; Mon, 27 Mar 2023 09:28:33 +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 32R9SXnm060928; Mon, 27 Mar 2023 09:28:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32R9SXoV060927; Mon, 27 Mar 2023 09:28:33 GMT (envelope-from git) Date: Mon, 27 Mar 2023 09:28:33 GMT Message-Id: <202303270928.32R9SXoV060927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 48d70503bcae - main - pci: add tunable hw.pci.enable_mps_tune List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 48d70503bcae816eea6109c30ba79261eb47c9d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=48d70503bcae816eea6109c30ba79261eb47c9d0 commit 48d70503bcae816eea6109c30ba79261eb47c9d0 Author: Corvin Köhne AuthorDate: 2023-02-06 09:26:33 +0000 Commit: Corvin Köhne CommitDate: 2023-03-27 09:28:27 +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 --- 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 335c89423f24..92368f42608b 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -420,6 +420,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) { @@ -4452,7 +4457,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)