[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 5/7] vdpa: Reorder net_vhost_vdpa_info
From: |
Eugenio Pérez |
Subject: |
[PATCH v4 5/7] vdpa: Reorder net_vhost_vdpa_info |
Date: |
Fri, 22 Jul 2022 13:12:43 +0200 |
Since we're going to use a new info callback to restore NIC status, we
need that callback to be able to send and receive CVQ commands. Reorder
so all needed functions are available for it.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index bbe1830824..61516b1432 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -211,16 +211,6 @@ static ssize_t vhost_vdpa_receive(NetClientState *nc,
const uint8_t *buf,
return 0;
}
-static NetClientInfo net_vhost_vdpa_info = {
- .type = NET_CLIENT_DRIVER_VHOST_VDPA,
- .size = sizeof(VhostVDPAState),
- .receive = vhost_vdpa_receive,
- .cleanup = vhost_vdpa_cleanup,
- .has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
- .has_ufo = vhost_vdpa_has_ufo,
- .check_peer_type = vhost_vdpa_check_peer_type,
-};
-
static void vhost_vdpa_cvq_unmap_buf(struct vhost_vdpa *v, void *addr)
{
VhostIOVATree *tree = v->iova_tree;
@@ -375,6 +365,16 @@ static virtio_net_ctrl_ack
vhost_vdpa_net_cvq_add(VhostShadowVirtqueue *svq,
return VIRTIO_NET_OK;
}
+static NetClientInfo net_vhost_vdpa_info = {
+ .type = NET_CLIENT_DRIVER_VHOST_VDPA,
+ .size = sizeof(VhostVDPAState),
+ .receive = vhost_vdpa_receive,
+ .cleanup = vhost_vdpa_cleanup,
+ .has_vnet_hdr = vhost_vdpa_has_vnet_hdr,
+ .has_ufo = vhost_vdpa_has_ufo,
+ .check_peer_type = vhost_vdpa_check_peer_type,
+};
+
/**
* Do not forward commands not supported by SVQ. Otherwise, the device could
* accept it and qemu would not know how to update the device model.
--
2.31.1
- [PATCH v4 0/7] NIC vhost-vdpa state restore via Shadow CVQ, Eugenio Pérez, 2022/07/22
- [PATCH v4 1/7] vhost: stop transfer elem ownership in vhost_handle_guest_kick, Eugenio Pérez, 2022/07/22
- [PATCH v4 2/7] vdpa: Extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail, Eugenio Pérez, 2022/07/22
- [PATCH v4 3/7] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Pérez, 2022/07/22
- [PATCH v4 4/7] vdpa: add NetClientState->start() callback, Eugenio Pérez, 2022/07/22
- [PATCH v4 6/7] vdpa: Add virtio-net mac address via CVQ at start, Eugenio Pérez, 2022/07/22
- [PATCH v4 5/7] vdpa: Reorder net_vhost_vdpa_info,
Eugenio Pérez <=
- [PATCH v4 7/7] vdpa: Delete CVQ migration blocker, Eugenio Pérez, 2022/07/22