From: Maxim Davydov <maxim.davydov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: den@openvz.org, mst@redhat.com, stefanha@redhat.com,
fam@euphon.net, amit@kernel.org, kraxel@redhat.com,
berrange@redhat.com, Maxim Davydov <maxim.davydov@virtuozzo.com>
Subject: [PATCH v1 5/8] virtio-net: Add tracking of the virtio guest feature bits
Date: Wed, 1 Sep 2021 12:08:01 +0300 [thread overview]
Message-ID: <20210901090804.7139-6-maxim.davydov@virtuozzo.com> (raw)
In-Reply-To: <20210901090804.7139-1-maxim.davydov@virtuozzo.com>
Add tracking of the bits acknowledged by the guest
Signed-off-by: Maxim Davydov <maxim.davydov@virtuozzo.com>
---
hw/net/virtio-net.c | 118 ++++++++++++++++++++++++++++++++--------------------
1 file changed, 72 insertions(+), 46 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 16d20cd..2fd9171 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3562,52 +3562,78 @@ static const VMStateDescription vmstate_virtio_net = {
};
static Property virtio_net_properties[] = {
- DEFINE_PROP_BIT64("csum", VirtIONet, host_features,
- VIRTIO_NET_F_CSUM, true),
- DEFINE_PROP_BIT64("guest_csum", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_CSUM, true),
- DEFINE_PROP_BIT64("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, true),
- DEFINE_PROP_BIT64("guest_tso4", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_TSO4, true),
- DEFINE_PROP_BIT64("guest_tso6", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_TSO6, true),
- DEFINE_PROP_BIT64("guest_ecn", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_ECN, true),
- DEFINE_PROP_BIT64("guest_ufo", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_UFO, true),
- DEFINE_PROP_BIT64("guest_announce", VirtIONet, host_features,
- VIRTIO_NET_F_GUEST_ANNOUNCE, true),
- DEFINE_PROP_BIT64("host_tso4", VirtIONet, host_features,
- VIRTIO_NET_F_HOST_TSO4, true),
- DEFINE_PROP_BIT64("host_tso6", VirtIONet, host_features,
- VIRTIO_NET_F_HOST_TSO6, true),
- DEFINE_PROP_BIT64("host_ecn", VirtIONet, host_features,
- VIRTIO_NET_F_HOST_ECN, true),
- DEFINE_PROP_BIT64("host_ufo", VirtIONet, host_features,
- VIRTIO_NET_F_HOST_UFO, true),
- DEFINE_PROP_BIT64("mrg_rxbuf", VirtIONet, host_features,
- VIRTIO_NET_F_MRG_RXBUF, true),
- DEFINE_PROP_BIT64("status", VirtIONet, host_features,
- VIRTIO_NET_F_STATUS, true),
- DEFINE_PROP_BIT64("ctrl_vq", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_VQ, true),
- DEFINE_PROP_BIT64("ctrl_rx", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_RX, true),
- DEFINE_PROP_BIT64("ctrl_vlan", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_VLAN, true),
- DEFINE_PROP_BIT64("ctrl_rx_extra", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_RX_EXTRA, true),
- DEFINE_PROP_BIT64("ctrl_mac_addr", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_MAC_ADDR, true),
- DEFINE_PROP_BIT64("ctrl_guest_offloads", VirtIONet, host_features,
- VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true),
- DEFINE_PROP_BIT64("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, false),
- DEFINE_PROP_BIT64("rss", VirtIONet, host_features,
- VIRTIO_NET_F_RSS, false),
- DEFINE_PROP_BIT64("hash", VirtIONet, host_features,
- VIRTIO_NET_F_HASH_REPORT, false),
- DEFINE_PROP_BIT64("guest_rsc_ext", VirtIONet, host_features,
- VIRTIO_NET_F_RSC_EXT, false),
+ DEFINE_VIRTIO_FEATURE_BIT64("csum", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CSUM, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_csum", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_CSUM, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("gso", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GSO, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_tso4", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_TSO4, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_tso6", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_TSO6, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_ecn", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_ECN, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_ufo", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_UFO, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_announce", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_GUEST_ANNOUNCE, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("host_tso4", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_HOST_TSO4, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("host_tso6", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_HOST_TSO6, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("host_ecn", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_HOST_ECN, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("host_ufo", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_HOST_UFO, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("mrg_rxbuf", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_MRG_RXBUF, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("status", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_STATUS, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_vq", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_VQ, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_rx", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_RX, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_vlan", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_VLAN, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_rx_extra", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_RX_EXTRA, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_mac_addr", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_MAC_ADDR, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("ctrl_guest_offloads", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true),
+ DEFINE_VIRTIO_FEATURE_BIT64("mq", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_MQ, false),
+ DEFINE_VIRTIO_FEATURE_BIT64("rss", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_RSS, false),
+ DEFINE_VIRTIO_FEATURE_BIT64("hash", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_HASH_REPORT, false),
+ DEFINE_VIRTIO_FEATURE_BIT64("guest_rsc_ext", VirtIONet, host_features,
+ parent_obj.guest_features,
+ VIRTIO_NET_F_RSC_EXT, false),
DEFINE_PROP_UINT32("rsc_interval", VirtIONet, rsc_timeout,
VIRTIO_NET_RSC_DEFAULT_INTERVAL),
DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf),
--
1.8.3.1
next prev parent reply other threads:[~2021-09-01 14:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 9:07 [PATCH v1 0/8] Virtio features acknowledged by guest Maxim Davydov
2021-09-01 9:07 ` [PATCH v1 1/8] qdev-properties: Add read-only 64 bit property Maxim Davydov
2021-09-01 9:07 ` [PATCH v1 2/8] virtio: Add tracking of the common virtio guest features Maxim Davydov
2021-09-01 9:07 ` [PATCH v1 3/8] virtio-gpu: Add tracking of the virtio guest feature bits Maxim Davydov
2021-09-01 9:08 ` [PATCH v1 4/8] virtio-serial: " Maxim Davydov
2021-09-01 9:08 ` Maxim Davydov [this message]
2021-09-01 9:08 ` [PATCH v1 6/8] scsi: Add tracking of the acknowledged " Maxim Davydov
2021-09-01 9:08 ` [PATCH v1 7/8] virtio-blk: Add tracking of the virtio guest " Maxim Davydov
2021-09-01 9:08 ` [PATCH v1 8/8] virtio-balloon: " Maxim Davydov
2021-09-02 12:34 ` [PATCH v1 0/8] Virtio features acknowledged by guest Stefan Hajnoczi
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=20210901090804.7139-6-maxim.davydov@virtuozzo.com \
--to=maxim.davydov@virtuozzo.com \
--cc=amit@kernel.org \
--cc=berrange@redhat.com \
--cc=den@openvz.org \
--cc=fam@euphon.net \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).