[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo
From: |
Jason Wang |
Subject: |
Re: [PATCH v8 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo |
Date: |
Wed, 10 Aug 2022 13:07:05 +0800 |
On Wed, Aug 10, 2022 at 1:39 AM Eugenio Pérez <eperezma@redhat.com> wrote:
>
> 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>
> ---
> 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 ac1810723c..55e8a39a56 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.31.1
>
- [PATCH v8 02/12] vhost: use SVQ element ndescs instead of opaque data for desc validation, (continued)
- [PATCH v8 02/12] vhost: use SVQ element ndescs instead of opaque data for desc validation, Eugenio Pérez, 2022/08/09
- [PATCH v8 05/12] vhost_net: Add NetClientInfo prepare callback, Eugenio Pérez, 2022/08/09
- [PATCH v8 04/12] vhost: Do not depend on !NULL VirtQueueElement on vhost_svq_flush, Eugenio Pérez, 2022/08/09
- [PATCH v8 06/12] vhost_net: Add NetClientInfo stop callback, Eugenio Pérez, 2022/08/09
- [PATCH v8 09/12] vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail, Eugenio Pérez, 2022/08/09
- [PATCH v8 08/12] vdpa: Move command buffers map to start of net device, Eugenio Pérez, 2022/08/09
- [PATCH v8 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo, Eugenio Pérez, 2022/08/09
- Re: [PATCH v8 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo,
Jason Wang <=
- [PATCH v8 10/12] vhost_net: add NetClientState->load() callback, Eugenio Pérez, 2022/08/09
- [PATCH v8 11/12] vdpa: Add virtio-net mac address via CVQ at start, Eugenio Pérez, 2022/08/09
- [PATCH v8 12/12] vdpa: Delete CVQ migration blocker, Eugenio Pérez, 2022/08/09
- Re: [PATCH v8 00/12] NIC vhost-vdpa state restore via Shadow CVQ, Eugenio Perez Martin, 2022/08/11