Subject: CVS commit: src/sys/dev/pci
To: None <source-changes@NetBSD.org>
From: Jonathan Stone <jonathan@netbsd.org>
List: source-changes
Date: 11/15/2005 06:05:44
Module Name: src
Committed By: jonathan
Date: Tue Nov 15 06:05:44 UTC 2005
Modified Files:
src/sys/dev/pci: if_bge.c if_bgereg.h
Log Message:
Correct a performance bug from Bill Paul's original FreeBSD bge(4) driver:
Each call to the FreeBSD bge_start() routine the transmit producer
pointer index from the chip mailbox register BGE_MBX_TX_HOST_PROD0_LO.
The local copy of that value is then updated by bge_encap() as
bge_encap() encapsulates packets in the Tx ring. If bge_encap()
succeds in encpuslating one or more packets, bge_start() tells the
chip to start sending the newly-encinitiates writes the new value back
to the chip mailbox register.
However, comparison of the Linux drivers (Broadcom-supplied and
open-source tg3.c) and to the OpenSolaris driver confirms that
register BGE_MBX_TX_HOST_PROD0_LO is write-only to software.
Thus, we can just keep a copy in the softc, and eliminate the
(expensive) PCI register write on each call to bge_start().
``Make it so''.
To generate a diff of this commit:
cvs rdiff -r1.93 -r1.94 src/sys/dev/pci/if_bge.c
cvs rdiff -r1.26 -r1.27 src/sys/dev/pci/if_bgereg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.