From nobody Mon Oct 28 16:10:13 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 4Xcddd20t0z5bVqg; Mon, 28 Oct 2024 16:10:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcddd1SxBz45bb; Mon, 28 Oct 2024 16:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730131813; 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=blSYExY82ds9ZhDJqR2ZWtzq1T9sTkoEbSpcS9tvFp0=; b=UoAVLuouXJhzlYVHP2vhhtt6fYTjJH2pL9x0vizxGqDhLSN0fOGDvPon5AT+YVHd7g8XHD nGoIFBPW8mBvv+7DnQiH2J8ZnRgIVCSTFfLTOZUPIYNL5bMsEJnjX7vDHwYVdj9FaRPK/v RX/TiuNkx+3vtk8UmZHaE8fY+8QLWZELC67SgYNKw8BF0VLCLgQexb4HJyLpX7lT05UmCM Yocu51ZXMXjmVhvTbxAYOso2pezXziqx5J732llVU6u2QllJTAVWAwSXOhPZW30pEm61N4 a8WvyrN5VwjQV5qvP9Ap/+tqaTjLgTgLt9697gIQTNTSldEzkbC2azGF35+uww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730131813; 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=blSYExY82ds9ZhDJqR2ZWtzq1T9sTkoEbSpcS9tvFp0=; b=IEkiRhfyAP1+S5hYB2z8shkBQvFB13/bH9V9Ho+bPajvYgB2UkN6FU9XhyGc4JVcezFCU5 1jc7QyYTMJZN80K9u25uV7vzoxiWBj/f1Ca3E8kFPMlfcb0lx6m6b0y+Ll9fYmO4YCW1b2 vlrmkcCoPL5yXBl9igKMwR08yLDyGoNoxjTFJIg+g1k4pmbJLaOcAib9+FCfFdqAGk/63z NDngYCM/M/V0EAk2afhmj4nael9HEkI8UUPQyUSYkx2TBRwRgCMhJ9MymQi/7sivF9iM9Q /uxSA7UGLdOij95SbBXQF8c5HGCI//Uou17eIZ6y/W/2KXsYi4jeJy4I3QHc9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730131813; a=rsa-sha256; cv=none; b=WjDO33smE7fL0Fi6NiPK6tBIxqruaEWrckd0BNTF/6BEA4VZi51/n0no/S4KrID5Mdz4C1 BNHfuOnDdhiH6iPM6+A4oWTldsKt3/HX3kTtYQS4+pMlYVKPTkYa7IrsFr13ZkokasTdYu G0LsccA90RWcUlNDnQ0ytPVWVCzb/0GapvQcS9z7DNAYyp9DCJNrAAjBb3F6sdygaXx+hw Gjy7Ejiitaxd/G9ubDddClZ9xwJ+lt5AuJ/xumLp2nt0LZO+d8W/x6d6BzgH+il9yjpbOI UmQdSw/W6zV5r+7DviQ3HvfM8+2M31g0LJErqdo39RAqUqsvtqrnsWMWK3mLGA== 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 4Xcddd0xBWzlZW; Mon, 28 Oct 2024 16:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49SGADWO054140; Mon, 28 Oct 2024 16:10:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49SGADAr054135; Mon, 28 Oct 2024 16:10:13 GMT (envelope-from git) Date: Mon, 28 Oct 2024 16:10:13 GMT Message-Id: <202410281610.49SGADAr054135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b1c2fc54f32c - stable/13 - 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b1c2fc54f32c2e670bb419230de917901d1dff6b Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b1c2fc54f32c2e670bb419230de917901d1dff6b commit b1c2fc54f32c2e670bb419230de917901d1dff6b Author: Lexi Winter AuthorDate: 2024-04-22 22:09:26 +0000 Commit: Mark Johnston CommitDate: 2024-10-28 16:09:41 +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 (cherry picked from commit 05a95d19cb248203acdd4e069d3eedfe597c3b49) --- 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 e6c0470d48c7..b1fdb55b1109 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -92,8 +92,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); /* @@ -1413,6 +1419,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 && @@ -1442,6 +1456,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; /*