From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FD9CC4707F for ; Fri, 28 May 2021 01:42:45 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id D7063613B4 for ; Fri, 28 May 2021 01:42:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7063613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2C9940150; Fri, 28 May 2021 03:42:43 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D77A240040 for ; Fri, 28 May 2021 03:42:42 +0200 (CEST) IronPort-SDR: PSzDxTGIpxKTvp6uoxIcuKCGkz6obFDJniOzXHbHaPAOtAfmuVITkwDvaX0h80GVFTPNt98yP9 YIffQsETgYeg== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="266759997" X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="266759997" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 18:42:40 -0700 IronPort-SDR: Rbfxz3OmGfTMYE9wi0aQXsBQFcgPr4FGjV221ZwtfgrJ/8jyImjETzvDbKSrZKK8FbG2ffy9qi /jCQVvEpy2FA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="477732975" Received: from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.118.193]) by orsmga001.jf.intel.com with ESMTP; 27 May 2021 18:42:38 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, yinan.wang@intel.com, Jiayu Hu Date: Fri, 28 May 2021 04:11:01 -0400 Message-Id: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH 0/2] provide 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" Lock protection is needed during the vhost notifies the application of device readiness, so the first patch is to add lock protection. After performing locking, existed async vhost registration functions will cause deadlock, as they acquire lock too. So the second patch is to provide unsafe registration functions to support calling within vhost callback functions. Jiayu Hu (2): vhost: fix lock on device readiness notification vhost: add thread unsafe async registration functions 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 +++++++++++++++++++++++++++--------- lib/vhost/vhost_user.c | 5 +- 5 files changed, 180 insertions(+), 44 deletions(-) -- 2.7.4