[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa device
From: |
Eugenio Perez Martin |
Subject: |
Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices |
Date: |
Tue, 15 Feb 2022 16:22:04 +0100 |
On Tue, Feb 15, 2022 at 8:23 AM Gautam Dawar <gautam.dawar@xilinx.com> wrote:
>
> This patch adds the ability to negotiate VIRTIO_F_IN_ORDER bit
> for vhost-vdpa backend when the underlying device supports this
> feature.
> This would aid in reaping performance benefits with HW devices
> that implement this feature. At the same time, it shouldn't have
> any negative impact as vhost-vdpa backend doesn't involve any
> userspace virtqueue operations.
>
> Signed-off-by: Gautam Dawar <gdawar@xilinx.com>
> ---
> hw/net/virtio-net.c | 10 ++++++++++
> net/vhost-vdpa.c | 1 +
> 2 files changed, 11 insertions(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index cf8ab0f8af..a1089d06f6 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3507,11 +3507,21 @@ static void virtio_net_device_realize(DeviceState
> *dev, Error **errp)
> nc->rxfilter_notify_enabled = 1;
>
> if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
> + uint64_t features = BIT_ULL(VIRTIO_F_IN_ORDER);
If more users arise, we could declare a set of features that can be
bypassed as long as the backend doesn't use userspace networking in
virtio.h/.c. Out_of_qemu_tree_valid_features?
But I think it is better to restrict the changes here at the moment.
> struct virtio_net_config netcfg = {};
> +
> memcpy(&netcfg.mac, &n->nic_conf.macaddr, ETH_ALEN);
> vhost_net_set_config(get_vhost_net(nc->peer),
> (uint8_t *)&netcfg, 0, ETH_ALEN, VHOST_SET_CONFIG_TYPE_MASTER);
> +
> + /*
> + * For vhost-vdpa, if underlying device supports IN_ORDER feature,
> + * make it available for negotiation.
> + */
> + features = vhost_net_get_features(get_vhost_net(nc->peer), features);
> + n->host_features |= features;
> }
> +
> QTAILQ_INIT(&n->rsc_chains);
> n->qdev = dev;
>
> diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
> index 25dd6dd975..2886cba5ec 100644
> --- a/net/vhost-vdpa.c
> +++ b/net/vhost-vdpa.c
> @@ -62,6 +62,7 @@ const int vdpa_feature_bits[] = {
> VIRTIO_NET_F_CTRL_VQ,
> VIRTIO_F_IOMMU_PLATFORM,
> VIRTIO_F_RING_PACKED,
> + VIRTIO_F_IN_ORDER,
> VIRTIO_NET_F_RSS,
> VIRTIO_NET_F_HASH_REPORT,
> VIRTIO_NET_F_GUEST_ANNOUNCE,
> --
> 2.30.1
>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
- [PATCH 0/2] Allow VIRTIO_F_IN_ORDER negotiation with vhost-vdpa, Gautam Dawar, 2022/02/15
- [PATCH 1/2] linux headers: update against Linux 5.17-rc4, Gautam Dawar, 2022/02/15
- [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Gautam Dawar, 2022/02/15
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices,
Eugenio Perez Martin <=
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Jason Wang, 2022/02/17
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Michael S. Tsirkin, 2022/02/17
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Stefano Garzarella, 2022/02/17
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Eugenio Perez Martin, 2022/02/18
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Stefano Garzarella, 2022/02/18
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Eugenio Perez Martin, 2022/02/18
- Re: [PATCH 2/2] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices, Jason Wang, 2022/02/20