summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-10-18 01:02:30 +0000
committeradrian <adrian@FreeBSD.org>2014-10-18 01:02:30 +0000
commit31d0e366f3948008d50624abbae7e13133b6a613 (patch)
tree1014e3499b7e2bd2fe351c32b2092725ac42616b
parentc818e625dc84514f69227a9448ece1e5cb0a8a29 (diff)
downloadFreeBSD-src-31d0e366f3948008d50624abbae7e13133b6a613.zip
FreeBSD-src-31d0e366f3948008d50624abbae7e13133b6a613.tar.gz
MFC r273112: Set the DROP_EN bit before the RX queue is brought up and active.
He noticed issues setting this bit in SRRCTL after the queue was up, so doing it from the sysctl handler isn't enough and may not actually work correctly. This commit doesn't remove the sysctl path or try to change its behaviour. I'll talk with others about how to finish fixing that before I tackle that. PR: kern/194311 Submitted by: luigi MFC after: 3 days Sponsored by: Norse Corp, Inc
-rw-r--r--sys/dev/ixgbe/ixgbe.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index e87a496..1d9a1a9 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -4190,6 +4190,20 @@ ixgbe_initialize_receive_units(struct adapter *adapter)
srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
srrctl |= bufsz;
srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
+
+ /*
+ * Set DROP_EN iff we have no flow control and >1 queue.
+ * Note that srrctl was cleared shortly before during reset,
+ * so we do not need to clear the bit, but do it just in case
+ * this code is moved elsewhere.
+ */
+ if (adapter->num_queues > 1 &&
+ adapter->hw.fc.requested_mode == ixgbe_fc_none) {
+ srrctl |= IXGBE_SRRCTL_DROP_EN;
+ } else {
+ srrctl &= ~IXGBE_SRRCTL_DROP_EN;
+ }
+
IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl);
/* Setup the HW Rx Head and Tail Descriptor Pointers */
OpenPOWER on IntegriCloud