Received: with ECARTIS (v1.0.0; list netdev); Sat, 24 Dec 2005 12:02:31 -0800 (PST) Received: from mail.dvmed.net (mail.dvmed.net [216.237.124.58]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id jBOK2Q8n010124 for ; Sat, 24 Dec 2005 12:02:26 -0800 Received: from cpe-069-134-188-146.nc.res.rr.com ([69.134.188.146] helo=[10.10.10.88]) by mail.dvmed.net with esmtpsa (Exim 4.52 #1 (Red Hat Linux)) id 1EqFXB-0000OL-Fl; Sat, 24 Dec 2005 19:58:30 +0000 Message-ID: <43ADA862.6010906@pobox.com> Date: Sat, 24 Dec 2005 14:58:26 -0500 From: Jeff Garzik User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Linus Torvalds CC: Manfred Spraul , Ayaz Abdulla , Linux Kernel Mailing List , Netdev Subject: Re: [PATCH] forcedeth: fix random memory scribbling bug References: <43AD4ADC.8050004@colorfullife.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4744 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 726 Lines: 33 Linus Torvalds wrote: > However, that > > "skb->end - skb->data" > > calculation is a bit strange. It correctly maps the whole skb, but nod > wouldn't it make more sense to use the length we actually tell the card to > use? > > In other words, wouldn't it be a whole lot more sensible and logical to > use > > np->rx_buf_sz > > instead? That's the value we use for allocation and that's the size we > tell the card we have. That's the sort of thing I prefer. > Of course, on the alloc path, it seems to add an additional > "NV_RX_ALLOC_PAD" thing, so maybe the "end-data" thing makes sense. None of the other ethernet drivers do 'end - data', which is why I hesitated quite a bit on this change. Jeff