Subject: Re: CVS commit: src/sys/dev/pci
To: None <source-changes@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: source-changes
Date: 11/02/2006 00:10:36
On Wed, Nov 01, 2006 at 06:11:18PM +0000, Izumi Tsutsui wrote:
> 
> Module Name:	src
> Committed By:	tsutsui
> Date:		Wed Nov  1 18:11:18 UTC 2006
> 
> Modified Files:
> 	src/sys/dev/pci: if_vge.c
> 
> Log Message:
> Fix another botch in rev 1.14:
> vge_encap() should bail out if there is not enough free
> TX descriptor _OR_ TX descriptor is still owned by the chip.
> 
> Anyway, we already check if the TX descriptor already has an mbuf
> to be sent in vge_start() so no need to bother to check sc_tx_free
> and VGE_TDSTS_OWN in the descriptor in normal case, then make it use
> KASSERT(9) or wrap with #ifdef DIAGNOSTIC.
> 
> XXX1: I don't know why original FreeBSD driver checks
>       if a number of free TX descriptors is more than two, not zero.

It is because a typical mbuf chain is about three segments long, so you
need at least three descriptors unless you are willing to copy three
segments into one.

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933