summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bgereg.h
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-11-19 23:04:49 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-11-19 23:04:49 +0000
commit9ee030d166954ee9f2e8a6eb27dc210c97c415c9 (patch)
tree231476c5471705baf81cf151f79208ac83ac6a6b /sys/dev/pci/if_bgereg.h
parent98d8ec722dc1f84eb7bdfda92701982e3198bc77 (diff)
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(). From jonathan NetBSD tested by krw@, sturm@ and I on a few different bge NICs.
Diffstat (limited to 'sys/dev/pci/if_bgereg.h')
-rw-r--r--sys/dev/pci/if_bgereg.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index d0962d8a1a0..8ab2b8f0344 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.30 2005/10/09 23:41:55 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.31 2005/11/19 23:04:48 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2328,6 +2328,7 @@ struct bge_softc {
u_int16_t bge_rx_saved_considx;
u_int16_t bge_ev_saved_considx;
u_int16_t bge_return_ring_cnt;
+ u_int32_t bge_tx_prodidx;
u_int16_t bge_std; /* current std ring head */
u_int16_t bge_jumbo; /* current jumo ring head */
SLIST_HEAD(__bge_jfreehead, bge_jpool_entry) bge_jfree_listhead;