summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2022-05-31 14:03:26 +0000
committermartin <martin@NetBSD.org>2022-05-31 14:03:26 +0000
commitf3c0f41d841a04898079bc793aaafe77c0200358 (patch)
tree799b59b4c6eca44f07977a8acd9a1feb1ef2836c
parent52883f2cc5611f71e13bcb992f4090c304596b23 (diff)
Pull up following revision(s) (requested by msaitoh in ticket #1458):
sys/dev/pci/ixgbe/ixv.c: revision 1.181 sys/dev/pci/ixgbe/ixgbe.c: revision 1.315 sys/dev/pci/ixgbe/ixgbe.h: revision 1.86 Fix a bug that the legacy interrupt doesn't work when MSI-X allocation failed. Fixes PR kern/56857. Remove unused adapter->msix_mem.
-rw-r--r--sys/dev/pci/ixgbe/ixgbe.c14
-rw-r--r--sys/dev/pci/ixgbe/ixgbe.h3
-rw-r--r--sys/dev/pci/ixgbe/ixv.c5
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/dev/pci/ixgbe/ixgbe.c b/sys/dev/pci/ixgbe/ixgbe.c
index a3f26874e55..d10c3dcfe27 100644
--- a/sys/dev/pci/ixgbe/ixgbe.c
+++ b/sys/dev/pci/ixgbe/ixgbe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $ */
/******************************************************************************
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1096,7 +1096,6 @@ ixgbe_attach(device_t parent, device_t dev, void *aux)
ixgbe_free_queues(adapter);
/* Fallback to legacy interrupt */
- adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
if (adapter->feat_cap & IXGBE_FEATURE_MSI)
adapter->feat_en |= IXGBE_FEATURE_MSI;
adapter->num_queues = 1;
@@ -5054,7 +5053,7 @@ ixgbe_enable_intr(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask);
/* With MSI-X we use auto clear */
- if (adapter->msix_mem) {
+ if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
/*
* We use auto clear for RTX_QUEUE only. Don't use other
* interrupts (e.g. link interrupt). BTW, we don't use
@@ -5086,7 +5085,7 @@ ixgbe_disable_intr_internal(struct adapter *adapter, bool nestok)
/* disable interrupts other than queues */
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~IXGBE_EIMC_RTX_QUEUE);
- if (adapter->msix_mem)
+ if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0);
for (int i = 0; i < adapter->num_queues; i++, que++)
@@ -6743,6 +6742,7 @@ ixgbe_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
adapter->osdep.nintrs) != 0) {
aprint_error_dev(dev,
"failed to allocate MSI-X interrupt\n");
+ adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
return (ENXIO);
}
@@ -6942,7 +6942,7 @@ ixgbe_configure_interrupts(struct adapter *adapter)
if (msgs < 2)
goto msi;
- adapter->msix_mem = (void *)1; /* XXX */
+ adapter->feat_en |= IXGBE_FEATURE_MSIX;
/* Figure out a reasonable auto config value */
queues = (ncpu > (msgs - 1)) ? (msgs - 1) : ncpu;
@@ -6996,7 +6996,7 @@ msi:
adapter->feat_en &= ~IXGBE_FEATURE_SRIOV;
msgs = pci_msi_count(adapter->osdep.pc, adapter->osdep.tag);
- adapter->msix_mem = NULL; /* XXX */
+ adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
if (msgs > 1)
msgs = 1;
if (msgs != 0) {
diff --git a/sys/dev/pci/ixgbe/ixgbe.h b/sys/dev/pci/ixgbe/ixgbe.h
index 0ccc1eac61d..4ce94441cc4 100644
--- a/sys/dev/pci/ixgbe/ixgbe.h
+++ b/sys/dev/pci/ixgbe/ixgbe.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.56.2.7 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe.h,v 1.56.2.8 2022/05/31 14:03:27 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -479,7 +479,6 @@ struct adapter {
struct if_percpuq *ipq; /* softint-based input queues */
struct resource *pci_mem;
- struct resource *msix_mem;
/* NetBSD: Interrupt resources are in osdep */
diff --git a/sys/dev/pci/ixgbe/ixv.c b/sys/dev/pci/ixgbe/ixv.c
index f0233f12b7f..f14aa757c7f 100644
--- a/sys/dev/pci/ixgbe/ixv.c
+++ b/sys/dev/pci/ixgbe/ixv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.125.2.18 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ixv.c,v 1.125.2.19 2022/05/31 14:03:26 martin Exp $ */
/******************************************************************************
@@ -35,7 +35,7 @@
/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.18 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.19 2022/05/31 14:03:26 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -3487,7 +3487,6 @@ ixv_configure_interrupts(struct adapter *adapter)
return -1;
}
- adapter->msix_mem = (void *)1; /* XXX */
aprint_normal_dev(dev,
"Using MSI-X interrupts with %d vectors\n", msgs);
adapter->num_queues = queues;