1. 27 9月, 2016 7 次提交
    • Z
      Jhash: add linux kernel jhashtable in qemu · ccf0426c
      Zhang Chen 提交于
      Jhash will be used by colo-compare and filter-rewriter
      to save and lookup net connection info
      Signed-off-by: NZhang Chen <zhangchen.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      ccf0426c
    • Z
      net/colo.c: add colo.c to define and handle packet · 59509ec1
      Zhang Chen 提交于
      The net/colo.c is used by colo-compare and filter-rewriter.
      this can share common data structure like net packet,
      and other functions.
      Signed-off-by: NZhang Chen <zhangchen.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      59509ec1
    • Z
      colo-compare: introduce colo compare initialization · 7dce4e6f
      Zhang Chen 提交于
      This a COLO net ascii figure:
      
       Primary qemu                                                           Secondary qemu
      +--------------------------------------------------------------+       +----------------------------------------------------------------+
      | +----------------------------------------------------------+ |       |  +-----------------------------------------------------------+ |
      | |                                                          | |       |  |                                                           | |
      | |                        guest                             | |       |  |                        guest                              | |
      | |                                                          | |       |  |                                                           | |
      | +-------^--------------------------+-----------------------+ |       |  +---------------------+--------+----------------------------+ |
      |         |                          |                         |       |                        ^        |                              |
      |         |                          |                         |       |                        |        |                              |
      |         |  +------------------------------------------------------+  |                        |        |                              |
      |netfilter|  |                       |                         |    |  |   netfilter            |        |                              |
      | +----------+ +----------------------------+                  |    |  |  +-----------------------------------------------------------+ |
      | |       |  |                       |      |        out       |    |  |  |                     |        |  filter excute order       | |
      | |       |  |          +-----------------------------+        |    |  |  |                     |        | +------------------->      | |
      | |       |  |          |            |      |         |        |    |  |  |                     |        |   TCP                      | |
      | | +-----+--+-+  +-----v----+ +-----v----+ |pri +----+----+sec|    |  |  | +------------+  +---+----+---v+rewriter++  +------------+ | |
      | | |          |  |          | |          | |in  |         |in |    |  |  | |            |  |        |              |  |            | | |
      | | |  filter  |  |  filter  | |  filter  +------>  colo   <------+ +-------->  filter   +--> adjust |   adjust     +-->   filter   | | |
      | | |  mirror  |  |redirector| |redirector| |    | compare |   |  |    |  | | redirector |  | ack    |   seq        |  | redirector | | |
      | | |          |  |          | |          | |    |         |   |  |    |  | |            |  |        |              |  |            | | |
      | | +----^-----+  +----+-----+ +----------+ |    +---------+   |  |    |  | +------------+  +--------+--------------+  +---+--------+ | |
      | |      |   tx        |   rx           rx  |                  |  |    |  |            tx                        all       |  rx      | |
      | |      |             |                    |                  |  |    |  +-----------------------------------------------------------+ |
      | |      |             +--------------+     |                  |  |    |                                                   |            |
      | |      |   filter excute order      |     |                  |  |    |                                                   |            |
      | |      |  +---------------->        |     |                  |  +--------------------------------------------------------+            |
      | +-----------------------------------------+                  |       |                                                                |
      |        |                            |                        |       |                                                                |
      +--------------------------------------------------------------+       +----------------------------------------------------------------+
               |guest receive               | guest send
               |                            |
      +--------+----------------------------v------------------------+
      |                                                              |                          NOTE: filter direction is rx/tx/all
      |                         tap                                  |                          rx:receive packets sent to the netdev
      |                                                              |                          tx:receive packets sent by the netdev
      +--------------------------------------------------------------+
      
      In COLO-compare, we do packet comparing job.
      Packets coming from the primary char indev will be sent to outdev.
      Packets coming from the secondary char dev will be dropped after comparing.
      colo-comapre need two input chardev and one output chardev:
      primary_in=chardev1-id (source: primary send packet)
      secondary_in=chardev2-id (source: secondary send packet)
      outdev=chardev3-id
      
      usage:
      
      primary:
      -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
      -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
      -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
      -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
      -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
      -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
      -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
      -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
      -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
      -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
      -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
      -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
      
      secondary:
      -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
      -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
      -chardev socket,id=red0,host=3.3.3.3,port=9003
      -chardev socket,id=red1,host=3.3.3.3,port=9004
      -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
      -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
      Signed-off-by: NZhang Chen <zhangchen.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      7dce4e6f
    • Z
      qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext · e92aa36a
      Zhang Chen 提交于
      Add qemu_chr_add_handlers_full() API, we can use
      this API pass in a GMainContext,make handler run
      in the context rather than main_loop.
      This comments from Daniel P . Berrange.
      Signed-off-by: NZhang Chen <zhangchen.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      e92aa36a
    • S
      net: hmp_host_net_remove: Del the -net option of the removed host_net · a4543b1b
      Shmulik Ladkani 提交于
      Upon hmp_host_net_remove(), the appropriate -net client is deleted
      (according to the given vlan_id and device id), as well as the
      corresponsing hub port.
      
      However, the relevant '-net' option that was added by former
      hmp_host_net_add() call is still present in "net" options group.
      
      This makes the following legit HMP sequence erroneous:
      
      (qemu) host_net_add tap id=n1,ifname=tap1,script=no,downscript=no,vlan=1
      (qemu) host_net_remove 1 n1
      (qemu) host_net_add tap id=n1,ifname=tap1,script=no,downscript=no,vlan=1
      Duplicate ID 'n1' for net
      
      Fix, by deleting the stored '-net' option associated with the given
      device id.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@ravellosystems.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      a4543b1b
    • M
      virtio-net: allow increasing rx queue size · 1c0fbfa3
      Michael S. Tsirkin 提交于
      This allows increasing the rx queue size up to 1024: unlike with tx,
      guests don't put in huge S/G lists into RX so the risk of running into
      the max 1024 limitation due to some off-by-one seems small.
      
      It's helpful for users like OVS-DPDK which don't do any buffering on the
      host - 1K roughly matches 500 entries in tun + 256 in the current rx
      queue, which seems to work reasonably well. We could probably make do
      with ~750 entries but virtio spec limits us to powers of two.
      It might be a good idea to specify an s/g size limit in a future
      version.
      
      It also might be possible to make the queue size smaller down the road, 64
      seems like the minimal value which will still work (as guests seem to
      assume a queue full of 1.5K buffers is enough to process the largest
      incoming packet, which is ~64K).  No one actually asked for this, and
      with virtio 1 guests can reduce ring size without need for host
      configuration, so don't bother with this for now.
      
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Suggested-by: NPatrik Hermansson <phermansson@gmail.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      1c0fbfa3
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · 7cfdc02d
      Peter Maydell 提交于
      virtio, pc: fixes and features
      
      beginning of guest error handling for virtio devices
      amd iommu
      pc compat fixes
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Fri 23 Sep 2016 23:02:09 BST
      # gpg:                using RSA key 0x281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        hw/i386: AMD IOMMU IVRS table
        hw/i386: Introduce AMD IOMMU
        hw/i386/trace-events: Add AMD IOMMU trace events
        hw/pci: Prepare for AMD IOMMU
        virtio: handle virtqueue_get_head() errors
        virtio: handle virtqueue_num_heads() errors
        virtio: handle virtqueue_read_next_desc() errors
        virtio: use unsigned int for virtqueue_get_avail_bytes() index
        virtio: handle virtqueue_get_avail_bytes() errors
        virtio: handle virtqueue_map_desc() errors
        virtio: migrate vdev->broken flag
        virtio: stop virtqueue processing if device is broken
        virtio: fix stray tab character
        target-i386: turn off CPU.l3-cache only for 2.7 and older machine types
        pc: clean up COMPAT macro chaining
        virtio: add check for descriptor's mapped address
        tests: add /vhost-user/flags-mismatch test
        tests: add a simple /vhost-user/multiqueue test
        tests: add /vhost-user/connect-fail test
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      7cfdc02d
  2. 24 9月, 2016 13 次提交
  3. 23 9月, 2016 20 次提交