From 9f2016b2cee95fecb5356dc15711de8532b63b54 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 29 Jun 2020 14:08:17 +0000 Subject: [PATCH] vhost: skip access lock when vDPA is configured No need to take access lock in the vhost-user message 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 Reviewed-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- 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 c08f506c1f..4349506719 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2683,8 +2683,10 @@ vhost_user_msg_handler(int vid, int fd) 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; -- 2.20.1