1. 24 5月, 2013 1 次提交
  2. 03 5月, 2013 2 次提交
    • J
      tap: properly initialize vhostfds · 7873df40
      Jason Wang 提交于
      Only tap->vhostfd were checked net_init_tap_one(), but tap->vhostfds were
      forgot, this will lead qemu to ignore all fds passed by management through
      vhostfds, and tries to create vhost_net device itself. Fix by adding this check
      also.
      Reportyed-by: NMichal Privoznik <mprivozn@redhat.com>
      Cc: Michal Privoznik <mprivozn@redhat.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      7873df40
    • A
      net: make network client name unique · c963530a
      Amos Kong 提交于
      assign_name() creates a name MODEL.NUM, where MODEL is the client's model,
      and NUM is the number of MODELs that already exist.
      
      Markus added NIC naming for non-VLAN clients in commit 53e51d85.
      commit d33d93b2 incorrectly added a judgement of net-hub. It caused
      net clients created with -netdev get same names.
      
      eg:
       # qemu-upstream -device virtio-net-pci,netdev=h1 -netdev tap,id=h1 \
                          -device virtio-net-pci,netdev=h2 -netdev tap,id=h2 ..
       (qemu) info network
       virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
        \ h1: index=0,type=tap,ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
       virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:57
        \ h2: index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
      
      This patch removed the check of nic-hub, and created unique names for
      all net clients that have same model.
      
      v2: update commitlog & comments
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c963530a
  3. 16 4月, 2013 1 次提交
  4. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  5. 05 4月, 2013 1 次提交
  6. 02 4月, 2013 2 次提交
  7. 25 3月, 2013 5 次提交
  8. 22 3月, 2013 2 次提交
  9. 27 2月, 2013 5 次提交
    • J
      net: reduce the unnecessary memory allocation of multiqueue · f6b26cf2
      Jason Wang 提交于
      Edivaldo reports a problem that the array of NetClientState in NICState is too
      large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not
      used.
      
      Instead of static arrays, solving this issue by allocating the queues on demand
      for both the NetClientState array in NICState and VirtIONetQueue array in
      VirtIONet.
      
      Tested by myself, with single virtio-net-pci device. The memory allocation is
      almost the same as when multiqueue is not merged.
      
      Cc: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f6b26cf2
    • P
      tap: set IFF_ONE_QUEUE per default · d26e445c
      Peter Lieven 提交于
      historically the kernel queues packets two times. once
      at the device and second in qdisc. this is believed to cause
      interface stalls if one of these queues overruns.
      
      setting IFF_ONE_QUEUE is the default in kernels >= 3.8. the
      flag is ignored since then. see kernel commit
      5d097109257c03a71845729f8db6b5770c4bbedc
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d26e445c
    • J
      tap: forbid creating multiqueue tap when hub is used · ce675a75
      Jason Wang 提交于
      Obviously, hub does not support multiqueue tap. So this patch forbids creating
      multiple queue tap when hub is used to prevent the crash when command line such
      as "-net tap,queues=2" is used.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ce675a75
    • L
      net: fix unbounded NetQueue · 7d91ddd2
      Luigi Rizzo 提交于
      In the current implementation of qemu, running without a network
      backend will cause the queue to grow unbounded when the guest is
      transmitting traffic.
      
      This patch fixes the problem by implementing bounded size NetQueue,
      used with an arbitrary limit of 10000 packets, and dropping packets
      when the queue is full _and_ the sender does not pass a callback.
      
      The second condition makes sure that we never drop packets that
      contains a callback (which would be tricky, because the producer
      expects the callback to be run when all previous packets have been
      consumed; so we cannot run it when the packet is dropped).
      
      If documentation is correct, producers that submit a callback should
      stop sending when their packet is queued, so there is no real risk
      that the queue exceeds the max size by large values.
      Signed-off-by: NLuigi Rizzo <rizzo@iet.unipi.it>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      7d91ddd2
    • L
      net: fix qemu_flush_queued_packets() in presence of a hub · 199ee608
      Luigi Rizzo 提交于
      When frontend and backend are connected through a hub as below
      (showing only one direction), and the frontend (or in general, all
      output ports of the hub) cannot accept more traffic, the backend
      queues packets in queue-A.
      
      When the frontend (or in general, one output port) becomes ready again,
      quemu tries to flush packets from queue-B, which is unfortunately empty.
      
        e1000.0 <--[queue B]-- hub0port0(hub)hub0port1 <--[queue A]-- tap.0
      
      To fix this i propose to introduce a new function net_hub_flush()
      which is called when trying to flush a queue connected to a hub.
      Signed-off-by: NLuigi Rizzo <rizzo@iet.unipi.it>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      199ee608
  10. 14 2月, 2013 1 次提交
  11. 08 2月, 2013 1 次提交
    • M
      net: fix infinite loop on exit · b8904921
      Michael Roth 提交于
      1ceef9f2 added handling for cleaning
      up multiple queues in qemu_del_nic() for cases where multiqueue is in
      use. To determine the number of queues it looks at nic->conf->queues,
      then iterates through all the queues to cleanup the associated
      NetClientStates. If no queues are found, no NetClientStates are deleted.
      
      However, nic->conf->queues is only set when a peer is created via
      -netdev or netdev_add, and is otherwise 0. This causes us to spin in
      net_cleanup() if we attempt to shut down qemu before adding a host
      device.
      
      Since qemu_new_nic() unconditionally creates at least 1
      queue/NetClientState at queue idx 0, make qemu_del_nic() always attempt
      to clean it up.
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b8904921
  12. 02 2月, 2013 16 次提交
  13. 30 1月, 2013 1 次提交
  14. 17 1月, 2013 1 次提交