Subject: CVS commit: src/sys/dev/pci
To: None <source-changes@NetBSD.org>
From: Jonathan Stone <jonathan@netbsd.org>
List: source-changes
Date: 08/22/2003 03:03:21
Module Name:	src
Committed By:	jonathan
Date:		Fri Aug 22 03:03:21 UTC 2003

Modified Files:
	src/sys/dev/pci: if_bge.c

Log Message:
Fix a bug in compaction of `DMA runt' fragmented packet chains:
if we m_dup() a packet to compactify it, and later run out of DMA
descriptors, bge_encap() will return ENOBUFS, hoping the driver will
try again later.  But we have just m_freem()'d the original chain
which was m_dup()'d, leaving a pointer to the just-freed packet header
in the tx queue.

Fix by always walking the chain, shuffling data towards the head;
except if we find a runt in the very last mbuf, we must borrow data
from its predecessor.

(Patch is verbatim from a third-party tree, apologies for any style woes.)


To generate a diff of this commit:
cvs rdiff -r1.44 -r1.45 src/sys/dev/pci/if_bge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.