1. 27 5月, 2015 5 次提交
  2. 18 2月, 2015 1 次提交
    • M
      monitor: Clean up around monitor_handle_fd_param() · 1677f4c6
      Markus Armbruster 提交于
      monitor_handle_fd_param() is a wrapper around
      monitor_handle_fd_param2() that feeds errors to qerror_report_err()
      instead of returning them.  qerror_report_err() is inappropriate in
      many contexts.  monitor_handle_fd_param() looks simpler than
      monitor_handle_fd_param2(), which tempts use.  Remove the temptation:
      drop the wrapper and open-code the (trivial) error handling instead.
      
      Replace the open-coded qerror_report_err() by error_report_err() in
      places that already use error_report().  Turns out that's everywhere.
      
      While there, rename monitor_handle_fd_param2() to monitor_fd_param().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1677f4c6
  3. 19 12月, 2014 1 次提交
  4. 02 11月, 2014 2 次提交
  5. 19 6月, 2014 2 次提交
  6. 25 4月, 2014 1 次提交
  7. 12 3月, 2014 1 次提交
    • S
      tap: avoid deadlocking rx · 68e5ec64
      Stefan Hajnoczi 提交于
      The net subsystem has a control flow mechanism so peer NetClientStates
      can tell each other to stop sending packets.  This is used to stop
      monitoring the tap file descriptor for incoming packets if the guest rx
      ring has no spare buffers.
      
      There is a corner case when tap_can_send() is true at the beginning of
      an event loop iteration but becomes false before the tap_send() fd
      handler is invoked.
      
      tap_send() will read the packet from the tap file descriptor and attempt
      to send it.  The net queue will hold on to the packet and return 0,
      indicating that further I/O is not possible.  tap then stops monitoring
      the file descriptor for reads.
      
      This is unlike the normal case where tap_can_send() is the same before
      and during the event loop iteration.  The event loop would simply not
      monitor the file descriptor if tap_can_send() returns true.  Upon next
      iteration it would check tap_can_send() again and begin monitoring if we
      can send.
      
      The deadlock happens because tap_send() explicitly disabled read_poll.
      This is done with the expectation that the peer will call
      qemu_net_queue_flush().  But hw/net/virtio-net.c does not monitor
      vm_running transitions and issue the flush.  Hence we're left with a
      broken tap device.
      
      Cc: qemu-stable@nongnu.org
      Reported-by: NNeil Skrypuch <neil@tembosocial.com>
      Tested-by: NNeil Skrypuch <neil@tembosocial.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      68e5ec64
  8. 25 2月, 2014 3 次提交
  9. 07 6月, 2013 1 次提交
    • J
      tap: fix NULL dereference when passing invalid parameters to tap · c87826a8
      Jason Wang 提交于
      This patch forbid the following invalid parameters to tap:
      
      1) fd and vhostfds were specified but vhostfd were not specified
      2) vhostfds were specified but fds were not specified
      3) fds and vhostfd were specified
      
      For 1 and 2, net_init_tap_one() will still pass NULL as vhostfdname to
      monitor_handle_fd_param(), which may crash the qemu.
      
      Also remove the unnecessary has_fd check.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Stefan Hajnoczi <shajnocz@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c87826a8
  10. 03 5月, 2013 1 次提交
  11. 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
  12. 25 3月, 2013 1 次提交
    • S
      net: increase buffer size to accommodate Jumbo frame pkts · d32fcad3
      Scott Feldman 提交于
      Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs.  Bump this
      up to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plenty
      of room for the ethernet and virtio_net headers.
      
      Originally, ran into this limitation when using -netdev UDP sockets to connect
      VM-to-VM, where VM interface is configure with MTU=9000.  (Using virtio_net
      NIC model).  Test is simple: ping -M do -s 8500 <target>.  This test will
      attempt to ping with unfragmented packet of given size.  Without patch, size
      is limited to < 4K (minus protocol hdrs).  With patch, ping test works with pkt
      size up to 9000 (again, minus protocol hdrs).
      
      v2: per Stefan, increase buf size to (4096+65536) as done in tap and apply
          to vde and socket netdevs.
      v1: increase buf size to 12K just for -netdev UDP sockets
      Signed-off-by: NScott Feldman <sfeldma@cumulusnetworks.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d32fcad3
  13. 22 3月, 2013 1 次提交
  14. 27 2月, 2013 1 次提交
  15. 02 2月, 2013 5 次提交
    • A
      tap: unbreak -netdev tap,fd=X · 02cd8090
      Anthony Liguori 提交于
      The multiqueue patch series broke -netdev tap,fd=X which manifests
      as libvirt not being able to start a guest.  This was because it
      passed NULL for the netdev name which results in an anonymous netdev
      device regardless of what the user specified.
      
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Bruce Rogers <brogers@suse.com>
      Reported-by: NBruce Rogers <brogers@suse.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      02cd8090
    • J
      tap: multiqueue support · 264986e2
      Jason Wang 提交于
      Recently, linux support multiqueue tap which could let userspace call TUNSETIFF
      for a signle device many times to create multiple file descriptors as
      independent queues. User could also enable/disabe a specific queue through
      TUNSETQUEUE.
      
      The patch adds the generic infrastructure to create multiqueue taps. To achieve
      this a new parameter "queues" were introduced to specify how many queues were
      expected to be created for tap by qemu itself. Alternatively, management could
      also pass multiple pre-created tap file descriptors separated with ':' through a
      new parameter fds like -netdev tap,id=hn0,fds="X:Y:..:Z". Multiple vhost file
      descriptors could also be passed in this way.
      
      Each TAPState were still associated to a tap fd, which mean multiple TAPStates
      were created when user needs multiqueue taps. Since each TAPState contains one
      NetClientState, with the multiqueue nic support, an N peers of NetClientState
      were built up.
      
      A new parameter, mq_required were introduce in tap_open() to create multiqueue
      tap fds.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      264986e2
    • J
      tap: support enabling or disabling a queue · 16dbaf90
      Jason Wang 提交于
      This patch introduce a new bit - enabled in TAPState which tracks whether a
      specific queue/fd is enabled. The tap/fd is enabled during initialization and
      could be enabled/disabled by tap_enalbe() and tap_disable() which calls platform
      specific helpers to do the real work. Polling of a tap fd can only done when
      the tap was enabled.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      16dbaf90
    • J
      tap: factor out common tap initialization · 5193e5fb
      Jason Wang 提交于
      This patch factors out the common initialization of tap into a new helper
      net_init_tap_one(). This will be used by multiqueue tap patches.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      5193e5fb
    • J
      net: tap: using bool instead of bitfield · ec45f083
      Jason Wang 提交于
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ec45f083
  16. 19 12月, 2012 5 次提交
  17. 20 11月, 2012 1 次提交
  18. 08 10月, 2012 1 次提交
    • P
      net: consolidate NetClientState header files into one · a245fc18
      Paolo Bonzini 提交于
      This patch doesn't seem much useful alone, I must admit.  However,
      it makes sense as part of the upcoming directory reorganization,
      where I want to have include/net/tap.h as the net<->hw interface
      for tap.  Then having both net/tap.h and include/net/tap.h does
      not work.  "Fixed" by moving all the init functions to a single
      header file net/clients.h.
      
      The patch also adopts a uniform style for including net/*.h files
      from net/*.c, without the net/ path.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
      a245fc18
  19. 07 9月, 2012 1 次提交
  20. 01 8月, 2012 3 次提交
  21. 23 7月, 2012 2 次提交