qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 50764f: virtio: right size for virtio_queue_g


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 50764f: virtio: right size for virtio_queue_get_avail_size
Date: Fri, 25 Sep 2015 10:00:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 50764fc8a382dc17ccc06c0ba29184d0fd73016e
      
https://github.com/qemu/qemu/commit/50764fc8a382dc17ccc06c0ba29184d0fd73016e
  Author: Pierre Morel <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: right size for virtio_queue_get_avail_size

Being working on dataplane I notice something strange:

virtio_queue_get_avail_size() used a 64bit size index
for the calculation of the available ring size.

It is quite strange but it did work with the old calculation
of the avail ring, at most with performance penalty,
and I wonder where I missed something.

This patch let use a 16bit size as defined in virtio_ring.h

Signed-off-by: Pierre Morel <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 1f8828ef573c83365b4a87a776daf8bcef1caa21
      
https://github.com/qemu/qemu/commit/1f8828ef573c83365b4a87a776daf8bcef1caa21
  Author: Jason Wang <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: unbreak self announcement and guest offloads after migration

After commit 019a3edbb25f1571e876f8af1ce4c55412939e5d ("virtio: make
features 64bit wide"). Device's guest_features was actually set after
vdc->load(). This breaks the assumption that device specific load()
function can check guest_features. For virtio-net, self announcement
and guest offloads won't work after migration.

Fixing this by defer them to virtio_net_load() where guest_features
were guaranteed to be set. Other virtio devices looks fine.

Fixes: 019a3edbb25f1571e876f8af1ce4c55412939e5d
       ("virtio: make features 64bit wide")
Cc: address@hidden
Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>


  Commit: 0b7783a79ef73a06f3a67b68e72d109afe975b77
      
https://github.com/qemu/qemu/commit/0b7783a79ef73a06f3a67b68e72d109afe975b77
  Author: Eduardo Habkost <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/i386/pc_q35.c

  Log Message:
  -----------
  q35: Move options common to all classes to pc_q35_machine_options()

The existing default_machine_opts, default_display, no_floppy, and
no_tco settings will still apply to future machine classes. So it makes
sense to move them to pc_q35_machine_options() instead of keeping them
in a version-specific machine_options function.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 254bdb1cbfd467ff9897c75a28a472e4381ce4cf
      
https://github.com/qemu/qemu/commit/254bdb1cbfd467ff9897c75a28a472e4381ce4cf
  Author: Eduardo Habkost <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/i386/pc_piix.c

  Log Message:
  -----------
  q35: Move options common to all classes to pc_i440fx_machine_options()

The existing default_machine_opts and default_display settings will
still apply to future machine classes. So it makes sense to move them to
pc_i440fx_machine_options() instead of keeping them in a
version-specific machine_options function.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 87e896abe6d926caba19a9b8a83936fca2137f05
      
https://github.com/qemu/qemu/commit/87e896abe6d926caba19a9b8a83936fca2137f05
  Author: Eduardo Habkost <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/compat.h
    M include/hw/i386/pc.h

  Log Message:
  -----------
  pc: Introduce pc-*-2.5 machine classes

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 46c5d0823d0186daf4064065bf739858dadfcf8c
      
https://github.com/qemu/qemu/commit/46c5d0823d0186daf4064065bf739858dadfcf8c
  Author: Cornelia Huck <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: ring sizes vs. reset

We allow guests to change the size of the virtqueue rings by supplying
a number of buffers that is different from the number of buffers the
device was initialized with. Current code has some problems, however,
since reset does not reset the ringsizes to the default values (as this
is not saved anywhere).

Let's extend the core code to keep track of the default ringsizes and
migrate them once the guest changed them for any of the virtqueues
for a device.

Reviewed-by: Jason Wang <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 79cd0c80f82215a32890e3d30ff621b32ece5156
      
https://github.com/qemu/qemu/commit/79cd0c80f82215a32890e3d30ff621b32ece5156
  Author: Cornelia Huck <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/s390x/virtio-ccw.c

  Log Message:
  -----------
  virtio-ccw: support ring size changes

Wire up changing the ring size for virtio-1 devices.

Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: b4f8f9df152fca0e79b7a3ca40a3eea700a40855
      
https://github.com/qemu/qemu/commit/b4f8f9df152fca0e79b7a3ca40a3eea700a40855
  Author: Cornelia Huck <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/s390x/virtio-ccw.c

  Log Message:
  -----------
  virtio-ccw: feature bits > 31 handling

We currently switch off the VERSION_1 feature bit if the guest has
not negotiated at least revision 1. As no feature bits beyond 31 are
valid however unless VERSION_1 has been negotiated, make sure that
legacy guests never see a feature bit beyond 31.

Reviewed-by: David Hildenbrand <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 542571d523268357fd8f5b1a523ba2a6191c4c18
      
https://github.com/qemu/qemu/commit/542571d523268357fd8f5b1a523ba2a6191c4c18
  Author: Cornelia Huck <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/virtio-ccw.c
    M hw/s390x/virtio-ccw.h

  Log Message:
  -----------
  virtio-ccw: enable virtio-1

Let's enable revision 1 for virtio-ccw devices. We can always offer
VERSION_1 as drivers in legacy mode won't be able to see it anyway.

We have to introduce a way to set a lower maximum revision for a device
to accommodate the following cases:
- compat machines (to enforce legacy only)
- virtio-blk with scsi support (version 1 + scsi is fenced by common
  code, with a user-configured max revision of 0 we can allow scsi
  via not offering VERSION_1)

Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 7305483a3d113456681ba6c6e8dd41513decd5f6
      
https://github.com/qemu/qemu/commit/7305483a3d113456681ba6c6e8dd41513decd5f6
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: use VHOST_USER_XXX macro for switch statement

So that we could let vhost_user_call to handle extented requests,
such as VHOST_USER_GET/SET_PROTOCOL_FEATURES, instead of invoking
vhost_user_read/write and constructing the msg again by ourself.

Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: dcb10c000cdd4d14f5ac4f07b04fb666494ef4a8
      
https://github.com/qemu/qemu/commit/dcb10c000cdd4d14f5ac4f07b04fb666494ef4a8
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/virtio/vhost-user.c
    M include/hw/virtio/vhost.h

  Log Message:
  -----------
  vhost-user: add protocol feature negotiation

Support a separate bitmask for vhost-user protocol features,
and messages to get/set protocol features.

Invoke them at init.

No features are defined yet.

[ leverage vhost_user_call for request handling -- Yuanhan Liu ]

Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: d1f8b30ec8dde0318fd1b98d24a64926feae9625
      
https://github.com/qemu/qemu/commit/d1f8b30ec8dde0318fd1b98d24a64926feae9625
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/virtio/vhost-user.c
    M linux-headers/linux/vhost.h
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

Quote from Michael:

    We really should rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE.

Suggested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: e2051e9e004649b53af4db34f78c689fb44e075b
      
https://github.com/qemu/qemu/commit/e2051e9e004649b53af4db34f78c689fb44e075b
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/virtio/vhost-user.c
    M include/hw/virtio/vhost.h
    M include/net/vhost_net.h

  Log Message:
  -----------
  vhost-user: add VHOST_USER_GET_QUEUE_NUM message

This is for querying how many queues the backend supports if it has mq
support(when VHOST_USER_PROTOCOL_F_MQ flag is set from the quried
protocol features).

vhost_net_get_max_queues() is the interface to export that value, and
to tell if the backend supports # of queues user requested, which is
done in the following patch.

Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: fc57fd9900dc6344b8833e7641f63cddc6840301
      
https://github.com/qemu/qemu/commit/fc57fd9900dc6344b8833e7641f63cddc6840301
  Author: Yuanhan Liu <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M hw/virtio/vhost-backend.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost.c
    M include/hw/virtio/vhost-backend.h

  Log Message:
  -----------
  vhost: introduce vhost_backend_get_vq_index method

Minusing the idx with the base(dev->vq_index) for vhost-kernel, and
then adding it back for vhost-user doesn't seem right. Here introduces
a new method vhost_backend_get_vq_index() for getting the right vq
index for following vhost messages calls.

Suggested-by: Jason Wang <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: b931bfbf042983f311b3b09894d8030b2755a638
      
https://github.com/qemu/qemu/commit/b931bfbf042983f311b3b09894d8030b2755a638
  Author: Changchun Ouyang <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost.c
    M net/vhost-user.c
    M qapi-schema.json
    M qemu-options.hx

  Log Message:
  -----------
  vhost-user: add multiple queue support

This patch is initially based a patch from Nikolay Nikolaev.

This patch adds vhost-user multiple queue support, by creating a nc
and vhost_net pair for each queue.

Qemu exits if find that the backend can't support the number of requested
queues (by providing queues=# option). The max number is queried by a
new message, VHOST_USER_GET_QUEUE_NUM, and is sent only when protocol
feature VHOST_USER_PROTOCOL_F_MQ is present first.

The max queue check is done at vhost-user initiation stage. We initiate
one queue first, which, in the meantime, also gets the max_queues the
backend supports.

In older version, it was reported that some messages are sent more times
than necessary. Here we came an agreement with Michael that we could
categorize vhost user messages to 2 types: non-vring specific messages,
which should be sent only once, and vring specific messages, which should
be sent per queue.

Here I introduced a helper function vhost_user_one_time_request(), which
lists following messages as non-vring specific messages:
   VHOST_USER_SET_OWNER
  VHOST_USER_RESET_DEVICE
  VHOST_USER_SET_MEM_TABLE
  VHOST_USER_GET_QUEUE_NUM

For above messages, we simply ignore them when they are not sent the first
time.

Signed-off-by: Nikolay Nikolaev <address@hidden>
Signed-off-by: Changchun Ouyang <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: 7263a0ad7899994b719ebed736a1119cc2e08110
      
https://github.com/qemu/qemu/commit/7263a0ad7899994b719ebed736a1119cc2e08110
  Author: Changchun Ouyang <address@hidden>
  Date:   2015-09-24 (Thu, 24 Sep 2015)

  Changed paths:
    M docs/specs/vhost-user.txt
    M hw/net/vhost_net.c
    M hw/net/virtio-net.c
    M hw/virtio/vhost-user.c
    M include/hw/virtio/vhost-backend.h
    M include/net/vhost_net.h

  Log Message:
  -----------
  vhost-user: add a new message to disable/enable a specific virt queue.

Add a new message, VHOST_USER_SET_VRING_ENABLE, to enable or disable
a specific virt queue, which is similar to attach/detach queue for
tap device.

virtio driver on guest doesn't have to use max virt queue pair, it
could enable any number of virt queue ranging from 1 to max virt
queue pair.

Signed-off-by: Changchun Ouyang <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Yuanhan Liu <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: 9cc3b73cd8a88e16756f5d14fa87e156a4ce1e8d
      
https://github.com/qemu/qemu/commit/9cc3b73cd8a88e16756f5d14fa87e156a4ce1e8d
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: add more devices to the PC section

For chipset devices, I can co-maintain it with Michael.

Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f178bc6b68e6c65cda7354ec4a671860b3123f7a
      
https://github.com/qemu/qemu/commit/f178bc6b68e6c65cda7354ec4a671860b3123f7a
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: add more devices to the PCI section

Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: cdf98182420e3bec62e2fd957eb8a17761161c0f
      
https://github.com/qemu/qemu/commit/cdf98182420e3bec62e2fd957eb8a17761161c0f
  Author: Peter Maydell <address@hidden>
  Date:   2015-09-25 (Fri, 25 Sep 2015)

  Changed paths:
    M MAINTAINERS
    M docs/specs/vhost-user.txt
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/net/vhost_net.c
    M hw/net/virtio-net.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/virtio-ccw.c
    M hw/s390x/virtio-ccw.h
    M hw/virtio/vhost-backend.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost.c
    M hw/virtio/virtio.c
    M include/hw/compat.h
    M include/hw/i386/pc.h
    M include/hw/virtio/vhost-backend.h
    M include/hw/virtio/vhost.h
    M include/net/vhost_net.h
    M linux-headers/linux/vhost.h
    M net/vhost-user.c
    M qapi-schema.json
    M qemu-options.hx
    M tests/vhost-user-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio,pc features, fixes

New features:
    vhost-user multiqueue support
    virtio-ccw virtio 1 support

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Fri 25 Sep 2015 07:40:35 BST using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"

* remotes/mst/tags/for_upstream:
  MAINTAINERS: add more devices to the PCI section
  MAINTAINERS: add more devices to the PC section
  vhost-user: add a new message to disable/enable a specific virt queue.
  vhost-user: add multiple queue support
  vhost: introduce vhost_backend_get_vq_index method
  vhost-user: add VHOST_USER_GET_QUEUE_NUM message
  vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE
  vhost-user: add protocol feature negotiation
  vhost-user: use VHOST_USER_XXX macro for switch statement
  virtio-ccw: enable virtio-1
  virtio-ccw: feature bits > 31 handling
  virtio-ccw: support ring size changes
  virtio: ring sizes vs. reset
  pc: Introduce pc-*-2.5 machine classes
  q35: Move options common to all classes to pc_i440fx_machine_options()
  q35: Move options common to all classes to pc_q35_machine_options()
  virtio-net: unbreak self announcement and guest offloads after migration
  virtio: right size for virtio_queue_get_avail_size

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/8a47d575dfac...cdf98182420e

reply via email to

[Prev in Thread] Current Thread [Next in Thread]