summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2016-11-21 12:37:35 +0000
committermikeb <mikeb@openbsd.org>2016-11-21 12:37:35 +0000
commit1fd388b8b2fc185c67a0e1319abe74ead2dccab0 (patch)
tree4e3306205f7c5ae3fe4e98581a9bd506fae43041
parentCorrect the test for requiring a 64 bit mem bar. (diff)
downloadwireguard-openbsd-1fd388b8b2fc185c67a0e1319abe74ead2dccab0.tar.xz
wireguard-openbsd-1fd388b8b2fc185c67a0e1319abe74ead2dccab0.zip
Correctly set the default value for the FCRTH
X540 datasheet specifies that Flow Control Receive Threshold High should be set to the Rx Buffer Size minus the delay value which is different for different modes of operation, however the minimum is 0x6000 (24576). Mirrors the bc1fc64fd2d9093496e5b04c6d94d26bfa629c9c commit to the Linux source code, but picked up from the 280182 commit to FreeBSD.
-rw-r--r--sys/dev/pci/ixgbe.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/ixgbe.c b/sys/dev/pci/ixgbe.c
index 6304f0480bc..b2913205040 100644
--- a/sys/dev/pci/ixgbe.c
+++ b/sys/dev/pci/ixgbe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ixgbe.c,v 1.19 2016/11/17 21:08:27 mikeb Exp $ */
+/* $OpenBSD: ixgbe.c,v 1.20 2016/11/21 12:37:35 mikeb Exp $ */
/******************************************************************************
@@ -2287,10 +2287,11 @@ int32_t ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
/*
* In order to prevent Tx hangs when the internal Tx
* switch is enabled we must set the high water mark
- * to the maximum FCRTH value. This allows the Tx
- * switch to function even under heavy Rx workloads.
+ * to the Rx packet buffer size - 24KB. This allows
+ * the Tx switch to function even under heavy Rx
+ * workloads.
*/
- fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 32;
+ fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 0x6000;
}
IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), fcrth);