summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2011-01-12 03:43:47 +0000
committeryongari <yongari@FreeBSD.org>2011-01-12 03:43:47 +0000
commit6881e65a56456c051544dbadb22bf0a7910aad6f (patch)
tree718b8ac23a6f407412ef75e61d7d4dd0901d8cee /sys/dev/re
parent3af73385cb78ed044e3181252a5e7e66e70bc767 (diff)
downloadFreeBSD-src-6881e65a56456c051544dbadb22bf0a7910aad6f.zip
FreeBSD-src-6881e65a56456c051544dbadb22bf0a7910aad6f.tar.gz
For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E),
limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of blindly configuring it to 16KB. Due to lack of documentation, re(4) didn't allow jumbo frame on these controllers. However it seems controller is confused with jumbo frame such that it can DMA the received frame to wrong address instead of splitting it into multiple RX buffers. Of course, this caused panic. Since re(4) does not support jumbo frames on these controllers, make controller drop frame that is longer than RE_RX_DESC_BUFLEN sized frame. Fortunately RTL810x controllers, which do not support jumbo frame, have no such issues but this change also limited maximum RX buffer size allowed to RTL810x controllers. Allowing 16KB RX buffer for controllers that have no such capability is meaningless. MFC after: 3 days
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 13e3514..c0816fc 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -2777,8 +2777,13 @@ re_init_locked(struct rl_softc *sc)
* For 8169 gigE NICs, set the max allowed RX packet
* size so we can receive jumbo frames.
*/
- if (sc->rl_type == RL_8169)
- CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383);
+ if (sc->rl_type == RL_8169) {
+ if ((sc->rl_flags & (RL_FLAG_PCIE | RL_FLAG_NOJUMBO)) ==
+ (RL_FLAG_PCIE | RL_FLAG_NOJUMBO))
+ CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN);
+ else
+ CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383);
+ }
if (sc->rl_testmode)
return;
OpenPOWER on IntegriCloud