summaryrefslogtreecommitdiff
path: root/sys/dev/pv
AgeCommit message (Collapse)Author
2016-08-05Switch pending event clearing to an atomic swap operationMike Belopuhov
Rather than performing an atomic bit clearing for every encountered event bit set we can adjust the code to perform an atomic swap of a single row of the events array and decrease the amount of expensive atomic operations. Same optimization as for Hyper-V. From FreeBSD.
2016-08-05Switch pending event clearing to an atomic swap operationMike Belopuhov
Rather than performing an atomic bit clearing for every encountered event bit set we can adjust the code to perform an atomic swap of a single row of the events array and decrease the amount of expensive atomic operations. From FreeBSD.
2016-08-05Fixup incorrect EAGAIN handlingMike Belopuhov
2016-08-05Read events array offset must be calculated in bytesMike Belopuhov
2016-08-05Remove incorrect optimization: ring data portion size is not power of 2Mike Belopuhov
2016-08-05Trigger link state update only on media status updatesMike Belopuhov
2016-08-05Fixup the condition that prevented heartbeat & co. from attachingMike Belopuhov
2016-08-03Use atomic operations to manipulate event masking bitsMike Belopuhov
2016-08-03Remove the periodic timer and do rescheduling during Rx completionMike Belopuhov
This change adds a check into the Rx ring completion routine that schedules an interrupt task to be executed immediately after if consumer index has already advanced itself. The benefit of doing this compared to an additional loop after replenishing the ring (as done in FreeBSD for example) is that first of all this goes through the loop in the taskqueue thread with a yeild check to prevent CPU hogging and second is that it triggers Tx completion as well since interrupt handler runs both.
2016-08-03Use an atomic operation to clear pending event bitsMike Belopuhov
Pending event bits are located in a shared memory and are potentially accessed by multiple CPUs running dom0 and the guest VM. It appears that a failure to synchronize changes to this shared memory leads to race conditions resulting in the guest missing out on notifications.
2016-08-01Don't forget to destroy the taskqueue on interrupt disestablishMike Belopuhov
2016-08-01Mark shared producer and consumer indices volatileMike Belopuhov
2016-07-29Add a periodic timer to workaround missing completion eventsMike Belopuhov
2016-07-29Disable receive ring slot accountingMike Belopuhov
In the Netfront case it appears that by having scheduler decide when to run the workload we don't need to involve additional mechanisms to artificially limit resource availability to achieve better performance under heavy load. On the contrary, by performing a single pass through Rx and Tx completion rings and having scheduler decide when to run the next attempt, we limit the amount of time spent in the packet processing and achieve system responsiveness.
2016-07-29Move xen interrupt handlers to dedicated task queuesMike Belopuhov
Handling receive and transmit for multiple networking interfaces in a "shared interrupt" within normal interrupt vector code path introduces too much delay from the hypervisor POV which prevents it from injecting further completion event interrupts for Rx and Tx queues. Additionally, Netfront backend driver includes a mechanism to detect Rx ring stalls and "turn the carrier off" when the guest is not replenishing the ring (e.g. due to missing completion interrupts) that relies on guest waking up periodically and making sure that the Rx ring completion handling is progressing. Having tried both task queue + timeout and interrupts + timeout approaches, it appears that using the task queue is more flexible and provides superior performance under heavy network load.
2016-07-29Loop until we've read all available responsesMike Belopuhov
2016-07-29Update TX completion event index when putting a packet on the ringMike Belopuhov
2016-07-29Reduce the amount of sent RX producer notifications; from FreeBSDMike Belopuhov
2016-07-29Reduce the amount of sent TX producer notifications; from FreeBSDMike Belopuhov
2016-07-28Remove top level ring processing loops as too ambiguousMike Belopuhov
2016-07-28Revert previous commitMike Belopuhov
2016-07-28Convert ifq_deq_{begin,rollback,commit} dance to a single ifq_dequeueMike Belopuhov
2016-07-27zero sizeof a struct not sizeof the pointer to itJonathan Gray
ok mikeb@
2016-07-21Remove a few debugging leftoversMike Belopuhov
2016-07-13A work-in-progress driver for the Hyper-V NetVSCMike Belopuhov
Network VSC is an RNDIS device using NVSP protocol to communicate with the Hyper-V VMBus via VMBus channels and/or shared memory. The code was ported from FreeBSD with some API changes and simplifications. While the Rx path is nearly complete, packet transmition is not implemented yet. ok deraadt, mlarkin
2016-06-27Fix a memory leak in an error path.Jonathan Gray
ok mikeb@
2016-06-27Correct the order of memset arguments.Jonathan Gray
ok mikeb@
2016-06-22Main Hyper-V nexus driver, work in progress.Mike Belopuhov
ok mlarkin, deraadt
2016-06-06Provide a bus_dma tag as part of the pvbus attach argumentsMike Belopuhov
ok reyk (a while ago)
2016-04-28Preserve the domid when swapping 16 bit grant table entry flagsMike Belopuhov
We use an atomic CMPXCHG on first 32 bits of the grant table entry when revoking access to the memory page. Target domain ID field is part of these 32 bits, thus shouldn't be masked out for comparison. This appears to be the last piece of the QubesOS VM chaining puzzle; tested by Marco Peereboom, thanks!
2016-04-19Bind event channels to backend domainsMike Belopuhov
This is another piece of the QubesOS "chained VM" puzzle reported by Marco Peereboom.
2016-04-19Allow to grant memory access to domains other than dom0.Mike Belopuhov
Extend xen_grant_table_enter to take an additional "domain" argument and extract it from the upper part of the bus_dmamap_load flags (sigh.) to be able to punch it into the grant table entry. Issue reported by Marco Peereboom who found that we wouldn't run under QubesOS that "chains" VMs. He also did the hard work getting the debug data out of the aforementioned system.
2016-04-19Pass down the backend-id property to children in the attach argumentsMike Belopuhov
and pick it up in xnf(4) and print it in the dmesg line for now. We'll need to pass it down to the Grant Table code.
2016-04-19Remove the ds_offset hack since object offset within a pageMike Belopuhov
is the same for both virtual and physical addresses.
2016-04-13G/C IFQ_SET_READY().Martin Pieuchot
2016-04-01Move atomics.h include dance to an earlier stageMike Belopuhov
Otherwise proc.h & friends pick it up before we manage to perform our MULTIPROCESSOR dance. This time I've made sure we get LOCK prefixes with an objdump. Bug reported by Evgeniy Sudyr, thanks!
2016-02-05Simple moderation of Tx completion notificationsMike Belopuhov
Follow FreeBSD and schedule the next Tx completion event to fire when about half of the packet segments scheduled for transmission are consumed.
2016-02-05Silence warnings from static analyzers; found by jsg@Mike Belopuhov
2016-02-04Bail early if there's no token; found by jsg@Mike Belopuhov
2016-02-03Increase the RPC buffer once more to 4096 bytes. The guestinfo.ovfEnvReyk Floeter
mechanism is used to configure VMs in the VMware vSphere world: instead of using individual key-value guestinfo.* properties, it uses the guestinfo.ovfEnv value to pass an enterprise-compliant XML file that includes key-value properties. This file can be rather large, especially with comments, but 4k ought to be enough for anybody. Also change a stack buffer to malloc'ed memory in the ioctl path. OK mikeb@
2016-02-02A few reliability improvements in the power management interfaceMike Belopuhov
Nathanael Rensen <nathanael at list ! polymorpheus ! com> came up with a few improvements to the event watcher and power management interface, namely: o Make sure to put our watcher on a list before issuing an XS_WATCH command since Xen will raise the event right after it's been set up. o The first time xen_control is called the "control/shutdown" node may not exist, so skip printing the error message in this case. o Acknowledge requests by writing back an empty string. o log(9) reboot and halt requests like vmt(4) does. Huge thanks!
2016-01-29Add support for "control/shutdown" power management facilityMike Belopuhov
At the moment only "poweroff" and "reboot" actions are supported. Suspend/resume requires additional changes.
2016-01-29Add support for XS_WATCH: XenStore notification facilityMike Belopuhov
After configuring a watch for the node, XenStore will asynchronously notify the system when the value of the specified node changes with an event message.
2016-01-29Cleanup XenStore APIMike Belopuhov
Turns out that we want to let devices choose whether they're issuing XenStore requests to the backend or frontend. This also unifies the the API somewhat as providing the xen softcore structure is now mandatory.
2016-01-28Older Xen dom0's don't implement setting version of Grant Table entriesMike Belopuhov
Remove leftover code that was used to set v2 of Grant Table entries. From Nathanael Rensen <nathanael at list ! polymorpheus ! com>, thanks!
2016-01-27Tighten up next reference calculation, printing fixesMike Belopuhov
2016-01-27Reimplement Grant Table metadata linking and enable dynamic allocationMike Belopuhov
Instead of pre-allocating maximum number of Grant Table frames allotted by the hypervisor we switch over to allocating them dynamically when the need arises. At the same time we no longer link metadata entries representing individual Grant Table frames as a list and use a table instead to speed up reference lookups when establishing and removing mappings.
2016-01-27xen_bus_dma_init turned out to be unnecessaryMike Belopuhov
2016-01-27shorten a few long linesMike Belopuhov
2016-01-27Add a key-value interface to pvbus(4) that allows to get or set valuesReyk Floeter
in the underlying information store of the host from the OpenBSD-VM's userspace. OpenBSD did not provide access to these stores before, mostly because we did not want to add a custom tool and interface for each hypervisor. The pvbus(4) interface provides backends for xen(4)'s XenStore and vmt(4)'s VMware Tools "guestinfo". These information stores are fairly different, XenStore is a "filesystem" while vmt is a RPC, and the key-value abstraction limits them a bit but provides the most wanted functionality. Discussed with many OK mikeb@