freebsd-nq/sys/pci
David Malone a5c4836d39 Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR:		19866
Submitted by:	Bosko Milekic <bmilekic@dsuper.net>
Reviewed by:	alfred (glanced at by others on -net)
2000-08-19 08:32:59 +00:00
..
agp_ali.c A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
agp_amd.c Release resources properly in detach. 2000-06-10 17:53:20 +00:00
agp_i810.c Add support for Intel's i810 chipset with integrated graphics. An 2000-07-12 10:13:07 +00:00
agp_if.m A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
agp_intel.c A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
agp_sis.c A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
agp_via.c A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
agp.c Add support for Intel's i810 chipset with integrated graphics. An 2000-07-12 10:13:07 +00:00
agppriv.h Add support for Intel's i810 chipset with integrated graphics. An 2000-07-12 10:13:07 +00:00
agpreg.h Add support for Intel's i810 chipset with integrated graphics. An 2000-07-12 10:13:07 +00:00
agpvar.h A driver for programming the AGP hardware. This is only very lightly 2000-06-09 16:04:30 +00:00
alpm.c Remove ~25 unneeded #include <sys/conf.h> 2000-04-19 14:58:28 +00:00
amd.c Remove ~25 unneeded #include <sys/conf.h> 2000-04-19 14:58:28 +00:00
amd.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
cy_pci.c Ahhrggg. Put the test for the compat shims AFTER the file that includes 2000-03-27 20:24:02 +00:00
cy_pcireg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
dc21040reg.h s/Id/FreeBSD/ 1999-08-09 12:52:49 +00:00
ide_pcireg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_ar_p.c Ahhrggg. Put the test for the compat shims AFTER the file that includes 2000-03-27 20:24:02 +00:00
if_dc.c Close PR 20438. Make fix for preserving LED settings conditional on 2000-08-07 17:03:20 +00:00
if_dcreg.h Grrrr. Add definition for DC_WDOG_CTLWREN. I made this change yesterday 2000-08-02 16:31:11 +00:00
if_de.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_devar.h Use bus_space for all register accesses. 2000-05-13 18:47:24 +00:00
if_en_pci.c Ahhrggg. Put the test for the compat shims AFTER the file that includes 2000-03-27 20:24:02 +00:00
if_fxp.c Fix a bug brought to light by the people working on SMPng. I don't quite 2000-08-11 17:47:55 +00:00
if_fxpreg.h Added support for the i82559ER (10/100Mbps NIC for embedded applications). 2000-06-18 10:26:09 +00:00
if_fxpvar.h Added support for cards and on-motherboard NICs that use an SEEPROM 2000-03-28 04:41:42 +00:00
if_mn.c Newbusify this driver at an expense of 40 extra lines of code. 2000-07-10 19:33:41 +00:00
if_rl.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_rlreg.h Make some tweaks to the RealTek driver: 1999-10-21 19:42:03 +00:00
if_sf.c Close PR# 19904: remember to call sf_setmulti() when initializing the 2000-07-14 19:11:02 +00:00
if_sfreg.h Modify the Adaptec "starfire" driver to reset the PHY on the MII bus 1999-12-05 20:02:45 +00:00
if_sis.c sis_miibus_writereg() was checking for SIS_TYPE_900 and phy != 0 twice 2000-07-14 05:30:48 +00:00
if_sisreg.h Add support for the National Semiconductor DP83815 fast ethernet 2000-07-06 06:02:04 +00:00
if_sk.c Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
if_skreg.h Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
if_sr_p.c Ahhrggg. Put the test for the compat shims AFTER the file that includes 2000-03-27 20:24:02 +00:00
if_ste.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_stereg.h Spruce up the Sundance ST201 driver: 1999-12-07 20:14:42 +00:00
if_ti.c Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
if_tireg.h Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
if_tl.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_tlreg.h Make some small performance tweaks to the tl driver. This should hopefully 1999-09-19 22:39:24 +00:00
if_tx.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_txvar.h Added support for SMC9432BTX cards. 2000-06-21 19:19:49 +00:00
if_vr.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_vrreg.h Close PR# 19617: add support for VIA VT6102 NICs to VIA Rhine driver. 2000-07-05 21:37:21 +00:00
if_wb.c Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
if_wbreg.h Convert the Adaptec and Winbond drivers to miibus. 1999-08-30 23:08:32 +00:00
if_wx.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_wxreg.h Fix this driver to (finally) work with switches. Some more black 2000-06-16 06:28:31 +00:00
if_wxvar.h Fix this driver to (finally) work with switches. Some more black 2000-06-16 06:28:31 +00:00
if_xl.c Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
if_xlreg.h Update the xl driver to recognize yet another 3c905B/3c905C class NIC: 1999-12-16 18:33:57 +00:00
intpm.c Fix some leakage from inside #ifdef PCI_COMPAT (the FreeBSD 2.2 compat 2000-05-28 16:17:18 +00:00
intpmreg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
isp_pci.c Part of major rewrite for core version 2.0- clarification of 2000-08-01 05:16:49 +00:00
locate.pl use warnings 2000-06-27 22:41:12 +00:00
meteor_reg.h Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
meteor.c Ahhrggg. Put the test for the compat shims AFTER the file that includes 2000-03-27 20:24:02 +00:00
ncr.c ncr.c is no longer a COMPAT_OLDPCI device - remove the warning. 2000-05-28 10:45:06 +00:00
ncrreg.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ohci_pci.c Only display the 'Disable PNP-OS BIOS option' message on the i386 arch. 2000-05-11 20:17:28 +00:00
pccbb.c Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pccbbreg.h Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pccbbvar.h Initial import of cardbus bridge driver (cbb) from the latest 1999-11-18 07:14:54 +00:00
pci_compat.c Encapsulate the old PCI compatability support and APIs completely under 2000-05-28 16:35:57 +00:00
pci_if.m * Factor out the object system from new-bus so that it can be used by 2000-04-08 14:17:18 +00:00
pci.c Nuke the useless chip driver. It gets in the way when you want to load 2000-06-09 16:00:29 +00:00
pcic_p.c Make this compile without depending on the FreeBSD 2.2 compatability 2000-05-28 16:31:35 +00:00
pcic_p.h Make this compile without depending on the FreeBSD 2.2 compatability 2000-05-28 16:31:35 +00:00
pcireg.h Encapsulate the old PCI compatability support and APIs completely under 2000-05-28 16:35:57 +00:00
pcisupport.c Add the ESS Solo-1 to generic chip match. 2000-08-03 13:46:52 +00:00
pcivar.h Nuke the useless chip driver. It gets in the way when you want to load 2000-06-09 16:00:29 +00:00
scsiiom.c Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
simos.c Separate the struct bio related stuff out of <sys/buf.h> into 2000-05-05 09:59:14 +00:00
simos.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ti_fw2.h Use a custom Tigon 2 firmware image, hopefully temporarily. This is 2000-07-26 23:55:34 +00:00
ti_fw.h Update the Tigon driver to support 1000baseTX gigE over copper AceNIC 2000-07-20 22:24:43 +00:00
uhci_pci.c Add 440MX chipset. 2000-05-24 02:24:38 +00:00
xmaciireg.h Reoganize/update the SysKonnect driver: 2000-04-22 02:16:41 +00:00
xrpu.c Do not depend on FreeBSD 2.2 compatability defines. 2000-05-28 16:18:58 +00:00