summaryrefslogtreecommitdiff
path: root/hw/net
AgeCommit message (Collapse)AuthorFilesLines
2013-10-14hw: set interrupts using pci irq wrappersMarcel Apfelbaum5-6/+8
pci_set_irq and the other pci irq wrappers use PCI_INTERRUPT_PIN config register to compute device INTx pin to assert/deassert. An irq is allocated using pci_allocate_irq wrapper only if is needed by non pci devices. Removed irq related fields from state if not used anymore. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-10-14hw/vmxnet3: set interrupts using pci irq wrappersMarcel Apfelbaum1-2/+11
pci_set_irq uses PCI_INTERRUPT_PIN config register to compute device INTx pin to assert/deassert. An assert is used to ensure that intx received from the quest OS corresponds to PCI_INTERRUPT_PIN. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-22virtio-net: fix up HMP NIC info string on resetMichael S. Tsirkin1-0/+1
When mac is updated on reset, info string has stale data. Fix it up. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-06ne2000: mark I/O as LITTLE_ENDIANAurelien Jarno1-1/+1
Now that the memory subsystem is propagating the endianness correctly, the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, as PCI devices are little endian. This makes the ne2000 NIC to work again on PowerPC. Cc: qemu-stable@nongnu.org Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06vmxnet3: Eliminate __packed redefined warningBrad Smith1-2/+0
This eliminates a warning about __packed being redefined as exposed by the vmxnet3 code. __packed is not used anywhere in the vmxnet3 code. CC hw/net/vmxnet3.o In file included from hw/net/vmxnet3.c:29: hw/net/vmxnet3.h:37:1: warning: "__packed" redefined In file included from /usr/include/stdlib.h:38, from /buildbot-qemu/default_openbsd_current/build/include/qemu-common.h:26, from /buildbot-qemu/default_openbsd_current/build/include/hw/hw.h:5, from hw/net/vmxnet3.c:18: /usr/include/sys/cdefs.h:209:1: warning: this is the location of the previous definition Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-09-06e1000: add interrupt mitigation supportVincenzo Maffione1-3/+128
This patch partially implements the e1000 interrupt mitigation mechanisms. Using a single QEMUTimer, it emulates the ITR register (which is the newer mitigation register, recommended by Intel) and approximately emulates RADV and TADV registers. TIDV and RDTR register functionalities are not emulated (RDTR is only used to validate RADV, according to the e1000 specs). RADV, TADV, TIDV and RDTR registers make up the older e1000 mitigation mechanism and would need a timer each to be completely emulated. However, a single timer has been used in order to reach a good compromise between emulation accuracy and simplicity/efficiency. The implemented mechanism can be enabled/disabled specifying the command line e1000-specific boolean parameter "mitigation", e.g. qemu-system-x86_64 -device e1000,mitigation=on,... ... For more information, see the Software developer's manual at http://download.intel.com/design/network/manuals/8254x_GBe_SDM.pdf. Interrupt mitigation boosts performance when the guest suffers from an high interrupt rate (i.e. receiving short UDP packets at high packet rate). For some numerical results see the following link http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de> (for pc-* machines) Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-30qom: Pass available size to object_initialize()Andreas Färber1-2/+4
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>
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh7-49/+49
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> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-05pcnet: Flush queued packets on end of STOP stateJan Kiszka1-0/+4
Analogously to other NICs, we have to inform the network layer when the can_receive handler will no longer report 0. Without this, we may get stuck waiting on queued incoming packets. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-29spapr: Rename 'dprintf' to 'DPRINTF'Peter Maydell1-13/+13
'dprintf' is the name of a POSIX standard function so we should not be stealing it for our debug macro. Rename to 'DPRINTF' (in line with a number of other source files.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Acked-by: Richard Henderson <rth@twiddle.net> Acked-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1375100199-13934-5-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29mipsnet: QOM cast cleanupAndreas Färber1-8/+12
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29opencores_eth: QOM cast cleanupAndreas Färber1-9/+15
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29xilinx_ethlite: QOM cast cleanupAndreas Färber1-7/+13
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29xgmac: QOM cast cleanupAndreas Färber1-20/+26
Introduce type constant and use QOM casts and typedef consistently. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29stellaris_enet: Fix NetClientInfo::cleanupAndreas Färber1-5/+11
Drop freeing stellaris_enet_state - that is done by QOM later on unref. Both MemoryRegion init and savevm registration happen in SysBusDevice initfn currently, so move them into an unrealizefn for now. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29stellaris_enet: QOM cast cleanupAndreas Färber1-9/+15
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29smc91c111: QOM cast cleanupAndreas Färber1-11/+19
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29milkymist-minimac2: QOM cast cleanupAndreas Färber1-11/+16
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29lance: QOM cast cleanupAndreas Färber1-9/+15
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29lan9118: QOM cast cleanupAndreas Färber1-10/+16
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29etraxfs_eth: Rename fs_eth to ETRAXFSEthStateAndreas Färber1-19/+19
Also add a typedef. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29etraxfs_eth: QOM cast cleanupAndreas Färber1-6/+12
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29cadence_gem: QOM cast cleanupAndreas Färber1-11/+15
Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29devices: Associate devices to their logical categoryMarcel Apfelbaum11-0/+11
The category will be used to sort the devices displayed in the command line help. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29hw: import bitmap operations in qdev-core headerMarcel Apfelbaum1-1/+1
Made small tweaks in code to prevent compilation issues when 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 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29pseries: savevm support for PAPR VIO logical lanDavid Gibson1-2/+22
This patch adds the necessary VMStateDescription information to support savevm/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> Message-id: 1374175984-8930-4-git-send-email-aliguori@us.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-27misc: Use g_assert_not_reached for code which is expected to be unreachableStefan Weil2-9/+9
The macro g_assert_not_reached is a better self documenting replacement for assert(0) or assert(false). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-07-23net/pcnet-pci: QOM Upcast SweepPeter Crosthwaite1-7/+14
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> [AF: Renamed parent field, renamed from PC_NET to PCNET] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23net/rtl8139: QOM parent field cleanupAndreas Färber1-39/+49
Replace direct uses of RTL8139State::dev with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23net/rtl8139: QOM Upcast SweepPeter Crosthwaite1-8/+18
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>
2013-07-23net/e1000: QOM parent field cleanupAndreas Färber1-13/+22
Replace direct uses of E1000State::dev field with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23net/e1000: QOM Upcast SweepPeter Crosthwaite1-6/+12
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>
2013-07-22Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori1-1/+1
# By Markus Armbruster # Via Stefan Hajnoczi * stefanha/tracing: trace-events: Fix up source file comments trace-events: Drop unused events milkymist-minimac2: Fix minimac2_read/_write tracepoints slavio_misc: Fix slavio_led_mem_readw/_writew tracepoints cleanup-trace-events.pl: New Message-id: 1374119369-26496-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-18Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori1-6/+127
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. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Wed 17 Jul 2013 04:44:45 AM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Don Koch (2) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: pc: don't access fw cfg if NULL virtio-net: add feature bit for any header s/g net: add support of mac-programming over macvtap in QEMU side pci: fix BRDIGE typo pci-bridge: update mappings for migration/restore Message-id: 1374054430-21966-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-18milkymist-minimac2: Fix minimac2_read/_write tracepointsMarkus Armbruster1-1/+1
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>
2013-07-15net: add support of mac-programming over macvtap in QEMU sideAmos Kong1-6/+127
Currently macvtap based macvlan device is working in promiscuous mode, we want to implement mac-programming over macvtap through Libvirt for better performance. Design: QEMU notifies Libvirt when rx-filter config is changed in guest, then Libvirt query the rx-filter information by a monitor command, and sync the change to macvtap device. Related rx-filter config of the nic contains main mac, rx-mode items and vlan table. This patch adds a QMP event to notify management of rx-filter change, and adds a monitor command for management to query rx-filter information. Test: If we repeatedly add/remove vlan, and change macaddr of vlan interfaces in guest by a loop script. Result: The events will flood the QMP client(management), management takes too much resource to process the events. Event_throttle API (set rate to 1 ms) can avoid the events to flood QMP client, but it could cause an unexpected delay (~1ms), guests guests normally expect rx-filter updates immediately. So we use a flag for each nic to avoid events flooding, the event is emitted once until the query command is executed. The flag implementation could not introduce unexpected delay. There maybe exist an uncontrollable delay if we let Libvirt do the real change, guests normally expect rx-filter updates immediately. But it's another separate issue, we can investigate it when the work in Libvirt side is done. Michael S. Tsirkin: tweaked to enable events on start Michael S. Tsirkin: fixed not to crash when no id Michael S. Tsirkin: fold in patch: "additional fixes for mac-programming feature" Amos Kong: always notify QMP client if mactable is changed Amos Kong: return NULL list if no net client supports rx-filter query Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-08Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori1-8/+10
pci,misc enhancements This includes some pci enhancements: Better support for systems with multiple PCI root buses FW cfg interface for more robust pci programming in BIOS Minor fixes/cleanups for fw cfg and cross-version migration - because of dependencies with other patches Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 07 Jul 2013 03:11:18 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By David Gibson (10) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: pci: Fold host_buses list into PCIHostState functionality pci: Remove domain from PCIHostBus pci: Simpler implementation of primary PCI bus pci: Add root bus parameter to pci_nic_init() pci: Add root bus argument to pci_get_bus_devfn() pci: Replace pci_find_domain() with more general pci_root_bus_path() pci: Use helper to find device's root bus in pci_find_domain() pci: Abolish pci_find_root_bus() pci: Move pci_read_devaddr to pci-hotplug-old.c pci: Cleanup configuration for pci-hotplug.c pvpanic: fix fwcfg for big endian hosts pvpanic: initialization cleanup MAINTAINERS: s/Marcelo/Paolo/ e1000: cleanup process_tx_desc pc_piix: cleanup init compat handling pc: pass PCI hole ranges to Guests pci: store PCI hole ranges in guestinfo structure range: add Range structure Message-id: 1373228271-31223-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-04hw/n*: pass owner to memory_region_init* functionsPaolo Bonzini17-33/+41
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04ne2000: pass device to ne2000_setup_io, use it as ownerPaolo Bonzini3-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04memory: add owner argument to initialization functionsPaolo Bonzini20-29/+29
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04e1000: cleanup process_tx_descAndrew Jones1-8/+10
Coverity complains about two overruns in process_tx_desc(). The complaints are false positives, but we might as well eliminate them. The problem is that "hdr" is defined as an unsigned int, but then used to offset an array of size 65536, and another of size 256 bytes. hdr will actually never be greater than 255 though, as it's assigned only once and to the value of tp->hdr_len, which is an uint8_t. This patch simply gets rid of hdr, replacing it with tp->hdr_len, which makes it consistent with all other tp member use in the function. v2: - also cleanup coding style issues in the touched lines Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-06-15Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpuBlue Swirl1-8/+7
* 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu: qdev: Drop FROM_QBUS() macro isa: QOM'ify ISADevice isa: QOM'ify ISABus i8259: Convert PICCommonState to use QOM realizefn kvm/i8259: QOM'ify some more i8259: QOM'ify some more i8254: Convert PITCommonState to QOM realizefn kvm/i8254: QOM'ify some more i8254: QOM'ify some more isa: Use realizefn for ISADevice cs4231a: QOM'ify some more gus: QOM'ify some more
2013-06-10Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori1-1/+1
# By Jason Wang (1) and Stefan Hajnoczi (1) # Via Stefan Hajnoczi * stefanha/net: tap: fix NULL dereference when passing invalid parameters to tap vmxnet3: fix NICState cleanup Message-id: 1370613288-14933-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-10xilinx_axienet: Fix bit mask codeStefan Weil1-1/+1
Obviously the code wanted to mask the lower bits but failed to do so because 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>
2013-06-07isa: Use realizefn for ISADeviceAndreas Färber1-8/+7
Drop ISADeviceClass::init and the resulting no-op initfn and let children implement their own realizefn. Adapt error handling. Split off an instance_init where sensible. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-05vmxnet3: fix NICState cleanupStefan Hajnoczi1-1/+1
Use qemu_del_nic() instead of qemu_del_net_client() to correctly free the entire NICState. Cc: qemu-stable@nongnu.org Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-24rtl8139: flush queued packets when RxBufPtr is writtenStefan Hajnoczi1-0/+3
Net queues support efficient "receive disable". For example, tap's file descriptor will not be polled while its peer has receive disabled. This saves CPU cycles for needlessly copying and then dropping packets which the peer cannot receive. rtl8139 is missing the qemu_flush_queued_packets() call that wakes the queue up when receive becomes possible again. As a result, the Windows 7 guest driver reaches a state where the rtl8139 cannot receive packets. The driver has actually refilled the receive buffer but we never resume reception. The bug can be reproduced by running a large FTP 'get' inside a Windows 7 guest: $ qemu -netdev tap,id=tap0,... -device rtl8139,netdev=tap0 The Linux guest driver does not trigger the bug, probably due to a different buffer management strategy. Reported-by: Oliver Francke <oliver.francke@filoo.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-22virtio-net: dynamic network offloads configurationDmitry Fleytman1-15/+84
Virtio-net driver currently negotiates network offloads on startup via features mechanism and have no ability to disable and re-enable offloads later. This patch introduced a new control command that allows to configure device network offloads state dynamically. The patch also introduces a new feature flag VIRTIO_NET_F_CTRL_GUEST_OFFLOADS. Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20130520081814.GA8162@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-15virtio-net: add virtio_net_set_netclient_name.KONRAD Frederic1-2/+43
This adds virtio_net_set_netclient_name, which is used to set the name 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 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-07virtio-net: properly check the vhost status during status setJason Wang1-2/+2
Commit 32993698 (vhost: disable on tap link down) tries to disable the vhost also when the peer's link is down. But the check was not done properly, the vhost were only started when: 1) peer's link is not down 2) virtio-net has already been started. Since == have a higher precedence than &&, place a brace to make sure both the conditions were met then does the check. This fixes the crash when doing a savem after set the link off which let qemu crash and complains: virtio_net_save: Assertion `!n->vhost_started' failed. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-id: 1366972060-21606-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>