NetBSD Problem Report #59174

From www@netbsd.org  Thu Mar 13 13:01:44 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A69991A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 13 Mar 2025 13:01:44 +0000 (UTC)
Message-Id: <20250313130143.1BC3E1A923C@mollari.NetBSD.org>
Date: Thu, 13 Mar 2025 13:01:43 +0000 (UTC)
From: uchiyama.yasushi@gmail.com
Reply-To: uchiyama.yasushi@gmail.com
To: gnats-bugs@NetBSD.org
Subject: ixg(4) pci_machdep.c setting mismatch
X-Send-Pr-Version: www-1.0

>Number:         59174
>Category:       kern
>Synopsis:       ixg(4) pci_machdep.c setting mismatch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 13 13:05:00 +0000 2025
>Originator:     UCHIYAMA Yasushi
>Release:        NetBSD 10.99.12
>Organization:
>Environment:
NetBSD diamond 10.99.12 NetBSD 10.99.12 (SICKLEMOON) #16: Wed Mar 12 12:32:46 UTC 2025  uch@diamond:/usr/src/sys/arch/amd64/compile/SICKLEMOON amd64
>Description:
INSPUR Intel X540-T2(X540-AT2)
HP ProLiant N54L

this machine have MSI but disabled @sys/arch/x86/pci_machdep.c
	/*
	 * Don't enable MSI on a HyperTransport bus.  In order to
	 * determine that bus 0 is a HyperTransport bus, we look at
	 * device 24 function 0, which is the HyperTransport
	 * host/primary interface integrated on most 64-bit AMD CPUs.
	 * If that device has a HyperTransport capability, bus 0 must
	 * be a HyperTransport bus and we disable MSI.
	 */
	if (24 < pci_bus_maxdevs(pc, 0)) {
		tag = pci_make_tag(pc, 0, 24, 0);
		if (pci_get_capability(pc, tag, PCI_CAP_LDT, NULL, NULL)) {
			pba->pba_flags &= ~PCI_FLAGS_MSI_OKAY;
			pba->pba_flags &= ~PCI_FLAGS_MSIX_OKAY;
		}
	}

In ixgbe_configure_interrupts()@ixbge.c, directly check the MSI-X.
	/* First try MSI-X */
	msgs = pci_msix_count(sc->osdep.pc, sc->osdep.tag);
pci_msix_count returns 64. so driver use MSI.
but pba->pba_flags PCI_FLAGS_MSI_OKAY|PCI_FLAGS_MSIX_OKAY were disabled.
then pci_msix_alloc_exact() returns ENODEV.

However, on this machine, enabling MSI on the HyperTransport bus @pci_machdep.c performs better (using MSI-X).

>How-To-Repeat:

>Fix:
diff -u -r1.354 ixgbe.c
--- ixgbe.c	10 Jul 2024 03:26:30 -0000	1.354
+++ ixgbe.c	12 Mar 2025 12:27:07 -0000
@@ -924,6 +924,17 @@
 	hw->mac.ops.set_lan_id(hw);
 	ixgbe_init_device_features(sc);

+	/* Check the host bridge functionality */
+	if (!(pa->pa_flags & PCI_FLAGS_MSI_OKAY)) {
+		sc->feat_cap &= ~(IXGBE_FEATURE_MSI | IXGBE_FEATURE_MSIX);
+		aprint_normal_dev (dev, "PCI host bridge does not "
+		    "support MSI. Use legacy interrupts.\n");
+	} else if (!(pa->pa_flags & PCI_FLAGS_MSIX_OKAY)) {
+		sc->feat_cap &= ~IXGBE_FEATURE_MSIX;
+		aprint_normal_dev (dev, "PCI host bridge does not "
+		    "support MSI-X. Drop MSI-X feature of card.\n");
+	}
+
 	if (ixgbe_configure_interrupts(sc)) {
 		error = ENXIO;
 		goto err_out;

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.