1. 25 2月, 2014 2 次提交
  2. 18 2月, 2014 1 次提交
  3. 27 1月, 2014 1 次提交
  4. 23 12月, 2013 1 次提交
  5. 09 12月, 2013 2 次提交
    • V
      net: Update netdev peer on link change · 02d38fcb
      Vlad Yasevich 提交于
      When a link change occurs on a backend (like tap), we currently do
      not propage such change to the nic.  As a result, when someone turns
      off a link on a tap device, for instance, then a guest doesn't see
      that change and continues to try to send traffic or run DHCP even
      though the lower-layer is disconnected.  This is OK when the network
      is set up as a HUB since the the guest may be connected to other HUB
      ports too, but when it's set up as a netdev, it makes thinkgs worse.
      
      The patch addresses this by setting the peers link down only when the
      peer is not a HUBPORT device.  With this patch, in the following config
        -netdev tap,id=net0 -device e1000,mac=XXXXX,netdev=net0
      when net0 link is turned off, the guest e1000 shows lower-layer link
      down. This allows guests to boot much faster in such configurations.
      With windows guest, it also allows the network to recover properly
      since windows will not configure the link-local IPv4 address, and
      when the link is turned on, the proper address address is configured.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      02d38fcb
    • V
      net: Adding netmap network backend · 58952137
      Vincenzo Maffione 提交于
      This patch adds support for a network backend based on netmap.
      netmap is a framework for high speed packet I/O. You can use it
      to build extremely fast traffic generators, monitors, software
      switches or network middleboxes. Its companion software switch
      VALE lets you interconnect virtual machines.
      netmap and VALE are implemented as a non-intrusive kernel module,
      support NICs from multiple vendors, are part of standard FreeBSD
      distributions and available in source format for Linux too.
      
      To compile QEMU with netmap support, use the following configure
      options:
          ./configure [...] --enable-netmap --extra-cflags=-I/path/to/netmap/sys
      where "/path/to/netmap" contains the netmap source code, available at
          http://info.iet.unipi.it/~luigi/netmap/
      
      The same webpage contains more information about the netmap project
      (together with papers and presentations).
      Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      58952137
  6. 09 11月, 2013 2 次提交
  7. 06 9月, 2013 1 次提交
  8. 23 8月, 2013 1 次提交
  9. 16 7月, 2013 1 次提交
    • A
      net: add support of mac-programming over macvtap in QEMU side · b1be4280
      Amos Kong 提交于
      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: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      b1be4280
  10. 03 5月, 2013 1 次提交
    • 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
  11. 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
  12. 27 2月, 2013 2 次提交
    • 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
    • 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
  13. 14 2月, 2013 1 次提交
  14. 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
  15. 02 2月, 2013 7 次提交
  16. 30 1月, 2013 1 次提交
  17. 17 1月, 2013 1 次提交
  18. 13 1月, 2013 1 次提交
  19. 19 12月, 2012 6 次提交
  20. 01 11月, 2012 1 次提交
    • S
      net: Reject non-netdevs in qmp_netdev_del() · 645c9496
      Stefan Hajnoczi 提交于
      The netdev_del command crashes when given a -net device, because it
      calls qemu_opts_del(NULL).
      
      Check that this is a -netdev before attempting to delete it and the
      QemuOpts.
      
      Note the subtle change from qemu_find_opts_err("netdev", errp) to
      qemu_find_opts_err("netdev", NULL).  Since "netdev" is a built in
      options group and we don't check for NULL return anyway, there's no use
      in passing errp here.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      645c9496
  21. 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
  22. 14 9月, 2012 2 次提交
    • S
      net: add receive_disabled logic to iov delivery path · c67f5dc1
      Stefan Hajnoczi 提交于
      This patch adds the missing NetClient->receive_disabled logic in the
      sendv delivery code path.  It seems that commit
      893379ef ("net: disable receiving if
      client returns zero") only added the logic to qemu_deliver_packet() and
      not qemu_deliver_packet_iov().
      
      The receive_disabled flag should be automatically set when .receive(),
      .receive_raw(), or .receive_iov() return 0.  No further packets will be
      delivered to the NetClient until the receive_disabled flag is cleared
      again by calling qemu_flush_queued_packets().
      
      Typically the NetClient will wait until its file descriptor becomes
      writable and then invoke qemu_flush_queued_packets() to resume
      transmission.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      c67f5dc1
    • P
      net: notify iothread after flushing queue · 987a9b48
      Paolo Bonzini 提交于
      virtio-net has code to flush the queue and notify the iothread
      whenever new receive buffers are added by the guest.  That is
      fine, and indeed we need to do the same in all other drivers.
      However, notifying the iothread should be work for the network
      subsystem.  And since we are at it we can add a little smartness:
      if some of the queued packets already could not be delivered,
      there is no need to notify the iothread.
      Reported-by: NLuigi Rizzo <rizzo@iet.unipi.it>
      Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Cc: Jan Kiszka <jan.kiszka@siemens.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      987a9b48
  23. 07 9月, 2012 1 次提交
  24. 03 8月, 2012 1 次提交
    • P
      Support 'help' as a synonym for '?' in command line options · c8057f95
      Peter Maydell 提交于
      For command line options which permit '?' meaning 'please list the
      permitted values', add support for 'help' as a synonym, by abstracting
      the check out into a helper function.
      
      This change means that in some cases where we were being lazy in
      our string parsing, "?junk" will now be rejected as an invalid option
      rather than being (undocumentedly) treated the same way as "?".
      
      Update the documentation to use 'help' rather than '?', since '?'
      is a shell metacharacter and thus prone to fail confusingly if there
      is a single character filename in the current working directory and
      the '?' has not been escaped. It's therefore better to steer users
      towards 'help', though '?' is retained for backwards compatibility.
      
      We do not, however, update the output of the system emulator's -help
      (or any documentation autogenerated from the qemu-options.hx which
      is the source of the -help text) because libvirt parses our -help
      output and will break. At a later date when QEMU provides a better
      interface so libvirt can avoid having to do this, we can update the
      -help text too.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c8057f95