[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 08/10] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo
From: |
Eugenio Pérez |
Subject: |
[PATCH v5 08/10] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo |
Date: |
Tue, 2 Aug 2022 19:57:29 +0200 |
Next patches will add a new info callback to restore NIC status through
CVQ. Since only the CVQ vhost device is needed, create it with a new
NetClientInfo.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
v5: Create a new NetClientInfo instead of reusing the dataplane one.
---
net/vhost-vdpa.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 2421bca347..8d400f2dff 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -375,6 +375,16 @@ static virtio_net_ctrl_ack
vhost_vdpa_net_cvq_add(VhostVDPAState *s,
return VIRTIO_NET_OK;
}
+static NetClientInfo net_vhost_vdpa_cvq_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.
@@ -496,7 +506,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState
*peer,
nc = qemu_new_net_client(&net_vhost_vdpa_info, peer, device,
name);
} else {
- nc = qemu_new_net_control_client(&net_vhost_vdpa_info, peer,
+ nc = qemu_new_net_control_client(&net_vhost_vdpa_cvq_info, peer,
device, name);
}
snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA);
--
2.31.1
- Re: [PATCH v5 04/10] vdpa: Get buffers from VhostVDPAState on vhost_vdpa_net_cvq_map_elem, (continued)
- [PATCH v5 05/10] vdpa: Extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail, Eugenio Pérez, 2022/08/02
- [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Pérez, 2022/08/02
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Jason Wang, 2022/08/04
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Perez Martin, 2022/08/04
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Jason Wang, 2022/08/04
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Perez Martin, 2022/08/04
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Jason Wang, 2022/08/04
- Re: [PATCH v5 06/10] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Perez Martin, 2022/08/04
[PATCH v5 07/10] vdpa: add NetClientState->load() callback, Eugenio Pérez, 2022/08/02
[PATCH v5 08/10] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo,
Eugenio Pérez <=
[PATCH v5 09/10] vdpa: Add virtio-net mac address via CVQ at start, Eugenio Pérez, 2022/08/02
[PATCH v5 10/10] vdpa: Delete CVQ migration blocker, Eugenio Pérez, 2022/08/02
Re: [PATCH v5 00/10] NIC vhost-vdpa state restore via Shadow CVQ, Jason Wang, 2022/08/04