[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 03/12] vhost_net: Use ops->vhost_restart_queue in vhost_net_v
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH 03/12] vhost_net: Use ops->vhost_restart_queue in vhost_net_virtqueue_restart |
Date: |
Thu, 20 Jul 2023 20:14:50 +0200 |
Actually use vhost_restart_queue operation at restart.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/net/vhost_net.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 6b958d6363..416b7d8132 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -608,14 +608,16 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev,
NetClientState *nc,
goto err_start;
}
- if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
+ if (vhost_ops->vhost_restart_queue) {
+ r = vhost_ops->vhost_restart_queue(&net->dev, idx);
+ } else if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
file.index = idx;
file.fd = net->backend;
r = vhost_net_set_backend(&net->dev, &file);
- if (r < 0) {
- r = -errno;
- goto err_start;
- }
+ }
+ if (r < 0) {
+ r = -errno;
+ goto err_start;
}
return 0;
--
2.39.3
- [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ, Eugenio Pérez, 2023/07/20
- [RFC PATCH 01/12] vhost: add vhost_reset_queue_op, Eugenio Pérez, 2023/07/20
- [RFC PATCH 03/12] vhost_net: Use ops->vhost_restart_queue in vhost_net_virtqueue_restart,
Eugenio Pérez <=
- [RFC PATCH 05/12] vdpa: add vhost_vdpa_set_vring_ready_internal, Eugenio Pérez, 2023/07/20
- [RFC PATCH 04/12] vhost_net: Use ops->vhost_reset_queue in vhost_net_virtqueue_reset, Eugenio Pérez, 2023/07/20
- [RFC PATCH 02/12] vhost: add vhost_restart_queue_op, Eugenio Pérez, 2023/07/20
- [RFC PATCH 08/12] vdpa: add vhost_vdpa_svq_start, Eugenio Pérez, 2023/07/20
- [RFC PATCH 07/12] vdpa: add vhost_vdpa_reset_queue, Eugenio Pérez, 2023/07/20
- [RFC PATCH 06/12] vdpa: add vhost_vdpa_svq_stop, Eugenio Pérez, 2023/07/20