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 2F3D9A0A0F for ; Mon, 5 Jul 2021 08:40:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03D4C40141; Mon, 5 Jul 2021 08:40:54 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 65E5840141 for ; Mon, 5 Jul 2021 08:40:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="294572826" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="294572826" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 23:40:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="485378842" Received: from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.119.25]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jul 2021 23:40:50 -0700 From: Jiayu Hu To: stable@dpdk.org Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, Jiayu Hu Date: Mon, 5 Jul 2021 09:08:56 -0400 Message-Id: <1625490536-284749-1-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-stable] [PATCH] vhost: prevent async register X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Deadlock may occur if async register function is called inside vhost callback functions. This patch disables async datapath by preventing async vhost register. Signed-off-by: Jiayu Hu --- lib/librte_vhost/vhost.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index b97dcf6..cea7c36 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -1618,6 +1618,11 @@ int rte_vhost_async_channel_register(int vid, uint16_t queue_id, ops->transfer_data == NULL)) return -1; + VHOST_LOG_CONFIG(ERR, "async vhost is not supported by 20.11 LTS, " + "as deadlock may occur if this function is called " + "inside vhost callback functions."); + return -1; + rte_spinlock_lock(&vq->access_lock); if (unlikely(vq->async_registered)) { -- 2.7.4