On Thu, Aug 29, 2019 at 09:59:54AM +0200, Maxime Coquelin wrote:
> This patch implements the vDPA .get_protocol_features()
> callback.
> 
> Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com>
> ---
>  drivers/net/virtio/virtio_vdpa.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_vdpa.c 
> b/drivers/net/virtio/virtio_vdpa.c
> index 9e2af8313..fc52a8e92 100644
> --- a/drivers/net/virtio/virtio_vdpa.c
> +++ b/drivers/net/virtio/virtio_vdpa.c
> @@ -204,9 +204,22 @@ virtio_vdpa_get_features(int did, uint64_t *features)
>       return 0;
>  }
>  
> +#define VDPA_SUPPORTED_PROTOCOL_FEATURES \
> +             (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK | \
> +              1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ | \
> +              1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \
> +              1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER)

Looks better to add an empty line here.

> +static int
> +virtio_vdpa_get_protocol_features(int did __rte_unused, uint64_t *features)
> +{
> +     *features = VDPA_SUPPORTED_PROTOCOL_FEATURES;
> +     return 0;
> +}
> +
>  static struct rte_vdpa_dev_ops virtio_vdpa_ops = {
>       .get_queue_num = virtio_vdpa_get_queue_num,
>       .get_features = virtio_vdpa_get_features,
> +     .get_protocol_features = virtio_vdpa_get_protocol_features,
>  };
>  
>  static inline int
> -- 
> 2.21.0
> 

Reviewed-by: Tiwei Bie <tiwei....@intel.com>

Reply via email to