[PATCH v4] vhost: enhance virtqueue access lock asserts

Maxime Coquelin maxime.coquelin at redhat.com
Fri Mar 1 16:22:17 CET 2024



On 2/27/24 11:39, David Marchand wrote:
> A simple comment in vhost_user_msg_handler() is not that robust.
> 
> Add a lock_all_qps property to message handlers so that their
> implementation can add a build check and assert a vq is locked.
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
> Changes since v3:
> - directly called static_assert() with improved message,
> 
> Changes since v2:
> - dropped review tags,
> - following use of static_assert() in RTE_BUILD_BUG_ON, reworked build
>    check by using enums (one enum is now defined per message type),
> - as the added enums must be defined early, moved the definitions of
>    handlers at the top of the file,
> 
> Changes since v1:
> - moved this patch as the last of the series,
> 
> ---
>   lib/vhost/vhost_user.c | 130 +++++++++++++++++++++--------------------
>   1 file changed, 68 insertions(+), 62 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list