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 94063A034F; Mon, 19 Jul 2021 10:33:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66A0D410FC; Mon, 19 Jul 2021 10:33:35 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 0ABB54068B for ; Mon, 19 Jul 2021 10:33:33 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10049"; a="296577197" X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="296577197" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2021 01:33:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="468347509" Received: from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.119.25]) by fmsmga008.fm.intel.com with ESMTP; 19 Jul 2021 01:33:31 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, Jiayu Hu Date: Mon, 19 Jul 2021 11:00:44 -0400 Message-Id: <1626706847-276163-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626465089-17052-2-git-send-email-jiayu.hu@intel.com> References: <1626465089-17052-2-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH v6 0/3] 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 adds lock protection. In addition, the second patch reworks async feature structure to improve readability. After performing locking, existed async vhost registration functions will cause deadlock, as they acquire lock too. The last patch provides thread unsafe registration functions to support calling within vhost callback functions. v6: * remove RTE_VHOST_ASYNC_FEATURE_UNKNOWN * add blank lines in doc v5: * improve coding style * update commit log, doc and comments * remove useless field async_inorder * change async_threshold from uint16_t to uint32_t v4: * remove brace {} in single statement block v3: * rename and use enum to define async device features * change padding fields to 8 bytes v2: * rework async feature structure * fix typo in commit log Jiayu Hu (3): vhost: fix lock on device readiness notification vhost: rework async configuration structure vhost: add thread unsafe async registeration functions doc/guides/prog_guide/vhost_lib.rst | 37 ++++++-- examples/vhost/main.c | 8 +- lib/vhost/rte_vhost_async.h | 85 ++++++++++++++----- lib/vhost/version.map | 4 + lib/vhost/vhost.c | 162 ++++++++++++++++++++++++++---------- lib/vhost/vhost.h | 3 +- lib/vhost/vhost_user.c | 5 +- 7 files changed, 220 insertions(+), 84 deletions(-) -- 2.7.4