opnsense-src/sys/dev
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
..
advansys Fix typo (accessable --> accessible). 2000-06-14 17:53:40 +00:00
agp Add support for Intel's i810 chipset with integrated graphics. An 2000-07-12 10:13:07 +00:00
aha Fix typo (accessable --> accessible). 2000-06-14 17:53:40 +00:00
ahb Fix typo (accessable --> accessible). 2000-06-14 17:53:40 +00:00
aic Terminate aic_ids[] 2000-06-19 22:16:14 +00:00
aic7xxx *smack* #if 0, not #ifdef 0. 2000-08-04 18:17:45 +00:00
amd Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
amr The AMI MegaRAID's internal memory map conflicts with scatter/gather 2000-06-10 19:22:39 +00:00
an MF4: fix style(9) whitespace breakage. 2000-08-08 23:53:11 +00:00
ar Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
ata Rearrange the probe a bit, hopefully this will help to eleminate 2000-08-16 07:09:04 +00:00
atkbdc Fix GENERIC_MOUSE_ENTRY. 2000-07-28 03:48:46 +00:00
awi awictl configuration interface is never used and now it is replaced by 2000-08-14 14:10:10 +00:00
bktr Update to driver 2.14. Adds new Tuner types for Hauppauge WinTV cards 2000-06-28 15:09:12 +00:00
buslogic Fix typo (accessable --> accessible). 2000-06-14 17:53:40 +00:00
cardbus Sync to latest cardbusdevs file 1999-11-18 07:22:59 +00:00
ccd Move the truncation code out of vn_open and into the open system call 2000-07-04 03:34:11 +00:00
cs Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
cy Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
dc Close PR 20438. Make fix for preserving LED settings conditional on 2000-08-07 17:03:20 +00:00
de Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
dec Add missing $FreeBSD$ 2000-05-01 19:54:26 +00:00
dgb Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
dpt Fix some warnings. Here are more part-time volatiles - ie: data that 2000-08-07 18:44:05 +00:00
ed - Fixed the conversion to bus_space interface. 2000-08-17 12:15:45 +00:00
eisa Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
en Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
ep Properly detect ISA cards in EISA mode and skip them in the ISA identify 2000-07-18 06:37:08 +00:00
ex Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
fb Unused include: #include "fb.h" 2000-06-10 06:41:11 +00:00
fdc Avoid a '"fd" is usurping ...' message. 2000-08-09 12:45:04 +00:00
fe Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
fxp Fix a bug brought to light by the people working on SMPng. I don't quite 2000-08-11 17:47:55 +00:00
hea Remove un-needed #include's. 2000-01-17 20:49:59 +00:00
hfa Ensure that DMA mappings are freed in error situations. 2000-01-15 21:01:04 +00:00
ic Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
ida The DEC version of the Smart controller has its configuration information 2000-07-27 22:24:44 +00:00
ie Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
iicbus Allow these drivers to be detached. 2000-06-16 07:20:29 +00:00
isp Add a comment as to where stdarg.h applies. 2000-08-03 03:05:50 +00:00
ispfw Roll back target mode f/w to 7.55- 7.65 hangs when presented with a 2000-07-17 00:34:52 +00:00
joy Add ADS7182 as a known Joystick. 2000-01-18 08:38:35 +00:00
kbd Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, because 2000-05-28 12:43:24 +00:00
lmc Adjust to accomodate recent changes to the rcvdata and rcvmsg 2000-05-01 03:31:58 +00:00
lnc Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
mc146818 Add missing $FreeBSD$ 2000-05-01 19:54:26 +00:00
mca Set the RF_SHAREABLE flage when we allocate an IRQ. 2000-03-13 11:43:53 +00:00
mcd Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
md Rename MDNSECT to MD_NSECT and declare it as something that isn't 2000-07-17 13:13:04 +00:00
mii Added Altima Communications OUI and their AC101 10/100 2000-06-21 19:26:01 +00:00
mlx Add support for 2.x/3.x firmware adapters which are too old to have a 2000-08-04 06:52:00 +00:00
mse - `Newbus'ified the driver. 2000-03-18 15:13:30 +00:00
musycc Add transmit buffer limitation depending on actual bandwidth. 2000-07-22 17:08:52 +00:00
null Small style change; make function names less likely to clash with 2000-07-09 12:29:24 +00:00
nulldev Small style change; make function names less likely to clash with 2000-07-09 12:29:24 +00:00
pccard Define get_memory_offset method 2000-08-11 15:51:51 +00:00
pcf Remove ~25 unneeded #include <sys/conf.h> 2000-04-19 14:58:28 +00:00
pci Nuke the useless chip driver. It gets in the way when you want to load 2000-06-09 16:00:29 +00:00
pcic Call bus_generic_detach on pcic before deleting the children. This 2000-08-19 05:01:07 +00:00
pdq Uh, ya, sure this almost compiled for __bsdi__. NOT! 2000-05-21 05:33:40 +00:00
ppbus Remove an unused variable warning. 2000-07-18 20:16:36 +00:00
ppc Add support for the PC87303 chipset (found on Miata alphas) and add 2000-07-20 09:28:07 +00:00
random o Fix a horrible bug where small reads (< 8 bytes) would return the 2000-07-25 21:18:47 +00:00
randomdev o Fix a horrible bug where small reads (< 8 bytes) would return the 2000-07-25 21:18:47 +00:00
ray Add attribute memory setup warnings 2000-07-11 21:31:59 +00:00
rc Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
rp - Eliminate rpread(). Call generic ttyread(). (cf rev 1.33) 2000-06-12 15:21:59 +00:00
scd Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
sf Close PR# 19904: remember to call sf_setmulti() when initializing the 2000-07-14 19:11:02 +00:00
si Always leave SP_DCEN on (monitor DCD). Otherwise the firmware *really* 2000-01-25 16:45:54 +00:00
sio Add another USR modem. 2000-08-15 21:03:28 +00:00
sk Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
smbus Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00
sn Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
snp Unstaticize this driver. You can have as many snoop devices as you can 2000-04-02 00:35:37 +00:00
sound This patch appears to solve the problems with recording resulting 2000-08-13 19:20:02 +00:00
speaker Add PnP probe methods to some common AT hardware drivers. In each case, 2000-06-23 07:44:33 +00:00
sr Mass update of isa drivers using compatability shims to use 2000-05-28 13:40:48 +00:00
streams Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
sym - Various comment fixes and additions. 2000-07-02 21:26:50 +00:00
syscons o Fix a horrible bug where small reads (< 8 bytes) would return the 2000-07-25 21:18:47 +00:00
tdfx Bring tdfx_pci.c in sync with some patches I have been testing. Adds better 2000-08-01 05:10:29 +00:00
ti Replace the mbuf external reference counting code with something 2000-08-19 08:32:59 +00:00
twe Remove some confusing verbosity - we have no idea what RAID level the 2000-07-20 02:31:56 +00:00
tx Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
usb CAM, the module: scbus, da, cd, and st wrapped in one module. 2000-08-13 18:49:40 +00:00
vinum open_drive: 2000-08-16 04:31:37 +00:00
vn Add snapshots to the fast filesystem. Most of the changes support 2000-07-11 22:07:57 +00:00
vr Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
vx Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
wi Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
wl Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00
xe Make all Ethernet drivers attach using ether_ifattach() and detach using 2000-07-13 22:54:34 +00:00