Age | Commit message (Collapse) | Author |
|
from Seth Jackson
|
|
This reduces holes/padding and makes the structs smaller.
|
|
witness(4) has found that km_alloc will trigger an rw_enter via uvm_map
and vm_map_lock. While rw_enter is called with RW_SLEEPFAIL, there's
also an msleep in there, so it's easier to avoid getting in the middle
of that.
|
|
re-initializations of statically set fields. Move a common
chunk out of both clauses of if/else.
No intentional functional change.
ok sf@
|
|
* add some comments about virtio_enqueue_trim
* include mutex.h explicitly
* make VIRTIO_DEBUG == 1 less verbose in vioblk
ok krw@
|
|
the formats to add in the __func__ and "\n" being magically added by
DBGPRINT(). Fixes a few botches by certain devs who assumed DBGPRINT()
must be just like DPRINTF.
ok sf@ reyk@ on earlier version
|
|
that there will be resources for.
Protect request list with a mutex.
Makes everything much more scsi-like. Fewer splbio() dances. Uses
less memory and eliminates superfluous freeing and acquiring of the
same resources over and over.
ok sf@
|
|
This avoids breaking krw@'s ongoing work on improving virtio_enqueue_trim().
|
|
Use a SLIST instead of a SIMPLEQ and use LIFO instead of FIFO. This should
improve cache usage.
|
|
|
|
Remove MINSEG_INDIRECT as a tweakable define. Always use indirect
descriptors if we have more than 1 segment. Add a comment to document
the way if_vio.c uses maxnsegs in virtio_alloc_vq() to disable
indirect descriptors for a queue.
Based on a diff from krw@
|
|
to be. goto'ing upwards into an 'if' statement block
is weird.
ok sf@
|
|
use qe_desc_base instead of calculating the address again
|
|
If the device needs to be reset due to a poll timeout, we need accurate
information which requests are already completed. Otherwise, there will
be a panic "scsi_done called twice on xs", as found out by mpi@
|
|
'modern' scsi. Eliminates use of XS_NO_CCB.
Resource optimization to follow.
ok sf@, "makes sense" dlg@ earlier version
|
|
Port the logic to calculate the number of segments in virtqueue and
dmamaps from vioblk.
This fixes the virtqueue indirect descriptors being two entries too
small the dmamaps being much larger than necessary.
If the device does not support the required number of segments, refuse
to use it.
|
|
creating/destroying maps on each i/o.
ok sf@, "makes sense" dlg@ as part of larger diff.
|
|
(kernel part)
This feature is for OpenBSD guests only.
ok reyk, kettenis
|
|
when an operation was requested from vioblk host devices that is
not supported except on qemu).
|
|
|
|
From Nathanael Rensen, thanks!
|
|
From Nathanael Rensen, thanks!
|
|
While vioscsi does not support any virtio-scsi features, we need to call
virtio_negotiate_features() in order to negotiate device-independent
features like VIRTIO_F_RING_INDIRECT_DESC.
|
|
If there is not enough space in the vring, don't return
XS_DRIVER_STUFFUP but XS_NO_CCB, so that the operation will
be retried later.
|
|
Also, add some debug asserts all over the place.
|
|
This change handles various cases to power off the VM, even if it is
unresponsive, stuck in ddb, or when the shutdown was initiated from
the VM guest side. Usage of timeout and VM ACKs make sure that the VM
is really turned off at some point.
OK mlarkin@
|
|
|
|
|
|
The transmit completion notification is posted when the consumer index
becomes equal to the consumer event index. The code attempted to save
up on an update if the current value of the consumer index was below
its event index, but incorrectly handled the situation when they were
equal: the consumer event index wouldn't be advanced and the ring would
stall.
With help from Jan Schreiber who asked some good questions.
|
|
Some final touches before the release, increase the maximum
number of CAS iterations before we declare the grant table
entry lost forever. This happens on older Xen 3.x versions
as reported by Kirill Miazine.
|
|
ok mikeb@
|
|
Pointed out by jsg@ and Nathanael Rensen, <nathanael at
list ! polymorpheus ! com>, thanks!
|
|
|
|
|
|
When destroying the ring all transfers should be already gone so there
should be no need to repeat ourselves after xbf_stop has done its work.
Get rid of the yield() that was probably masking some issues that have
been since fixed.
|
|
|
|
|
|
|
|
intr_barrier(9) is useful to make sure that after an interrupt is
masked, the interrupt handler for the device has finished executing
before proceeding with further device configuration.
However, since Xen interrupt handlers run in the thread context, we
need to make sure that they have finished as well. By scheduling a
xen_barrier_task modelled after (or rather copied ;) ifq_barrier_task
we can ensure that the interrupt handler is no longer running.
|
|
An xnf & xbf attach/detach loop has revealed that sometimes when we're
about to free a grant table entry that is still in use which is a grave
mistake code wise. Turned out we could allocate an entry twice because
of an incorrect test that took flags value into account when making the
decision regarding availability of a given entry. At the same time,
upon releasing the entry we explicitly CAS in 0 into the flags making
this check bogus.
While here be explicit about starting flags by initializing them to 0
and always panic when the "double free" condition is encountered.
rzalamena@ has lent me his eyes and has double-checked the condition.
|
|
|
|
Now that we can attach and detach devices, we need to make sure we
can do so while interrupts are running. Thankfully, in the meantime
the refcnt_init(9) API came around to help us out.
|
|
|
|
|
|
|
|
of a shutdown. Correct a mistake in rev 1.11 to make this trigger a
shutdown again.
ok reyk@
|
|
|
|
an ifq to transmit a packet is picked by the current traffic
conditioner (ie, priq or hfsc) by providing an index into an array
of ifqs. by default interfaces get a single ifq but can ask for
more using if_attach_queues().
the vast majority of our drivers still think there's a 1:1 mapping
between interfaces and transmit queues, so their if_start routines
take an ifnet pointer instead of a pointer to the ifqueue struct.
instead of changing all the drivers in the tree, drivers can opt
into using an if_qstart routine and setting the IFXF_MPSAFE flag.
the stack provides a compatability wrapper from the new if_qstart
handler to the previous if_start handlers if IFXF_MPSAFE isnt set.
enabling hfsc on an interface configures it to transmit everything
through the first ifq. any other ifqs are left configured as priq,
but unused, when hfsc is enabled.
getting this in now so everyone can kick the tyres.
ok mpi@ visa@ (who provided some tweaks for cnmac).
|
|
This unbreaks build on archs that are non-pv but PCI because I moved
virtio out of files.pci but kept a virtio dependency for the
virtio_pci driver.
Issue report and fix suggested by visa@ and miod@
|
|
this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.
ok mpi@ deraadt@
|