qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: den@openvz.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [RFC 2/2] virtio: show features acked by guest in 'info qtree' dump
Date: Wed, 11 May 2016 12:52:04 +0300	[thread overview]
Message-ID: <1462960324-4655-3-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1462960324-4655-1-git-send-email-den@openvz.org>

It is very convinient and useful for debug purpose to expose the set of
features negotiated with guest. The patch exports those features via
read-only bit properties.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Eric Blake <eblake@redhat.com>
---
 hw/net/virtio-net.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 5798f87..cb9ce9c 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1904,6 +1904,50 @@ static Property virtio_net_properties[] = {
     DEFINE_PROP_BIT("ctrl_guest_offloads", VirtIONet, host_features,
                     VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true),
     DEFINE_PROP_BIT("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, false),
+
+    DEFINE_PROP_RO_BIT64("csum_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CSUM),
+    DEFINE_PROP_RO_BIT64("guest_csum_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_CSUM),
+    DEFINE_PROP_RO_BIT64("gso_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GSO),
+    DEFINE_PROP_RO_BIT64("guest_tso4_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_TSO4),
+    DEFINE_PROP_RO_BIT64("guest_tso6_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_TSO6),
+    DEFINE_PROP_RO_BIT64("guest_ecn_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_ECN),
+    DEFINE_PROP_RO_BIT64("guest_ufo_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_UFO),
+    DEFINE_PROP_RO_BIT64("guest_announce_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_GUEST_ANNOUNCE),
+    DEFINE_PROP_RO_BIT64("host_tso4_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_HOST_TSO4),
+    DEFINE_PROP_RO_BIT64("host_tso6_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_HOST_TSO6),
+    DEFINE_PROP_RO_BIT64("host_ecn_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_HOST_ECN),
+    DEFINE_PROP_RO_BIT64("host_ufo_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_HOST_UFO),
+    DEFINE_PROP_RO_BIT64("mrg_rxbuf_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_MRG_RXBUF),
+    DEFINE_PROP_RO_BIT64("status_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_STATUS),
+    DEFINE_PROP_RO_BIT64("ctrl_vq_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CTRL_VQ),
+    DEFINE_PROP_RO_BIT64("ctrl_rx_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CTRL_RX),
+    DEFINE_PROP_RO_BIT64("ctrl_vlan_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CTRL_VLAN),
+    DEFINE_PROP_RO_BIT64("ctrl_rx_extra_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CTRL_RX_EXTRA),
+    DEFINE_PROP_RO_BIT64("ctrl_mac_addr_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_CTRL_MAC_ADDR),
+    DEFINE_PROP_RO_BIT64("ctrl_guest_offloads_acked", VirtIODevice,
+                         guest_features, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS),
+    DEFINE_PROP_RO_BIT64("mq_acked", VirtIODevice, guest_features,
+                         VIRTIO_NET_F_MQ),
+
     DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf),
     DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer,
                        TX_TIMER_INTERVAL),
-- 
2.5.0

  parent reply	other threads:[~2016-05-11  9:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  9:52 [Qemu-devel] [RFC for 2.7 0/2] virtio: show guest features in 'info qtree' Denis V. Lunev
2016-05-11  9:52 ` [Qemu-devel] [RFC 1/2] qdev: add read-only bit/bit64 property Denis V. Lunev
2016-05-11  9:52 ` Denis V. Lunev [this message]
2016-05-11 17:24   ` [Qemu-devel] [RFC 2/2] virtio: show features acked by guest in 'info qtree' dump Michael S. Tsirkin
2016-05-11 10:34 ` [Qemu-devel] [RFC for 2.7 0/2] virtio: show guest features in 'info qtree' Cornelia Huck
2016-05-11 11:06   ` Denis V. Lunev
2016-05-11 12:02     ` Cornelia Huck
2016-05-11 13:49       ` Denis V. Lunev
2016-05-11 14:27         ` Cornelia Huck
2016-05-11 10:39 ` Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462960324-4655-3-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).