Module Name: src
Committed By: msaitoh
Date: Wed May 30 08:35:27 UTC 2018
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c
Log Message:
Clear que->disabled_count in {ixgbe,ixv}_init_locked(). Without this,
interrupt mask state and EIMS may mismatch and if_init doesn't recover
from TX/RX stall problem.
This change itself doesn't fix PR#53294.
To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/ixgbe/ixv.c
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.156 src/sys/dev/pci/ixgbe/ixgbe.c:1.157
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.156 Fri May 25 04:40:27 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c Wed May 30 08:35:26 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $ */
+/* $NetBSD: ixgbe.c,v 1.157 2018/05/30 08:35:26 msaitoh Exp $ */
/******************************************************************************
@@ -3794,6 +3794,7 @@ ixgbe_init_locked(struct adapter *adapte
struct ifnet *ifp = adapter->ifp;
device_t dev = adapter->dev;
struct ixgbe_hw *hw = &adapter->hw;
+ struct ix_queue *que;
struct tx_ring *txr;
struct rx_ring *rxr;
u32 txdctl, mhadd;
@@ -3809,6 +3810,8 @@ ixgbe_init_locked(struct adapter *adapte
hw->adapter_stopped = FALSE;
ixgbe_stop_adapter(hw);
callout_stop(&adapter->timer);
+ for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
+ que->disabled_count = 0;
/* XXX I moved this here from the SIOCSIFMTU case in ixgbe_ioctl(). */
adapter->max_frame_size =
Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.101 src/sys/dev/pci/ixgbe/ixv.c:1.102
--- src/sys/dev/pci/ixgbe/ixv.c:1.101 Fri May 25 04:40:27 2018
+++ src/sys/dev/pci/ixgbe/ixv.c Wed May 30 08:35:26 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.101 2018/05/25 04:40:27 ozaki-r Exp $*/
+/*$NetBSD: ixv.c,v 1.102 2018/05/30 08:35:26 msaitoh Exp $*/
/******************************************************************************
@@ -719,7 +719,7 @@ ixv_init_locked(struct adapter *adapter)
struct ifnet *ifp = adapter->ifp;
device_t dev = adapter->dev;
struct ixgbe_hw *hw = &adapter->hw;
- struct ix_queue *que = adapter->queues;
+ struct ix_queue *que;
int error = 0;
uint32_t mask;
int i;
@@ -729,6 +729,8 @@ ixv_init_locked(struct adapter *adapter)
hw->adapter_stopped = FALSE;
hw->mac.ops.stop_adapter(hw);
callout_stop(&adapter->timer);
+ for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
+ que->disabled_count = 0;
/* reprogram the RAR[0] in case user changed it. */
hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
@@ -798,7 +800,7 @@ ixv_init_locked(struct adapter *adapter)
/* Set up auto-mask */
mask = (1 << adapter->vector);
- for (i = 0; i < adapter->num_queues; i++, que++)
+ for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
mask |= (1 << que->msix);
IXGBE_WRITE_REG(hw, IXGBE_VTEIAM, mask);