On 5/28/21 10:11 AM, Jiayu Hu wrote:
> This patch is to add thread unsafe version for async register and
s/is to add/adds/
> unregister functions.
>
> Signed-off-by: Jiayu Hu <jiayu...@intel.com>
> ---
> doc/guides/prog_guide/vhost_lib.rst | 12 +++
> lib/vhost/rte_vhost_async.h | 42 ++++++++++
> lib/vhost/version.map | 4 +
> lib/vhost/vhost.c | 161
> +++++++++++++++++++++++++++---------
> 4 files changed, 178 insertions(+), 41 deletions(-)
>
> diff --git a/doc/guides/prog_guide/vhost_lib.rst
> b/doc/guides/prog_guide/vhost_lib.rst
> index d18fb98..6b2745f 100644
> --- a/doc/guides/prog_guide/vhost_lib.rst
> +++ b/doc/guides/prog_guide/vhost_lib.rst
> @@ -253,6 +253,12 @@ The following is an overview of some key Vhost API
> functions:
> vhost invokes this function to get the copy data completed by async
> devices.
>
> +* ``rte_vhost_async_channel_register_thread_unsafe(vid, queue_id, features,
> ops)``
> + Register a vhost queue with async copy device channel without
> + performing any locking.
> +
> + This function is only safe to call from within vhost callback functions.
I'm not sure with this, AFAICS .new_device() is called without the lock
held, so is that safe? Since .new_device() is the first time the app
gets required device info to use the Vhost API, that might not be an
issue, though.