git: b1c2fc54f32c - stable/13 - alc(4): disable MSI-X by default on Killer cards
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Oct 2024 16:10:13 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=b1c2fc54f32c2e670bb419230de917901d1dff6b
commit b1c2fc54f32c2e670bb419230de917901d1dff6b
Author: Lexi Winter <lexi@le-Fay.ORG>
AuthorDate: 2024-04-22 22:09:26 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
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;
/*