From owner-svn-src-stable@FreeBSD.ORG Mon Sep 27 17:12:54 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB0951065672; Mon, 27 Sep 2010 17:12:54 +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 C99598FC18; Mon, 27 Sep 2010 17:12:54 +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 o8RHCs7c043088; Mon, 27 Sep 2010 17:12:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8RHCs2E043086; Mon, 27 Sep 2010 17:12:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201009271712.o8RHCs2E043086@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 27 Sep 2010 17:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213209 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2010 17:12:55 -0000 Author: yongari Date: Mon Sep 27 17:12:54 2010 New Revision: 213209 URL: http://svn.freebsd.org/changeset/base/213209 Log: MFC r212755: Fix incorrect RX BD producer updates. The producer index was already updated after allocating mbuf so driver had to use the last index instead of using next producer index. This should fix driver hang which may happen under high network load. Reported by: Igor Sysoev rambler-co dot ru>, Vlad Galu dudu dot ro> Tested by: Igor Sysoev rambler-co dot ru>, Vlad Galu dudu dot ro> Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Sep 27 17:10:22 2010 (r213208) +++ stable/7/sys/dev/bge/if_bge.c Mon Sep 27 17:12:54 2010 (r213209) @@ -3469,9 +3469,11 @@ bge_rxeof(struct bge_softc *sc, uint16_t sc->bge_rx_saved_considx = rx_cons; bge_writembx(sc, BGE_MBX_RX_CONS0_LO, sc->bge_rx_saved_considx); if (stdcnt) - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, (sc->bge_std + + BGE_STD_RX_RING_CNT - 1) % BGE_STD_RX_RING_CNT); if (jumbocnt) - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo); + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, (sc->bge_jumbo + + BGE_JUMBO_RX_RING_CNT - 1) % BGE_JUMBO_RX_RING_CNT); #ifdef notyet /* * This register wraps very quickly under heavy packet drops.