From owner-svn-src-all@FreeBSD.ORG Thu Nov 27 02:33:14 2008 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 337E21065677; Thu, 27 Nov 2008 02:33:14 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id E27FB8FC20; Thu, 27 Nov 2008 02:33:13 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=daemon.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1L5Wgq-0005qX-DJ; Thu, 27 Nov 2008 10:33:12 +0800 Message-ID: <492E06E7.7060205@micom.mng.net> Date: Thu, 27 Nov 2008 10:33:11 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.12 (X11/20080415) MIME-Version: 1.0 To: Jack F Vogel References: <200811270218.mAR2Ih2g072971@svn.freebsd.org> In-Reply-To: <200811270218.mAR2Ih2g072971@svn.freebsd.org> X-Enigmail-Version: 0.95.6 OpenPGP: id=78F6425E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185355 - head/sys/dev/e1000 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, 27 Nov 2008 02:33:14 -0000 Jack F Vogel wrote: > Author: jfv > Date: Thu Nov 27 02:18:43 2008 > New Revision: 185355 > URL: http://svn.freebsd.org/changeset/base/185355 > > Log: > Thanks to the reminder from Ganbold, small fix in the RX failure > path for an infinite loop. Problem originally noticed in ixgbe > by Jeff Roberson and fixed there. Thanks to everyone involved. > > Modified: > head/sys/dev/e1000/if_igb.c > > Modified: head/sys/dev/e1000/if_igb.c > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Thu Nov 27 01:57:23 2008 (r185354) > +++ head/sys/dev/e1000/if_igb.c Thu Nov 27 02:18:43 2008 (r185355) > @@ -3490,12 +3490,11 @@ igb_setup_receive_ring(struct rx_ring *r > return (0); > fail: > /* > - * We need to clean up any buffers allocated so far > - * 'j' is the failing index, decrement it to get the > - * last success. > + * We need to clean up any buffers allocated > + * so far, 'j' is the failing index. > */ > - for (--j; j < 0; j--) { > - rxbuf = &rxr->rx_buffers[j]; > + for (int i = 0; i < j; i++) { > + rxbuf = &rxr->rx_buffers[i]; > Thanks, it was CID: 2232. Ganbold > if (rxbuf->m_head != NULL) { > bus_dmamap_sync(rxr->rxtag, rxbuf->map, > BUS_DMASYNC_POSTREAD); > @@ -3516,9 +3515,9 @@ static int > igb_setup_receive_structures(struct adapter *adapter) > { > struct rx_ring *rxr = adapter->rx_rings; > - int i, j; > + int j; > > - for (i = 0; i < adapter->num_rx_queues; i++, rxr++) > + for (j = 0; j < adapter->num_rx_queues; j++, rxr++) > if (igb_setup_receive_ring(rxr)) > goto fail; > > @@ -3527,14 +3526,13 @@ fail: > /* > * Free RX buffers allocated so far, we will only handle > * the rings that completed, the failing case will have > - * cleaned up for itself. The value of 'i' will be the > - * failed ring so we must pre-decrement it. > + * cleaned up for itself. Clean up til 'j', the failure. > */ > - rxr = adapter->rx_rings; > - for (--i; i > 0; i--, rxr++) { > - for (j = 0; j < adapter->num_rx_desc; j++) { > + for (int i = 0; i < j; i++) { > + rxr = &adapter->rx_rings[i]; > + for (int n = 0; n < adapter->num_rx_desc; n++) { > struct igb_buffer *rxbuf; > - rxbuf = &rxr->rx_buffers[j]; > + rxbuf = &rxr->rx_buffers[n]; > if (rxbuf->m_head != NULL) { > bus_dmamap_sync(rxr->rxtag, rxbuf->map, > BUS_DMASYNC_POSTREAD); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > -- Don't abandon hope. Your Captain Midnight decoder ring arrives tomorrow.