From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 362B2A0A0C; Fri, 2 Jul 2021 09:40:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D58E40141; Fri, 2 Jul 2021 09:40:55 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 900034003E for ; Fri, 2 Jul 2021 09:40:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625211653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K7ybVZEuxKlRx9VJld2mWZHDB8uRxeaKKm46PLsEaTs=; b=C9Utrji1dv3wdCzca3H6FRk7dXVEzR4jMz3MG1kr0PhY787z9rGeczKan3J8pIlvD6M1LC 6YwYPXLlb8N162Pswfr7x3l2W4uiX+KR2C3K8KQVH/r09dp6wZpFe2d05GcZdYmcwU41BT JeT1vTs2+ABdTpGHDyID2OoPlvstdxA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-MuGdVhgvOmqEC0VUoy0TkQ-1; Fri, 02 Jul 2021 03:40:49 -0400 X-MC-Unique: MuGdVhgvOmqEC0VUoy0TkQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E10B91272; Fri, 2 Jul 2021 07:40:48 +0000 (UTC) Received: from [10.36.110.32] (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19377604CD; Fri, 2 Jul 2021 07:40:46 +0000 (UTC) To: Jiayu Hu , dev@dpdk.org Cc: chenbo.xia@intel.com, yinan.wang@intel.com References: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> <1622189463-392610-3-git-send-email-jiayu.hu@intel.com> From: Maxime Coquelin Message-ID: <1bea9752-44b3-ffc5-71af-eff4d13d7d61@redhat.com> Date: Fri, 2 Jul 2021 09:40:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1622189463-392610-3-git-send-email-jiayu.hu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] vhost: add thread unsafe async registration functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > --- > 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.