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 2D9EFA0A02; Fri, 4 Jun 2021 09:24:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8B1F40147; Fri, 4 Jun 2021 09:24:41 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 428F84003C for ; Fri, 4 Jun 2021 09:24:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622791479; 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=uYehfPlEBRJ4kPUpD8Z20y6H1dGVcdTyvCfddANo4i4=; b=XbPssx+qyY/JGkp6IAF9+n0Wb3HI0/85jGqmK6uyqs3Zdd6yCGyFRJt8jsrHJ1psGqGS2r nr/j1U0+I14gYbV9GzU5U2RfH7nB6HfuxKYgAV3gjqYDeLhDwdihBqotYU5yB+1VbZ/toP dWKd/ZZWa71oj585yfxJlYFcUE337H0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-9-MtF1y0NUOJrPHllg-cMw-1; Fri, 04 Jun 2021 03:24:37 -0400 X-MC-Unique: 9-MtF1y0NUOJrPHllg-cMw-1 Received: by mail-wr1-f72.google.com with SMTP id l13-20020adfe9cd0000b0290119a0645c8fso590968wrn.8 for ; Fri, 04 Jun 2021 00:24:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uYehfPlEBRJ4kPUpD8Z20y6H1dGVcdTyvCfddANo4i4=; b=Tw0Os82Lw7kYRnyL8X8qqXh84AGaQCTGDbcKjPb+EFSuBhBqfXQuVjBVXo48oCkaQ4 oebTHp/SCsmtXG9FbzAK1pmqscSsbx1yXY0dKrYeKSori6jw3L5WW9TRTtrLqnRQ74uc h9YQCo687+9E2XOF+jANvhJwwaW2b7WFq1EES39PuNE38c7b3rLoFWp1/yQhIB0Ha6f5 6LzxVh2W5pRf9M/UxOQJib+k8WiuB3UvB6WNgOJ6yDt4jh62znPudYLbS1kpufYqqmBH jSUXxeTMOUrBC5ijFbAf9vGDBG6qfpv1irOQH6LxRkESx22YdR1aPWwiCrauijzeXHgN 84hw== X-Gm-Message-State: AOAM530LH4l0Q1QsiBQUROHlCLLJy12ofQ/SPYw31MLXSyDMbIJYwlZA QQyKfQzuf6NFqac8+n85QgE9NR7Fu7kVnb+Kds1YwpZiD/75x5KEdebQURWlBoP5FQg9RWeliBd yyEE= X-Received: by 2002:a5d:474f:: with SMTP id o15mr2338448wrs.298.1622791476656; Fri, 04 Jun 2021 00:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgsTAsULuM3NAvx6IZZwYpQUVNc6Z4pmEmW/CF9udQatM0JGTc4vlFiohV8iHCyVVsWjhlNQ== X-Received: by 2002:a5d:474f:: with SMTP id o15mr2338430wrs.298.1622791476473; Fri, 04 Jun 2021 00:24:36 -0700 (PDT) Received: from [192.168.1.205] (219-230-83-45.ftth.cust.kwaoo.net. [45.83.230.219]) by smtp.gmail.com with ESMTPSA id u8sm7536128wmq.29.2021.06.04.00.24.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 00:24:35 -0700 (PDT) To: Jiayu Hu , dev@dpdk.org Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, yinan.wang@intel.com References: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 4 Jun 2021 09:24:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mcoqueli@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 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" Sorry, for previous blank reply. On 5/28/21 10:11 AM, Jiayu Hu wrote: > 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. I agree the callback should be always protected, and in that case having a new thread-unsafe API makes sense for async registration. Regarding backport, I'm not sure what we should do. Backporting new API is a no-go, but with only backporting patch 1 async feature will be always broken on 20.11 LTS, right? What do you think? Thanks, Maxime > 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(-) >