From owner-svn-src-all@FreeBSD.ORG Thu Jan 20 17:42:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C3E1065673; Thu, 20 Jan 2011 17:42:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28208FC1C; Thu, 20 Jan 2011 17:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0KHgghj022347; Thu, 20 Jan 2011 17:42:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0KHggnj022345; Thu, 20 Jan 2011 17:42:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101201742.p0KHggnj022345@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Jan 2011 17:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217648 - releng/7.4/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 17:42:43 -0000 Author: yongari Date: Thu Jan 20 17:42:42 2011 New Revision: 217648 URL: http://svn.freebsd.org/changeset/base/217648 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/7.4/sys/dev/re/if_re.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/re/if_re.c ============================================================================== --- releng/7.4/sys/dev/re/if_re.c Thu Jan 20 17:41:24 2011 (r217647) +++ releng/7.4/sys/dev/re/if_re.c Thu Jan 20 17:42:42 2011 (r217648) @@ -2773,8 +2773,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;