1. 25 1月, 2017 1 次提交
  2. 23 9月, 2016 1 次提交
  3. 07 9月, 2016 1 次提交
  4. 20 7月, 2016 1 次提交
    • E
      qapi: Change Netdev into a flat union · f394b2e2
      Eric Blake 提交于
      This is a mostly-mechanical conversion that creates a new flat
      union 'Netdev' QAPI type that covers all the branches of the
      former 'NetClientOptions' simple union, where the branches are
      now listed in a new 'NetClientDriver' enum rather than generated
      from the simple union.  The existence of a flat union has no
      change to the command line syntax accepted for new code, and
      will make it possible for a future patch to switch the QMP
      command to parse a boxed union for no change to valid QMP; but
      it does have some ripple effect on the C code when dealing with
      the new types.
      
      While making the conversion, note that the 'NetLegacy' type
      remains unchanged: it applies only to legacy command line options,
      and will not be ported to QMP, so it should remain a wrapper
      around a simple union; to avoid confusion, the type named
      'NetClientOptions' is now gone, and we introduce 'NetLegacyOptions'
      in its place.  Then, in the C code, we convert from NetLegacy to
      Netdev as soon as possible, so that the bulk of the net stack
      only has to deal with one QAPI type, not two.  Note that since
      the old legacy code always rejected 'hubport', we can just omit
      that branch from the new 'NetLegacyOptions' simple union.
      
      Based on an idea originally by Zoltán Kővágó <DirtY.iCE.hu@gmail.com>:
      Message-Id: <01a527fbf1a5de880091f98cf011616a78adeeee.1441627176.git.DirtY.iCE.hu@gmail.com>
      although the sed script in that patch no longer applies due to
      other changes in the tree since then, and I also did some manual
      cleanups (such as fixing whitespace to keep checkpatch happy).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1468468228-27827-13-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Fixup from Eric squashed in]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f394b2e2
  5. 27 5月, 2016 2 次提交
    • T
      hw/net/spapr_llan: Provide counter with dropped rx frames to the guest · 5c29dd8c
      Thomas Huth 提交于
      The last 8 bytes of the receive buffer list page (that has been supplied
      by the guest with the H_REGISTER_LOGICAL_LAN call) contain a counter
      for frames that have been dropped because there was no suitable receive
      buffer available. This patch introduces code to use this field to
      provide the information about dropped rx packets to the guest.
      There it can be queried with "ethtool -S eth0 | grep rx_no_buffer".
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      5c29dd8c
    • T
      hw/net/spapr_llan: Delay flushing of the RX queue while adding new RX buffers · 8836630f
      Thomas Huth 提交于
      Currently, the spapr-vlan device is trying to flush the RX queue
      after each RX buffer that has been added by the guest via the
      H_ADD_LOGICAL_LAN_BUFFER hypercall. In case the receive buffer pool
      was empty before, we only pass single packets to the guest this
      way. This can cause very bad performance if a sender is trying
      to stream fragmented UDP packets to the guest. For example when
      using the UDP_STREAM test from netperf with UDP packets that are
      much bigger than the MTU size, almost all UDP packets are dropped
      in the guest since the chances are quite high that at least one of
      the fragments got lost on the way.
      
      When flushing the receive queue, it's much better if we'd have
      a bunch of receive buffers available already, so that fragmented
      packets can be passed to the guest in one go. To do this, the
      spapr_vlan_receive() function should return 0 instead of -1 if there
      are no more receive buffers available, so that receive_disabled = 1
      gets temporarily set for the receive queue, and we have to delay
      the queue flushing at the end of h_add_logical_lan_buffer() a little
      bit by using a timer, so that the guest gets a chance to add multiple
      RX buffers before we flush the queue again.
      
      This improves the UDP_STREAM test with the spapr-vlan device a lot:
      Running
       netserver -p 44444 -L <guestip> -f -D -4
      in the guest, and
       netperf -p 44444 -L <hostip> -H <guestip> -t UDP_STREAM -l 60 -- -m 16384
      in the host, I get the following values _without_ this patch:
      
      Socket  Message  Elapsed      Messages
      Size    Size     Time         Okay Errors   Throughput
      bytes   bytes    secs            #      #   10^6bits/sec
      
      229376   16384   60.00     1738970      0    3798.83
      229376           60.00          23              0.05
      
      That "0.05" means that almost all UDP packets got lost/discarded
      at the receiving side.
      With this patch applied, the value look much better:
      
      Socket  Message  Elapsed      Messages
      Size    Size     Time         Okay Errors   Throughput
      bytes   bytes    secs            #      #   10^6bits/sec
      
      229376   16384   60.00     1789104      0    3908.35
      229376           60.00       22818             49.85
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      8836630f
  6. 19 5月, 2016 2 次提交
  7. 24 3月, 2016 3 次提交
    • T
      hw/net/spapr_llan: Enable the RX buffer pools by default for new machines · 57c522f4
      Thomas Huth 提交于
      RX buffer pools are now enabled by default for new machine types.
      For older machine types, they are still disabled to avoid breaking
      migration.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      57c522f4
    • T
      hw/net/spapr_llan: Fix receive buffer handling for better performance · 831e8822
      Thomas Huth 提交于
      tl;dr:
      This patch introduces an alternate way of handling the receive
      buffers of the spapr-vlan device, resulting in much better
      receive performance for the guest.
      
      Full story:
      One of our testers recently discovered that the performance of the
      spapr-vlan device is very poor compared to other NICs, and that
      a simple "ping -i 0.2 -s 65507 someip" in the guest can result
      in more than 50% lost ping packets (especially with older guest
      kernels < 3.17).
      
      After doing some analysis, it was clear that there is a problem
      with the way we handle the receive buffers in spapr_llan.c: The
      ibmveth driver of the guest Linux kernel tries to add a lot of
      buffers into several buffer pools (with 512, 2048 and 65536 byte
      sizes by default, but it can be changed via the entries in the
      /sys/devices/vio/1000/pool* directories of the guest). However,
      the spapr-vlan device of QEMU only tries to squeeze all receive
      buffer descriptors into one single page which has been supplied
      by the guest during the H_REGISTER_LOGICAL_LAN call, without
      taking care of different buffer sizes. This has two bad effects:
      First, only a very limited number of buffer descriptors is accepted
      at all. Second, we also hand 64k buffers to the guest even if
      the 2k buffers would fit better - and this results in dropped packets
      in the IP layer of the guest since too much skbuf memory is used.
      
      Though it seems at a first glance like PAPR says that we should store
      the receive buffer descriptors in the page that is supplied during
      the H_REGISTER_LOGICAL_LAN call, chapter 16.4.1.2 in the LoPAPR spec
      declares that "the contents of these descriptors are architecturally
      opaque, none of these descriptors are manipulated by code above
      the architected interfaces". That means we don't have to store
      the RX buffer descriptors in this page, but can also manage the
      receive buffers at the hypervisor level only. This is now what we
      are doing here: Introducing proper RX buffer pools which are also
      sorted by size of the buffers, so we can hand out a buffer with
      the best fitting size when a packet has been received.
      
      To avoid problems with migration from/to older version of QEMU,
      the old behavior is also retained and enabled by default. The new
      buffer management has to be enabled via a new "use-rx-buffer-pools"
      property.
      
      Now with the new buffer pool management enabled, the problem with
      "ping -s 65507" is fixed for me, and the throughput of a simple
      test with wget increases from creeping 3MB/s up to 20MB/s!
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      831e8822
    • T
      hw/net/spapr_llan: Extract rx buffer code into separate functions · d6f39fdf
      Thomas Huth 提交于
      Refactor the code a little bit by extracting the code that reads
      and writes the receive buffer list page into separate functions.
      There should be no functional change in this patch, this is just
      a preparation for the upcoming extensions that introduce receive
      buffer pools.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d6f39fdf
  8. 23 3月, 2016 1 次提交
  9. 29 1月, 2016 1 次提交
    • P
      ppc: Clean up includes · 0d75590d
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-6-git-send-email-peter.maydell@linaro.org
      0d75590d
  10. 07 7月, 2015 1 次提交
    • D
      spapr: Merge sPAPREnvironment into sPAPRMachineState · 28e02042
      David Gibson 提交于
      The code for -machine pseries maintains a global sPAPREnvironment structure
      which keeps track of general state information about the guest platform.
      This predates the existence of the MachineState structure, but performs
      basically the same function.
      
      Now that we have the generic MachineState, fold sPAPREnvironment into
      sPAPRMachineState, the pseries specific subclass of MachineState.
      
      This is mostly a matter of search and replace, although a few places which
      relied on the global spapr variable are changed to find the structure via
      qdev_get_machine().
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      28e02042
  11. 09 3月, 2015 1 次提交
  12. 12 1月, 2015 1 次提交
    • P
      net: remove all cleanup methods from NIC NetClientInfos · 57407ea4
      Paolo Bonzini 提交于
      All NICs have a cleanup function that, in most cases, zeroes the pointer
      to the NICState.  In some cases, it frees data belonging to the NIC.
      
      However, this function is never called except when exiting from QEMU.
      It is not necessary to NULL pointers and free data here; the right place
      to do that would be in the device's unrealize function, after calling
      qemu_del_nic.  Zeroing the NIC multiple times is also wrong for multiqueue
      devices.
      
      This cleanup function gets in the way of making the NetClientStates for
      the NIC hold an object_ref reference to the object, so get rid of it.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      57407ea4
  13. 15 10月, 2014 2 次提交
  14. 08 9月, 2014 1 次提交
  15. 16 6月, 2014 1 次提交
  16. 20 3月, 2014 1 次提交
  17. 05 3月, 2014 1 次提交
  18. 08 11月, 2013 1 次提交
  19. 30 7月, 2013 1 次提交
  20. 29 7月, 2013 1 次提交
  21. 06 5月, 2013 1 次提交
    • A
      spapr_llan: fix device reenabling · e0ff466c
      Alexey Kardashevskiy 提交于
      Normally, the "tap" device is polled by QEMU if a guest NIC can
      receive packets. If a guest NIC is stopped during transfer (rmmod or
      ifdown), it may still have packets in a queue which have to be send
      to the guest before QEMU enables polling of a "tap" interface via
      tap_update_fd_handler().
      
      However the spapr_llan device was missing the qemu_flush_queued_packets()
      call so the tap_send_completed() callback was never called and therefore
      "tap" interface polling was not enabled ever.
      
      The patch fixes this problem.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      e0ff466c
  22. 27 4月, 2013 1 次提交
  23. 09 4月, 2013 2 次提交
  24. 09 3月, 2013 1 次提交
  25. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  26. 02 2月, 2013 2 次提交
  27. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0
  28. 19 12月, 2012 1 次提交
    • P
      net: reorganize headers · 1422e32d
      Paolo Bonzini 提交于
      Move public headers to include/net, and leave private headers in net/.
      Put the virtio headers in include/net/tap.h, removing the multiple copies
      that existed.  Leave include/net/tap.h as the interface for NICs, and
      net/tap_int.h as the interface for OS-specific parts of the tap backend.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1422e32d
  29. 31 10月, 2012 1 次提交
  30. 16 8月, 2012 1 次提交
    • A
      pseries: Rework irq assignment to avoid carrying qemu_irqs around · a307d594
      Alexey Kardashevskiy 提交于
      Currently, the interfaces in the pseries machine code for assignment
      and setup of interrupts pass around qemu_irq objects.  That was done
      in an attempt not to be too closely linked to the specific XICS
      interrupt controller.  However interactions with the device tree setup
      made that attempt rather futile, and XICS is part of the PAPR spec
      anyway, so this really just meant we had to carry both the qemu_irq
      pointers and the XICS irq numbers around.
      
      This mess will just get worse when we add upcoming PCI MSI support,
      since that will require tracking a bunch more interrupt.  Therefore,
      this patch reworks the spapr code to just use XICS irq numbers
      (roughly equivalent to GSIs on x86) and only retrieve the qemu_irq
      pointers from the XICS code when we need them (a trivial lookup).
      
      This is a reworked and generalized version of an earlier spapr_pci
      specific patch from Alexey Kardashevskiy.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      [agraf: fix checkpath warning]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a307d594
  31. 01 8月, 2012 1 次提交
  32. 23 7月, 2012 1 次提交
  33. 28 6月, 2012 1 次提交