From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
Cindy Lu <lulu@redhat.com>, Laurent Vivier <lvivier@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Parav Pandit <parav@mellanox.com>,
Zhu Lingshan <lingshan.zhu@intel.com>,
Gautam Dawar <gdawar@xilinx.com>,
Liuxiangdong <liuxiangdong5@huawei.com>,
Jason Wang <jasowang@redhat.com>,
Cornelia Huck <cohuck@redhat.com>, Eli Cohen <eli@mellanox.com>,
Stefano Garzarella <sgarzare@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Harpreet Singh Anand <hanand@xilinx.com>
Subject: [RFC 4/8] vdpa: Add log_enabled to VhostVDPAState
Date: Wed, 10 Aug 2022 20:42:16 +0200 [thread overview]
Message-ID: <20220810184220.2362292-5-eperezma@redhat.com> (raw)
In-Reply-To: <20220810184220.2362292-1-eperezma@redhat.com>
This enables VhostVDPAState to track the logging of the memory.
It cannot be merged with s->always_svq because always_svq is immutable
from the moment the device is parsed, and log_enabled must be enabled or
disabled depending on the log state.
Apart from that, they will affect the same to vhost vdpa device,
enabling the shadow virtqueue unconditionally.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 85b10799bd..a035c89c34 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -42,6 +42,10 @@ typedef struct VhostVDPAState {
/* The device always have SVQ enabled */
bool always_svq;
+
+ /* Device log enabled */
+ bool log_enabled;
+
bool started;
} VhostVDPAState;
@@ -346,15 +350,15 @@ static int vhost_vdpa_net_cvq_start(NetClientState *nc)
cvq_group.index = v->dev->vq_index_end - 1;
/* Default values */
- v->listener_shadow_vq = s->always_svq;
- v->shadow_vqs_enabled = s->always_svq;
+ v->listener_shadow_vq = s->always_svq || s->log_enabled;
+ v->shadow_vqs_enabled = s->always_svq || s->log_enabled;
s->vhost_vdpa.address_space_id = VHOST_VDPA_NET_CVQ_PASSTHROUGH;
if (s->address_space_num < 2) {
return 0;
}
- if (s->always_svq) {
+ if (s->always_svq || s->log_enabled) {
goto out;
}
--
2.31.1
next prev parent reply other threads:[~2022-08-10 18:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 18:42 [RFC 0/8] Dinamycally switch to vhost shadow virtqueues at vdpa net migration Eugenio Pérez
2022-08-10 18:42 ` [RFC 1/8] [NOTMERGE] Update linux headers Eugenio Pérez
2022-08-10 18:42 ` [RFC 2/8] vdpa: Extract get_backend_features from vhost_vdpa_get_as_num Eugenio Pérez
2022-08-10 18:42 ` [RFC 3/8] vhost: expose memory listener priority Eugenio Pérez
2022-08-10 18:42 ` Eugenio Pérez [this message]
2022-08-10 18:42 ` [RFC 5/8] vdpa: Add vdpa memory listener Eugenio Pérez
2022-08-19 6:28 ` Jason Wang
2022-08-19 8:30 ` Eugenio Perez Martin
2022-08-19 9:00 ` Jason Wang
2022-08-19 10:34 ` Eugenio Perez Martin
2022-08-23 3:58 ` Jason Wang
2022-11-09 15:41 ` Eugenio Perez Martin
2022-08-10 18:42 ` [RFC 6/8] vdpa: Negotiate _F_SUSPEND feature Eugenio Pérez
2022-08-10 18:42 ` [RFC 7/8] vdpa: Add feature_log member to vhost_vdpa Eugenio Pérez
2022-08-10 18:42 ` [RFC 8/8] vdpa: Conditionally expose _F_LOG in vhost_net devices Eugenio Pérez
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=20220810184220.2362292-5-eperezma@redhat.com \
--to=eperezma@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=cohuck@redhat.com \
--cc=eli@mellanox.com \
--cc=gdawar@xilinx.com \
--cc=hanand@xilinx.com \
--cc=jasowang@redhat.com \
--cc=lingshan.zhu@intel.com \
--cc=liuxiangdong5@huawei.com \
--cc=lulu@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=parav@mellanox.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--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).