1. 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
  2. 25 3月, 2013 4 次提交
  3. 27 2月, 2013 1 次提交
    • 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
  4. 02 2月, 2013 10 次提交
    • 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: introduce a helper to get the name of an interface · e5dc0b40
      Jason Wang 提交于
      This patch introduces a helper tap_get_ifname() to get the device name of tap
      device. This is needed when ifname is unspecified in the command line and qemu
      were asked to create tap device by itself. In this situation, the name were
      allocated by kernel, so if multiqueue is asked, we need to fetch its name after
      creating the first queue.
      
      Only linux has this support since it's the only platform that supports
      multiqueue tap.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e5dc0b40
    • 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
      net: multiqueue support · 1ceef9f2
      Jason Wang 提交于
      This patch adds basic multiqueue support for qemu. The idea is simple, an array
      of NetClientStates were introduced in NICState, parse_netdev() were extended to
      find and match all NetClientStates belongs to the backend and place their
      pointers in NICConf. Then qemu_new_nic can setup a N:N mapping between NICStates
      that belongs to a nic and NICStates belongs to the netdev. And a queue_index
      were introduced in NetClientState to track its index. After this, each peers of
      a NICState were abstracted as a queue.
      
      After this change, all NetClientState that belongs to the same backend/nic has
      the same id. When use want to change the link status, all NetClientStates that
      belongs to the same backend/nic will be also changed. When user want to delete
      a device or netdev, all NetClientStates that belongs to the same backend/nic
      will be deleted also. Changing or deleting an specific queue is not allowed.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      1ceef9f2
    • J
      net: introduce NetClientState destructor · f7860455
      Jason Wang 提交于
      To allow allocating an array of NetClientState and free it once, this patch
      introduces destructor of NetClientState. Which could do type specific free,
      which could be used by multiqueue to free the array once.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      f7860455
    • J
      net: introduce qemu_find_net_clients_except() · 6c51ae73
      Jason Wang 提交于
      In multiqueue, all NetClientState that belongs to the same netdev or nic has the
      same id. So this patches introduces an helper qemu_find_net_clients_except()
      which finds all NetClientState with the same id. This will be used by multiqueue
      networking.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      6c51ae73
    • J
      net: intorduce qemu_del_nic() · 948ecf21
      Jason Wang 提交于
      To support multiqueue nic, this patch separate the nic destructor from
      qemu_del_net_client() to a new helper qemu_del_nic() since the mapping bettween
      NiCState and NetClientState were not 1:1 in multiqueue. The following patches
      would refactor this function to support multiqueue nic.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      948ecf21
    • J
      net: introduce qemu_get_nic() · cc1f0f45
      Jason Wang 提交于
      To support multiqueue, this patch introduces a helper qemu_get_nic() to get
      NICState from a NetClientState. The following patches would refactor this helper
      to support multiqueue.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      cc1f0f45
    • J
      net: introduce qemu_get_queue() · b356f76d
      Jason Wang 提交于
      To support multiqueue, the patch introduce a helper qemu_get_queue()
      which is used to get the NetClientState of a device. The following patches would
      refactor this helper to support multiqueue.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b356f76d
    • 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
  5. 17 1月, 2013 1 次提交
  6. 19 12月, 2012 4 次提交