[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/21] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo
From: |
Jason Wang |
Subject: |
[PULL 14/21] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo |
Date: |
Fri, 2 Sep 2022 14:41:31 +0800 |
From: Eugenio Pérez <eperezma@redhat.com>
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>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
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 a49e7e6..1a597c2 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -334,6 +334,16 @@ static bool vhost_vdpa_net_cvq_map_elem(VhostVDPAState *s,
return true;
}
+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.
@@ -475,7 +485,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.7.4
- [PULL 06/21] vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd, (continued)
- [PULL 06/21] vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd, Jason Wang, 2022/09/02
- [PULL 07/21] vdpa: Use ring hwaddr at vhost_vdpa_svq_unmap_ring, Jason Wang, 2022/09/02
- [PULL 08/21] vhost: stop transfer elem ownership in vhost_handle_guest_kick, Jason Wang, 2022/09/02
- [PULL 10/21] vhost: Delete useless read memory barrier, Jason Wang, 2022/09/02
- [PULL 12/21] vhost_net: Add NetClientInfo start callback, Jason Wang, 2022/09/02
- [PULL 09/21] vhost: use SVQ element ndescs instead of opaque data for desc validation, Jason Wang, 2022/09/02
- [PULL 11/21] vhost: Do not depend on !NULL VirtQueueElement on vhost_svq_flush, Jason Wang, 2022/09/02
- [PULL 13/21] vhost_net: Add NetClientInfo stop callback, Jason Wang, 2022/09/02
- [PULL 16/21] vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail, Jason Wang, 2022/09/02
- [PULL 15/21] vdpa: Move command buffers map to start of net device, Jason Wang, 2022/09/02
- [PULL 14/21] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo,
Jason Wang <=
- [PULL 18/21] vdpa: Add virtio-net mac address via CVQ at start, Jason Wang, 2022/09/02
- [PULL 17/21] vhost_net: add NetClientState->load() callback, Jason Wang, 2022/09/02
- [PULL 04/21] vdpa: Remove SVQ vring from iova_tree at shutdown, Jason Wang, 2022/09/02
- [PULL 19/21] vdpa: Delete CVQ migration blocker, Jason Wang, 2022/09/02
- [PULL 20/21] net/colo.c: Fix the pointer issue reported by Coverity., Jason Wang, 2022/09/02
- [PULL 21/21] net: tulip: Restrict DMA engine to memories, Jason Wang, 2022/09/02
- Re: [PULL 00/21] Net patches, Stefan Hajnoczi, 2022/09/05