Module Name: src
Committed By: msaitoh
Date: Mon Aug 17 07:59:06 UTC 2020
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h
Log Message:
Re-enabling interrupt is required only when a work is scheduled form the
interrput context.
To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/ixgbe/ixgbe.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.237 src/sys/dev/pci/ixgbe/ixgbe.c:1.238
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.237 Mon Aug 17 07:26:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c Mon Aug 17 07:59:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.237 2020/08/17 07:26:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.238 2020/08/17 07:59:06 msaitoh Exp $ */
/******************************************************************************
@@ -3173,9 +3173,10 @@ ixgbe_msix_admin(void *arg)
}
if (task_requests != 0) {
+ /* Re-enabling other interrupts is done in the admin task */
+ task_requests |= IXGBE_REQUEST_TASK_NEED_ACKINTR;
atomic_or_32(&adapter->task_requests, task_requests);
ixgbe_schedule_admin_tasklet(adapter);
- /* Re-enabling other interrupts is done in the admin task */
} else {
/* Re-enable other interrupts */
IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
@@ -4802,11 +4803,13 @@ ixgbe_handle_admin(struct work *wk, void
#endif
}
atomic_store_relaxed(&adapter->admin_pending, 0);
- if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
- /* Re-enable other interrupts */
- IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
- } else
- ixgbe_enable_intr(adapter);
+ if ((req & IXGBE_REQUEST_TASK_NEED_ACKINTR) != 0) {
+ if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
+ /* Re-enable other interrupts */
+ IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
+ } else
+ ixgbe_enable_intr(adapter);
+ }
IXGBE_CORE_UNLOCK(adapter);
IFNET_UNLOCK(ifp);
@@ -5210,6 +5213,8 @@ ixgbe_legacy_irq(void *arg)
reenable_intr = false;
}
if (task_requests != 0) {
+ /* Re-enabling other interrupts is done in the admin task */
+ task_requests |= IXGBE_REQUEST_TASK_NEED_ACKINTR;
atomic_or_32(&adapter->task_requests, task_requests);
ixgbe_schedule_admin_tasklet(adapter);
reenable_intr = false;
Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.68 src/sys/dev/pci/ixgbe/ixgbe.h:1.69
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.68 Mon Aug 17 07:26:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.h Mon Aug 17 07:59:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.68 2020/08/17 07:26:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.69 2020/08/17 07:59:06 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -768,6 +768,7 @@ bool ixgbe_rxeof(struct ix_queue *);
#define IXGBE_REQUEST_TASK_FDIR 0x08
#define IXGBE_REQUEST_TASK_PHY 0x10
#define IXGBE_REQUEST_TASK_LSC 0x20
+#define IXGBE_REQUEST_TASK_NEED_ACKINTR 0x80
/* For NetBSD */
const struct sysctlnode *ixgbe_sysctl_instance(struct adapter *);