opnsense-src/sys
Adrian Chadd a4ec37f59e Ensure that there are enough TX mbuf ring slots available before beginning
to dequeue a packet.

The tx path was trying to ensure that enough Xenbus TX ring slots existed but
it didn't check to see whether the mbuf TX ring slots were also available.
They get freed in xn_txeof() which occurs after transmission, rather than earlier
on in the process. (The same happens under Linux too.)

Due to whatever reason (CPU use, scheduling, memory constraints, whatever) the
mbuf TX ring may not have enough slots free and would allocate slot 0. This is
used as the freelist head pointer to represent "free" mbuf TX ring slots; setting
this to an actual mbuf value rather than an id crashes the code.

This commit introduces some basic code to track the TX mbuf ring use and then
(hopefully!) ensures that enough slots are free in said TX mbuf ring before it
enters the actual work loop.

A few notes:

* Similar logic needs to be introduced to check there are enough actual slots
  available in the xenbuf TX ring. There's some logic which is invoked earlier
  but it doesn't hard-check against the number of available ring slots.
  Its trivial to do; I'll do it in a subsequent commit.

* As I've now commented in the source, it is likely possible to deadlock the
  driver under certain conditions where the rings aren't receiving any changes
  (which I should enumerate) and thus Xen doesn't send any further software
  interrupts. I need to make sure that the timer(s) are running right and
  the queues are periodically kicked.

PR:		134926
2009-05-27 02:49:08 +00:00
..
amd64 Don't bother reading the initial value of the machine check banks during 2009-05-20 16:11:22 +00:00
arm accumulate npe statistics and expose them through dev.npe.X.stats 2009-05-23 19:14:20 +00:00
boot Improve the accf_dns_load description. 2009-05-17 10:58:50 +00:00
bsm Merge OpenBSM 1.1 from OpenBSM vendor branch to head. 2009-04-19 16:17:13 +00:00
cam Remove dead code. 2009-05-12 16:38:32 +00:00
cddl Add the OpenSolaris dtrace lockstat provider. The lockstat provider 2009-05-26 20:28:22 +00:00
compat Remove an unused variable. 2009-05-24 18:35:53 +00:00
conf Add the ksyms(4) pseudo driver. The ksyms driver allows a process to 2009-05-26 21:39:09 +00:00
contrib tbr_timeout() is a timer driven function[1]. While the previous commit 2009-05-18 01:05:09 +00:00
crypto identify routine takes driver_t *, not device_t *. 2009-02-05 19:30:28 +00:00
ddb Prefer prototypes to k&r definitions. 2009-03-09 13:32:19 +00:00
dev Ensure that there are enough TX mbuf ring slots available before beginning 2009-05-27 02:49:08 +00:00
fs Fix the experimental nfs subsystem so that it builds with the 2009-05-26 22:21:53 +00:00
gdb Commit SYSINIT() ;-adding patch missed in previous pass. 2008-03-16 13:02:04 +00:00
geom - Unbreak 64 bit platforms by casting off_t to intmax. 2009-05-26 14:15:06 +00:00
gnu Remove empty files and do nto try to build them. 2009-05-18 17:20:24 +00:00
i386 We don't need d_thread_t for cross-branch portability here anymore. 2009-05-20 16:47:40 +00:00
ia64 Rename ia64_invalidate_icache() to ia64_sync_icache(). We're 2009-05-18 18:44:54 +00:00
isa Rename statclock_disable variable to atrtcclock_disable that it actually is, 2009-05-03 17:47:21 +00:00
kern Add the ksyms(4) pseudo driver. The ksyms driver allows a process to 2009-05-26 21:39:09 +00:00
kgssapi Fix build of KGSSAPI bits post-vimage. 2009-05-24 11:10:27 +00:00
legacy/dev Garbage collect legacy upgt driver now that it is available in the new 2009-05-13 17:11:25 +00:00
libkern Add memmove() to the kernel, making the kernel compile with Clang. 2009-02-28 16:21:25 +00:00
mips pmap_enter() *must* set PG_WRITEABLE on the given page if it creates a 2009-05-23 22:05:14 +00:00
modules Add the ksyms(4) pseudo driver. The ksyms driver allows a process to 2009-05-26 21:39:09 +00:00
net rev bpf attach/detach event api to include the dlt 2009-05-25 16:34:35 +00:00
net80211 Fix handling of devices w/o radiotap support: 2009-05-25 16:38:47 +00:00
netatalk Lock interface address list lock around ifaddr inserts and deletes 2009-04-19 22:01:38 +00:00
netgraph Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification. 2009-05-13 02:26:34 +00:00
netinet Correct the sense of a test so that this filter always waits for the full 2009-05-26 20:00:30 +00:00
netinet6 Implement UDP control block support. 2009-05-23 16:51:13 +00:00
netipsec Add sysctls to toggle the behaviour of the (former) IPSEC_FILTERTUNNEL 2009-05-23 16:42:38 +00:00
netipx Staticize spx_remque() now that it's only used from spx_reass.c. 2009-05-25 13:52:51 +00:00
netnatm Replace d_thread_t * with struct thread *. 2009-05-20 17:00:16 +00:00
netncp Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
netsmb Implement device cloning for /dev/nsmb, the netsmb control pseudo-device. 2008-11-03 14:23:15 +00:00
nfs Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
nfsclient Make sure we feed 32bit align memory to nfsm_dissect otherwise we will fault 2009-05-24 13:22:00 +00:00
nfsserver Fix build of KGSSAPI bits post-vimage. 2009-05-24 11:10:27 +00:00
nlm Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
opencrypto Fix cryptodev UIO creation. 2009-05-23 13:23:46 +00:00
pc98 Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
pci For RTL8139C+ controllers, have controller handle padding short 2009-04-20 07:13:04 +00:00
powerpc Set PG_WRITEABLE in Book-E pmap_enter[_locked] if it creates a mapping that 2009-05-26 06:24:50 +00:00
rpc Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00
security Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
sparc64 Add nge(4), nge(4) should work on all architectures. 2009-05-21 02:19:01 +00:00
sun4v Add cpu_flush_dcache() for use after non-DMA based I/O so that a 2009-05-18 18:37:18 +00:00
sys Add the ksyms(4) pseudo driver. The ksyms driver allows a process to 2009-05-26 21:39:09 +00:00
tools Add SDT DTrace probes for VFS vnode operations in the vfs:vop 2009-03-29 03:30:15 +00:00
ufs Make 'struct acl' larger, as required to support NFSv4 ACLs. Provide 2009-05-22 15:56:43 +00:00
vm - back out direct map hack 2009-05-19 01:14:37 +00:00
xdr Add memmove() to the kernel, making the kernel compile with Clang. 2009-02-28 16:21:25 +00:00
xen Fix the Xen build for i386 PV mode. 2009-04-01 17:06:28 +00:00
Makefile Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00