[v1,2/4] vhost: skip access lock when vDPA is configured
Checks
Commit Message
No need to take access lock in the vhost-user massage handler when
vDPA driver controls all the data-path of the vhost device.
It allows the vDPA set_vring_state operation callback to configure
guest notifications.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
lib/librte_vhost/vhost_user.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On 6/18/20 6:28 PM, Matan Azrad wrote:
> No need to take access lock in the vhost-user massage handler when
s/massage/message/
> vDPA driver controls all the data-path of the vhost device.
>
> It allows the vDPA set_vring_state operation callback to configure
> guest notifications.
>
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> ---
> lib/librte_vhost/vhost_user.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index cddfa4b..b0849b9 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -2699,8 +2699,10 @@ typedef int (*vhost_message_handler_t)(struct virtio_net **pdev,
> case VHOST_USER_SEND_RARP:
> case VHOST_USER_NET_SET_MTU:
> case VHOST_USER_SET_SLAVE_REQ_FD:
> - vhost_user_lock_all_queue_pairs(dev);
> - unlock_required = 1;
> + if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {
> + vhost_user_lock_all_queue_pairs(dev);
> + unlock_required = 1;
> + }
> break;
> default:
> break;
>
Makes sense:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
@@ -2699,8 +2699,10 @@ typedef int (*vhost_message_handler_t)(struct virtio_net **pdev,
case VHOST_USER_SEND_RARP:
case VHOST_USER_NET_SET_MTU:
case VHOST_USER_SET_SLAVE_REQ_FD:
- vhost_user_lock_all_queue_pairs(dev);
- unlock_required = 1;
+ if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {
+ vhost_user_lock_all_queue_pairs(dev);
+ unlock_required = 1;
+ }
break;
default:
break;