Thread (49 messages) 49 messages, 4 authors, 2021-07-21

Re: [dpdk-dev] [PATCH 2/2] vhost: add thread unsafe async registration functions

From: Hu, Jiayu <hidden>
Date: 2021-07-05 01:36:06

-----Original Message-----
From: Maxime Coquelin <redacted>
Sent: Friday, July 2, 2021 3:41 PM
To: Hu, Jiayu <redacted>; dev@dpdk.org
Cc: Xia, Chenbo <redacted>; Wang, Yinan
[off-list ref]
Subject: Re: [PATCH 2/2] vhost: add thread unsafe async registration
functions



On 5/28/21 10:11 AM, Jiayu Hu wrote:
quoted
This patch is to add thread unsafe version for async register and
s/is to add/adds/
quoted
unregister functions.

Signed-off-by: Jiayu Hu <redacted>
---
 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:
quoted
     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.
I think so. Although new_device() is called without lock, no data plane threads
can operate vrings if device is not created.

Thanks,
Jiayu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help