[v2,20/21] net/virtio-user: advertize control VQ support with vDPA

Message ID 20230207151747.245808-21-maxime.coquelin@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series Add control queue & MQ support to Virtio-user vDPA |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Maxime Coquelin Feb. 7, 2023, 3:17 p.m. UTC
  This patch advertizes control virtqueue support by the vDPA
backend if it supports VIRTIO_NET_F_CTRL_VQ.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_user/vhost_vdpa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Eugenio Perez Martin Feb. 7, 2023, 6:17 p.m. UTC | #1
On Tue, Feb 7, 2023 at 4:18 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> This patch advertizes control virtqueue support by the vDPA
> backend if it supports VIRTIO_NET_F_CTRL_VQ.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

Acked-by: Eugenio Pérez <eperezma@redhat.com>

> ---
>  drivers/net/virtio/virtio_user/vhost_vdpa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c
> index 3fd13d9fac..7bb4995893 100644
> --- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
> +++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
> @@ -135,8 +135,8 @@ vhost_vdpa_get_features(struct virtio_user_dev *dev, uint64_t *features)
>                 return -1;
>         }
>
> -       /* Multiqueue not supported for now */
> -       *features &= ~(1ULL << VIRTIO_NET_F_MQ);
> +       if (*features & 1ULL << VIRTIO_NET_F_CTRL_VQ)
> +               dev->hw_cvq = true;
>
>         /* Negotiated vDPA backend features */
>         ret = vhost_vdpa_get_protocol_features(dev, &data->protocol_features);
> --
> 2.39.1
>
  

Patch

diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c
index 3fd13d9fac..7bb4995893 100644
--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
@@ -135,8 +135,8 @@  vhost_vdpa_get_features(struct virtio_user_dev *dev, uint64_t *features)
 		return -1;
 	}
 
-	/* Multiqueue not supported for now */
-	*features &= ~(1ULL << VIRTIO_NET_F_MQ);
+	if (*features & 1ULL << VIRTIO_NET_F_CTRL_VQ)
+		dev->hw_cvq = true;
 
 	/* Negotiated vDPA backend features */
 	ret = vhost_vdpa_get_protocol_features(dev, &data->protocol_features);