From nobody Tue May 21 19:50:05 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 4VkQ596zyhz5M7GR; Tue, 21 May 2024 19:50:05 +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 4VkQ5968SRz46yl; Tue, 21 May 2024 19:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716321005; 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=6OhIc9BbZxRtnq63E3h6nJGX6Rktvebnq3f5ecfoVAY=; b=qvWYT9o/D1jO17+PrJsLrIE4pBX6GI4BA2ykkPTJ+NPK/H3kMrWoF1bgYkbn31YVXyFoUT 5uQWdWDKov9pDAmHND6R/2rEMAWrGWJaqQNzVbf/Nyb6C5LtdJXOUtEAtRSYVrolR0ULCY dE1j0WgW5zQ3i8MVRCvn9oon+zltdOw5REi2M5eiuM68aDeb/y3GVfpfz+Xc6wfPYcGpbZ /X339c1WYS9Pky2C73WjgA51OtxvexWF9hlYcAzqZCjMRZV/fDGDeKhMDdFVXHuN0A8NLz FiFq2vc3Oa+wHcAw3j315NqthrviItDtttzpLunAX5r9OEFJwmN+tIugDmy2gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716321005; a=rsa-sha256; cv=none; b=NBCenC8hcNEo2bfQNslbcgx9ZGp2XnaWLXLGSTQMLiGIhXBSaoxa5X8lMGMmqa0IDeQcK5 VD0HjOGzF73YKQI7hZyCnN+/wYsT2iXRaU0IJ2ew+X0LElcOIV5lnNzgL55jr7aljZrz5M AeOoEP2xK2IGlBnK2x3jxs/fg2pLorb1bsiw3MpEEmbVLvIevqN9pvrTlQA3uWOIKekief NQrK7958ZR4WDIp37L7X7PELGyPe7qELuTz3DVWB/Z02Wr3uA6mSvUa965zwxDdE2ZxNBM 5UmKio4FtlkfCIuEmZaYUZ6HGbESxxAz22RHvRBDUF7Nrl5h52Xl4bhfwadH1Q== 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=1716321005; 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=6OhIc9BbZxRtnq63E3h6nJGX6Rktvebnq3f5ecfoVAY=; b=SPqnTEBN/xhKcDe/ovjhq4R27pjK0sGw7udzrCAu5Sb5yRfADYWpIMPD7YKy/w3OpSH7KQ /NRog2jkkp+aZ58jokvoa0KcOzRJY1HNZNk9BFakpnU8uwRLHE6l5V0usCeZgsPXXZVxRf 3JInHlNL+p2wJ5XmbM0jgfR5Z4kmmYzMQ+l+qUIgSM/GXdYn7tE8zxFFW7MzwhsPRQsief Nc8xq8nYImPk8k6WngM3IOnmA7MOGMJsbGc+bMgy8fj69mKGdUnEvR14+Ocdf168M7kRI7 NimBJtrklesFXwECj406cfYKWr3W6ARBzG9v8v4Uy27mej1y1eXH3ccFzWkQeQ== 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 4VkQ595lwHzbJj; Tue, 21 May 2024 19:50:05 +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 44LJo5LS010798; Tue, 21 May 2024 19:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LJo59u010793; Tue, 21 May 2024 19:50:05 GMT (envelope-from git) Date: Tue, 21 May 2024 19:50:05 GMT Message-Id: <202405211950.44LJo59u010793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 07f3a9eb1c35 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 commit 07f3a9eb1c35cab2d371895f9ed5bc33d27e1815 Author: Lexi Winter AuthorDate: 2024-04-22 22:09:26 +0000 Commit: Warner Losh CommitDate: 2024-05-21 19:43:34 +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 be52822e1c51..2943be7063b5 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); /* @@ -1411,6 +1417,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 && @@ -1440,6 +1454,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; /*