Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2011 17:41:24 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r217647 - releng/8.2/sys/dev/re
Message-ID:  <201101201741.p0KHfOel022269@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Thu Jan 20 17:41:24 2011
New Revision: 217647
URL: http://svn.freebsd.org/changeset/base/217647

Log:
  MFC r217296:
    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.
  
  Approved by:	re (bz)

Modified:
  releng/8.2/sys/dev/re/if_re.c
Directory Properties:
  releng/8.2/sys/   (props changed)
  releng/8.2/sys/amd64/include/xen/   (props changed)
  releng/8.2/sys/cddl/contrib/opensolaris/   (props changed)
  releng/8.2/sys/contrib/dev/acpica/   (props changed)
  releng/8.2/sys/contrib/pf/   (props changed)

Modified: releng/8.2/sys/dev/re/if_re.c
==============================================================================
--- releng/8.2/sys/dev/re/if_re.c	Thu Jan 20 17:28:57 2011	(r217646)
+++ releng/8.2/sys/dev/re/if_re.c	Thu Jan 20 17:41:24 2011	(r217647)
@@ -2779,8 +2779,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101201741.p0KHfOel022269>