aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2010-11-08 21:50:50 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2010-11-08 21:50:50 +0000
commit483cc44070da1202b6dfdef9ca82972e449eafc7 (patch)
tree5f8ea671efb8d35afa34179f5634d7c21e38cc00 /sys/dev
parent6c96352a06f9e644b67eefb81afe0327b8e99a4e (diff)
downloadsrc-483cc44070da1202b6dfdef9ca82972e449eafc7.tar.gz
src-483cc44070da1202b6dfdef9ca82972e449eafc7.zip
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
Notes
Notes: svn path=/head/; revision=215017
Diffstat (limited to 'sys/dev')
-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 8f8cfa1b7727..0a2768ec9c17 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.