patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jiayu Hu <jiayu.hu@intel.com>
To: stable@dpdk.org
Cc: weix.ling@intel.com, xingguang.he@intel.com,
	Jiayu Hu <jiayu.hu@intel.com>
Subject: [PATCH 20.11] vhost: prevent async register
Date: Wed, 17 Aug 2022 20:57:32 -0400	[thread overview]
Message-ID: <1660784252-230296-1-git-send-email-jiayu.hu@intel.com> (raw)

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 <jiayu.hu@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 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 b83cf63..530a960 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1608,6 +1608,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


                 reply	other threads:[~2022-08-18  0:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1660784252-230296-1-git-send-email-jiayu.hu@intel.com \
    --to=jiayu.hu@intel.com \
    --cc=stable@dpdk.org \
    --cc=weix.ling@intel.com \
    --cc=xingguang.he@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).