From: Jeff Garzik Subject: Re: [PATCH] cleanup large frame handling for natsemi.c Date: Sun, 20 Jun 2004 14:38:55 -0400 Sender: netdev-bounce@oss.sgi.com Message-ID: <20040620183855.GA26392@havoc.gtf.org> References: <40D57FC3.9040008@colorfullife.com> <20040620163036.GD16038@havoc.gtf.org> <40D5BE9B.9040106@colorfullife.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@oss.sgi.com Return-path: To: Manfred Spraul Content-Disposition: inline In-Reply-To: <40D5BE9B.9040106@colorfullife.com> Errors-to: netdev-bounce@oss.sgi.com List-Id: netdev.vger.kernel.org On Sun, Jun 20, 2004 at 06:43:07PM +0200, Manfred Spraul wrote: > @@ -1909,9 +1916,13 @@ > np->dirty_rx = 0; > np->cur_rx = RX_RING_SIZE; > np->oom = 0; > - np->rx_buf_sz = PKT_BUF_SZ; > - if (dev->mtu > ETH_DATA_LEN) > - np->rx_buf_sz += dev->mtu - ETH_DATA_LEN; > + if (dev->mtu <= ETH_DATA_LEN) > + np->rx_buf_sz = ETH_DATA_LEN + NATSEMI_HEADERS; > + else > + np->rx_buf_sz = dev->mtu + NATSEMI_HEADERS; > + if (np->rx_buf_sz > NATSEMI_RX_LIMIT) > + np->rx_buf_sz = NATSEMI_RX_LIMIT; > + Double NAK: 1) Use PKT_BUF_SZ, don't alloc smaller than that. 2) The final check should not be needed. The code should guarantee that np->rx_buf_sz never exceeds NATSEMI_RX_LIMIT. Jeff