summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-11-08 21:50:50 +0000
committeryongari <yongari@FreeBSD.org>2010-11-08 21:50:50 +0000
commitc9a9210a18d0843ecf409a8efd9f4a816a29ce37 (patch)
tree5f8ea671efb8d35afa34179f5634d7c21e38cc00 /sys/dev/re
parent1c59b818299a8bb91b6a779829970c2c175207e1 (diff)
downloadFreeBSD-src-c9a9210a18d0843ecf409a8efd9f4a816a29ce37.zip
FreeBSD-src-c9a9210a18d0843ecf409a8efd9f4a816a29ce37.tar.gz
Follow the lead of vendor's interrupt moderation mechanism.
It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt moderation mechanism but it is not documented at all. The magic value dramatically reduced number of interrupts without noticeable performance drops so apply it to all RTL8169/RTL8169 controllers. Vendor's FreeBSD driver also applies it to RTL810xE controllers but their Linux driver explicitly cleared the register, so do not enable interrupt moderation for RTL810xE controllers. While I'm here sort 8169 specific registers. Obtained from: RealTek FreeBSD driver
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 8f8cfa1..0a2768e 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2715,6 +2715,24 @@ re_init_locked(struct rl_softc *sc)
*/
re_set_rxmode(sc);
+ /* Configure interrupt moderation. */
+ if (sc->rl_type == RL_8169) {
+ switch (sc->rl_hwrev) {
+ case RL_HWREV_8100E:
+ case RL_HWREV_8101E:
+ case RL_HWREV_8102E:
+ case RL_HWREV_8102EL:
+ case RL_HWREV_8102EL_SPIN1:
+ case RL_HWREV_8103E:
+ CSR_WRITE_2(sc, RL_INTRMOD, 0);
+ break;
+ default:
+ /* Magic from vendor. */
+ CSR_WRITE_2(sc, RL_INTRMOD, 0x5151);
+ break;
+ }
+ }
+
#ifdef DEVICE_POLLING
/*
* Disable interrupts if we are polling.
OpenPOWER on IntegriCloud