freebsd-dev/sys/dev/xen
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
..
balloon Fix the Xen build for i386 PV mode. 2009-04-01 17:06:28 +00:00
blkback Last step of splitting up minor and unit numbers: remove minor(). 2009-01-28 17:57:16 +00:00
blkfront Merge in support for Xen HVM on amd64 architecture. 2009-03-11 15:30:12 +00:00
console Disable some un-needed console debugging. 2009-05-18 04:50:31 +00:00
evtchn merge 186535, 186537, and 186538 from releng_7_xen 2008-12-29 06:31:03 +00:00
netback Adds support for SCTP checksum offload. This means 2009-02-03 11:00:43 +00:00
netfront Ensure that there are enough TX mbuf ring slots available before beginning 2009-05-27 02:49:08 +00:00
pcifront
xenpci Merge in support for Xen HVM on amd64 architecture. 2009-03-11 15:30:12 +00:00