From nobody Tue Apr 23 04:52:51 2024 X-Original-To: dev-commits-src-all@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 4VNqVq4ZPxz5JQmK; Tue, 23 Apr 2024 04:52:51 +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 4VNqVq2d9gz4YYm; Tue, 23 Apr 2024 04:52:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713847971; 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=BDp06HwhGMXN8zHT8yHG/pwclzY980h+zySq8nsOE9s=; b=Z+kBjUDHCg/+gmZNhQVQg5weYfQ82FzEDcWtS12O+hBOXe8mL06EqkQC9wNJizM08FnDCm qAJvrqU2oucQ87QuLf8uuJzVtrF9HpmaGeBD6bIfjX096WoAC8118Q395cSwL2j9KSWY60 r2QXzS6ZHf9+QIgIYRL06Av4lj902kG2icHNB/JmGUq9B48mZOs5usaqVMn9cQwLhOUp4X LODkVaM6RxjPDEHX2lLyf+8u7ARz50oFMpogBMKxuV7Xc3m+G0G4PA/ZkjonNjwLsNwHaD Nb9eplioQ0nxP3AJJg6TTihpR4k9vY1mlHZoyV9uQztW7bWIqzLJVmdSulRrAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713847971; a=rsa-sha256; cv=none; b=U2USyPK1UhumJTd7wkBgHiCOnot/pcHCN+bpijWyS+aRdm/+yqoKte6BytXDOpm1qEh4k2 G+/+K0WC8GaOxuvbnqZcbhz51o56nbrFpWhG+m0yhuPI/6bAepz6N4dWKCrX640bC8Al1w fqfZegjmpcwckKOFnIFMeyh7xiNGZ1hlHIAspbTG7C5C+bFdS3Wwt94Na1RAN/XwRjzUWi l2pCXt2QX798JTcggkY+1s70LNOn6Sft7JksbtH0msKdBl18YgQcqJZwygzdXvAP9WB9u0 fNRTRhRg4P4kKL/F6cFeY/dICIRoRvDHmr//c2QbFG7ly8JDFf3kWKRYHPdXDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713847971; 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=BDp06HwhGMXN8zHT8yHG/pwclzY980h+zySq8nsOE9s=; b=azTUHP5Pg5xryY82wD2/GGvjGf3MkzwVFdz4KnaMGml2e0dZt8Azgll3mYGb7koQG1DC7p Vgyo6F0D9UsZ3TJ+yYu9yPzueXAjvjY0pvBDxWLC4up0tBvZ4BIjBWjB7XFNRNoDeTxRU3 gvsBbu8iEuKgDKxdLM9d0qxQp34QXmQPV/ufGVZDXwoNTWw6Oes4UIIp9U8X/wWDGBuQmU EBuf4vNVH72fTkjaNomGn3xn23ceOD1KPEsacK7yrJfJfwA4XBOZdQjucdjZS/8u0ltaRx fSXOWVGtowvq8sZDHxpgpPgI4Q6bcRCw2vlyei9ynNUDbkL+WJFpb/BspHu5gA== 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 4VNqVq1hrjzHp0; Tue, 23 Apr 2024 04:52:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43N4qphA064018; Tue, 23 Apr 2024 04:52:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43N4qp34064015; Tue, 23 Apr 2024 04:52:51 GMT (envelope-from git) Date: Tue, 23 Apr 2024 04:52:51 GMT Message-Id: <202404230452.43N4qp34064015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 05a95d19cb24 - main - alc(4): disable MSI-X by default on Killer cards List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05a95d19cb248203acdd4e069d3eedfe597c3b49 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=05a95d19cb248203acdd4e069d3eedfe597c3b49 commit 05a95d19cb248203acdd4e069d3eedfe597c3b49 Author: Lexi Winter AuthorDate: 2024-04-22 22:09:26 +0000 Commit: Warner Losh CommitDate: 2024-04-23 04:36:35 +0000 alc(4): disable MSI-X by default on Killer cards Several users with alc(4)-based "Killer" Ethernet cards have reported issues with this driver not passing traffic, which are solved by disabling MSI-X using the provided tunable. To work around this issue, disable MSI-X by default on this card. This is done by having msix_disable default to 2, which means "auto-detect". The user can still override this to either 0 or 1 as desired. Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's unlikely this will cause any practical performance issues; on the other hand, the card not working by default likely causes issues for many new FreeBSD users who find their network port doesn't work and have no idea why. PR: 230807 MFC after: 1 week Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1185 --- share/man/man4/alc.4 | 6 +++++- sys/dev/alc/if_alc.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/share/man/man4/alc.4 b/share/man/man4/alc.4 index 478558657799..5ce5ce97d68a 100644 --- a/share/man/man4/alc.4 +++ b/share/man/man4/alc.4 @@ -136,7 +136,11 @@ This tunable disables MSI support on the Ethernet hardware. The default value is 0. .It Va hw.alc.msix_disable This tunable disables MSI-X support on the Ethernet hardware. -The default value is 0. +The default value is 2, which means to enable or disable MSI-X based on the +card type; for "Killer" cards (E2x00) MSI-X will be disabled, while on other +cards it will be enabled. +Set this to 0 to force MSI-X to be enabled, or 1 to force it to be disabled +regardless of card type. .El .Sh SYSCTL VARIABLES The following variables are available as both diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index 86e120a8b3f6..86ae705667de 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -91,8 +91,14 @@ MODULE_DEPEND(alc, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; -static int msix_disable = 0; TUNABLE_INT("hw.alc.msi_disable", &msi_disable); + +/* + * The default value of msix_disable is 2, which means to decide whether to + * enable MSI-X in alc_attach() depending on the card type. The operator can + * set this to 0 or 1 to override the default. + */ +static int msix_disable = 2; TUNABLE_INT("hw.alc.msix_disable", &msix_disable); /* @@ -1410,6 +1416,14 @@ alc_attach(device_t dev) case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; + + /* + * Disable MSI-X by default on Killer devices, since this is + * reported by several users to not work well. + */ + if (msix_disable == 2) + msix_disable = 1; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && @@ -1439,6 +1453,14 @@ alc_attach(device_t dev) default: break; } + + /* + * The default value of msix_disable is 2, which means auto-detect. If + * we didn't auto-detect it, default to enabling it. + */ + if (msix_disable == 2) + msix_disable = 0; + sc->alc_flags |= ALC_FLAG_JUMBO; /*