virtio-net: fix the indent
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Reviewed-by: Fam Zheng <famz@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Revert "e1000/rtl8139: update HMP NIC when every bit is written"
This reverts commit cd5be5829c1ce87aa6b3a7806524fac07ac9a757.Digging into hardware specs shows this does notactually make QEMU behave more like hardware:
There are valid arguments backed by the spec to indicate why the version...
Merge remote-tracking branch 'stefanha/net' into staging
Message-id: 1384532032-19057-1-git-send-email-stefanha@redhat.com...
Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream-1.7' into staging
Patch queue for ppc - 2013-11-08
These are two patches that will hopefully make it into 1.7. The SLOF updatefixes -append kernel command line argument passing into the guest kernel. The...
virtio-net: fix the memory leak in rxfilter_notify()
object_get_canonical_path() returns a gchar*, it should be freed by thecaller.
Signed-off-by: Amos Kong <akong@redhat.com>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Vlad Yasevich <vyasevic@redhat.com>...
smc91c111: Fix receive starvation
In case the smc91c111 interface signals that it cannot receive morepackets the packets are queued and further reception will be disabled.In case the interface is again ready to receive packets notify the upperlayer.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>...
virtio-net: broken RX filtering logic fixed
Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET commandmulticast list overwrites unicast list in mac_table.This leads to broken logic for both unicast and multicast RX filtering.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>...
spapr: add vio-bus devices to categories
In order to get devices appear in output of"./qemu-system-ppc64 -device ?",they must be assigned to one of DEVICE_CATEGORY_XXXX.
This puts VIO devices classes to corresponding categories.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
e1000/rtl8139: update HMP NIC when every bit is written
We currently just update the HMP NIC info when the last bit of macaddris written. This assumes that guest driver will write all the macaddrfrom bit 0 to bit 5 when it changes the macaddr, this is the current...
virtio-net: only delete bh that existed
We delete without check whether it existed during exit. This will lead NULLpointer deference since it was created conditionally depends on guest driverstatus and features. So add a check of existence before trying to delete it....
bswap.h: Remove be32_to_cpupu()
Replace the legacy be32_to_cpupu() with ldl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-6-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be16wu()
Replace the legacy cpu_to_be16wu() with stw_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be32wu()
Replace the legacy cpu_to_be32wu() with stl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove le32_to_cpupu()
Replace the legacy le32_to_cpupu() with ldl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-5-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_le32wu()
Replace the legacy cpu_to_le32wu() with stl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-3-git-send-email-peter.maydell@linaro.org...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
net: update nic info during device reset
macaddr is reset during device reset, but nic infoisn't updated, this problem exists in e1000 & rtl8139
Signed-off-by: Amos Kong <akong@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net/e1000: update network information when macaddr is changed in guest
If we change macaddr in guest by 'ifconfig eth0 hw ether 12:12:12:34:35:36',the mac register of e1000 is already updated, but we don't updatenetwork information in qemu. Therefor, the information in monitor...
net/rtl8139: update network information when macaddr is changed in guest
rtl8139 has same problem as e1000, nic info isn't updated when macaddris changed in guest.
This patch updates the nic info when the last bit of macaddr is written.
Signed-off-by: Amos Kong <akong@redhat.com>...
hw/vmxnet3: set interrupts using pci irq wrappers
pci_set_irq uses PCI_INTERRUPT_PIN config registerto compute device INTx pin to assert/deassert.
An assert is used to ensure that intx receivedfrom the quest OS corresponds to PCI_INTERRUPT_PIN.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>...
hw: set interrupts using pci irq wrappers
pci_set_irq and the other pci irq wrappers usePCI_INTERRUPT_PIN config register to compute deviceINTx pin to assert/deassert.
An irq is allocated using pci_allocate_irq wrapperonly if is needed by non pci devices....
pc,pci,virtio fixes and cleanups
This includes pc and pci cleanups and enhancements,and a virtio-net bugfix related to softmac programming.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-net: fix up HMP NIC info string on reset
When mac is updated on reset, info string has stale data.Fix it up.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN
Now that the memory subsystem is propagating the endianness correctly,the pcnet-pci device should have its I/O ports and MMIO memory markedas LITTLE_ENDIAN, as PCI devices are little endian.
This makes the pcnet-pci NIC to work again on big endian MIPS Malta...
e1000: NetClientInfo.receive_iov implemented
This patch implements the NetClientInfo.receive_iov method for thee1000 device emulation. In this way a network backend that usesqemu_sendv_packet() can deliver the fragmented packet withoutrequiring an additional copy in the frontend/backend network code...
ne2000: mark I/O as LITTLE_ENDIAN
Now that the memory subsystem is propagating the endianness correctly,the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, asPCI devices are little endian.
This makes the ne2000 NIC to work again on PowerPC....
vmxnet3: Eliminate __packed redefined warning
This eliminates a warning about __packed being redefined as exposed by thevmxnet3 code. __packed is not used anywhere in the vmxnet3 code.
CC hw/net/vmxnet3.oIn file included from hw/net/vmxnet3.c:29:...
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.Using a single QEMUTimer, it emulates the ITR register (which is the newermitigation register, recommended by Intel) and approximately emulates...
qom: Pass available size to object_initialize()
To be passed on to object_initialize_with_type().
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (virtio-ccw)Signed-off-by: Andreas Färber <afaerber@suse.de>
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api.
Switch the entire code base to using the new timer API.
Note this patch may introduce some line length issues.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
pcnet: Flush queued packets on end of STOP state
Analogously to other NICs, we have to inform the network layer whenthe can_receive handler will no longer report 0. Without this, we mayget stuck waiting on queued incoming packets.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
spapr: Rename 'dprintf' to 'DPRINTF'
'dprintf' is the name of a POSIX standard function so we should not bestealing it for our debug macro. Rename to 'DPRINTF' (in line witha number of other source files.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
opencores_eth: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
mipsnet: QOM cast cleanup
xgmac: QOM cast cleanup
Introduce type constant and use QOM casts and typedef consistently.
xilinx_ethlite: QOM cast cleanup
cadence_gem: QOM cast cleanup
etraxfs_eth: QOM cast cleanup
etraxfs_eth: Rename fs_eth to ETRAXFSEthState
Also add a typedef.
lan9118: QOM cast cleanup
lance: QOM cast cleanup
milkymist-minimac2: QOM cast cleanup
smc91c111: QOM cast cleanup
stellaris_enet: QOM cast cleanup
stellaris_enet: Fix NetClientInfo::cleanup
Drop freeing stellaris_enet_state - that is done by QOM later on unref.
Both MemoryRegion init and savevm registration happen in SysBusDeviceinitfn currently, so move them into an unrealizefn for now.
hw: import bitmap operations in qdev-core header
Made small tweaks in code to prevent compilation issueswhen importing qemu/bitmap.h in qdev-core
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com...
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
pseries: savevm support for PAPR VIO logical lan
This patch adds the necessary VMStateDescription information to supportsavevm/loadvm for the spapr_llan (PAPR logical lan) device.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacementfor assert(0) or assert(false).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
net/e1000: QOM Upcast Sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST()and direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
net/e1000: QOM parent field cleanup
Replace direct uses of E1000State::dev field with QOM casts and renameit to parent_obj.
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
net/rtl8139: QOM Upcast Sweep
net/rtl8139: QOM parent field cleanup
Replace direct uses of RTL8139State::dev with QOM casts and rename it toparent_obj.
net/pcnet-pci: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Renamed parent field, renamed from PC_NET to PCNET]Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'stefanha/tracing' into staging
pci,net,pc enhancements
This includes some fixes and enhancements that accumulated in my tree:pci fixes by dkoch, virtio-net enhancements by akong and mst,and a fix for xen pc by mst.
milkymist-minimac2: Fix minimac2_read/_write tracepoints
Broken in milkymist-minimac.c from the start (commit 0742454),faithfully moved to milkymist-minimac2.c (commit 57aa265).
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net: add support of mac-programming over macvtap in QEMU side
Currently macvtap based macvlan device is working in promiscuousmode, we want to implement mac-programming over macvtap throughLibvirt for better performance.
Design: QEMU notifies Libvirt when rx-filter config is changed in guest,...
pci,misc enhancements
This includes some pci enhancements:
Better support for systems with multiple PCI root busesFW cfg interface for more robust pci programming in BIOSMinor fixes/cleanups for fw cfg and cross-version migration -...
hw/n*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ne2000: pass device to ne2000_setup_io, use it as owner
memory: add owner argument to initialization functions
e1000: cleanup process_tx_desc
Coverity complains about two overruns in process_tx_desc(). Thecomplaints are false positives, but we might as well eliminatethem. The problem is that "hdr" is defined as an unsigned int,but then used to offset an array of size 65536, and another of...
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
Message-id: 1370613288-14933-1-git-send-email-stefanha@redhat.com...
xilinx_axienet: Fix bit mask code
Obviously the code wanted to mask the lower bits but failed to do sobecause of a missing "<".
cppcheck detected a conditional expression which was always true (1 < 7).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
vmxnet3: fix NICState cleanup
Use qemu_del_nic() instead of qemu_del_net_client() to correctly freethe entire NICState.
Cc: qemu-stable@nongnu.orgReported-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
rtl8139: flush queued packets when RxBufPtr is written
Net queues support efficient "receive disable". For example, tap's filedescriptor will not be polled while its peer has receive disabled. Thissaves CPU cycles for needlessly copying and then dropping packets which...
virtio-net: dynamic network offloads configuration
Virtio-net driver currently negotiates network offloadson startup via features mechanism and have no ability todisable and re-enable offloads later.This patch introduced a new control command that allows...
virtio-net: add virtio_net_set_netclient_name.
This adds virtio_net_set_netclient_name, which is used to set thename and type shown in "info network" command.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1368619970-23892-2-git-send-email-fred.konrad@greensocs.com...
virtio-net: properly check the vhost status during status set
Commit 32993698 (vhost: disable on tap link down) tries to disable the vhostalso when the peer's link is down. But the check was not done properly, thevhost were only started when:
1) peer's link is not down...
spapr_llan: fix device reenabling
Normally, the "tap" device is polled by QEMU if a guest NIC canreceive packets. If a guest NIC is stopped during transfer (rmmod orifdown), it may still have packets in a queue which have to be sendto the guest before QEMU enables polling of a "tap" interface via...
virtio-net: count VIRTIO_NET_F_MAC when calculating config_len
Commit 14f9b664 (hw/virtio-net.c: set config size using host features) tries tocalculate config size based on the host features. But it forgets theVIRTIO_NET_F_MAC were always set for qemu later. This will lead a zero config...
ne2000-isa: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-10-git-send-email-afaerber@suse.de...
virtio-net: unbreak the minix guest
Multiqueue patchset conditionally add control vq only when guest negotiate thefeature. Though the spec is not clear on this but it breaks the minix guestsince it will identify the ctrl vq even if it does not support it. Though this...
pseries: Convert VIO code to QOM style type safe(ish) casts
Curerntly the pseries VIO device code contains quite a few explicituses of DO_UPCAST and plain C casts. This is (obviously) type unsafe,and not the conventional way of doing things in the QOM model. This...
virtio: cleanup: init and exit function.
This clean the init and the exit functions and rename virtio_common_cleanupto virtio_cleanup.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-7-git-send-email-fred.konrad@greensocs.com...
virtio: remove the function pointer.
This remove the function pointer in VirtIODevice, and use onlyVirtioDeviceClass function pointer.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-5-git-send-email-fred.konrad@greensocs.com...
virtio: remove virtiobindings.
This remove virtio-bindings, and use class instead.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Drop taddr properties
Drop all the infrastructure for taddr properties (ie ones whichare 'hwaddr' sized). These are now unused, and any further desireduse would be rather questionable since device properties shouldn'tgenerally depend on a type that is conceptually variable based on...
Remove unneeded type casts
cpu_physical_memory_read, cpu_physical_memory_write take any pointeras 2nd argument without needing a type cast.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio-net: cleanup: use QOM cast.
As the virtio-net-pci and virtio-net-s390 are switched to the new API,we can use QOM casts.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-7-git-send-email-fred.konrad@greensocs.com...
virtio-net: cleanup: init and exit function.
This remove old init and exit function as they are no longer needed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-8-git-send-email-fred.konrad@greensocs.com...
virtio-net: add the virtio-net device.
Create virtio-net-device which extends virtio-device, so it can be connected onvirtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-3-git-send-email-fred.konrad@greensocs.com...
stream: Add flow control API
Add basic flow control to stream. A stream slave may return short, indicatingthat it is not capable of accepting any more data at the present time. Pollingor a callback can be used via the can_push() function to determine when the...
xilinx_axienet/dma: Implement rx path flow control
Implement flow control for the RX data path from xilinx_axienet->xilinx_axidma.On short return from axidma, then ethernet sets up the notify callback to resumetransfer from where it left off.
This also allows the ethernet to track whether there is an in progress transaction...
stream: Remove app argument hack
The uint32_t *app argument doesn't exist in real hardware. It was a hack inxilinx_axidma/enet to fake the (secondary) control stream connection. Removedthe argument and added the second stream to axienet/dma.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
xilinx_axienet: typedef XilinxAXIEnet struct
Typedef xilinx_axienets object state struct to shorten the repeated usages ofstruct XilinxAXIEnet.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
xilinx_axienet: Defined and use type cast macro
Standard QOM cast macro. Replaces usages of FROM_SYSBUS
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>...
xilinx_axienet: Register reset properly
Register the reset function and the Device::reset function rather thanexplicitly call it from the sysbus::init.
xilinx_axienet: converted init->realize
The prescribed transition from SysBusDevice::init to Device::realize. Im goingwith Andreas suggestion to move the sysbus foo to Object::init for early IRQvisibility.
xilinx_axienet: Create Proxy object for stream
Create a separate child object to proxy the stream slave connection. This issetup for future work where a second stream slave connection is needed. Thenew child object is created at qdev init time and is linked back to the parent...
include: avoid useless includes of exec/ headers
Headers in include/exec/ are for the deepest innards of QEMU,they should almost never be included directly.
sysemu: avoid proliferation of include/ subdirectories
arm: fix location of some include files
The recent rearrangement of include files had some minor errors: devices.h is not ARM specific and should not be in arm/ arm.h should be in arm/
Move these two headers to correct this.
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can bekept in hw/.
hw: move NICs to hw/net/, configure via default-configs/
hw: move virtio devices to hw/ subdirectories