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 32888A034F; Mon, 7 Jun 2021 15:20:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2FD94067E; Mon, 7 Jun 2021 15:20:17 +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 363BF40147 for ; Mon, 7 Jun 2021 15:20:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623072015; 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=a7c1/sBd7yBkBLMqwF/kpju9/lDw5Ml5+4fmhxei5g8=; b=DMEWPy3A6BPRmp6Rwbn9DL3TOct7KAg2Kee16rTr9dWaDrOWOKxaREKVDbjMeZpSParIdo WvqvcoILBMUB+g/kAlFVvB5rKsWIZG37XNR4Gn+W64VJaWA9f7ytjzhNBtn+6ATMfampIu 0PBrx87mUPlEepSHSK3+c/XAnYkHXPQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-cTBL9RvNMnS_G5pgLy_iRw-1; Mon, 07 Jun 2021 09:20:13 -0400 X-MC-Unique: cTBL9RvNMnS_G5pgLy_iRw-1 Received: by mail-wm1-f69.google.com with SMTP id g81-20020a1c9d540000b02901a3d4d3f7fcso3853005wme.2 for ; Mon, 07 Jun 2021 06:20:13 -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=a7c1/sBd7yBkBLMqwF/kpju9/lDw5Ml5+4fmhxei5g8=; b=FblWf5WeqWFecCtMP9Wix6vmlt2d0fZLe57NoL/NW1r0CdxcBPUecl+q/HTEUy6z5c 1YJOin+MFxAjAERShGlx0+hQEOtwAdioBhGXmD0aMXMeAfxl+CMc5JWqZzJgEWEX1M/I sg7YlA+xPa4ypG36jN2C9bT6GLduwf7wRowKJ9eR0aHiipmmh6kbIKMW2/M++YY1SCOY cQ4f8ZaW7uye8hW/wCN6lqC5VNJFRc0/ND8JJQ2Jj8GBagZwC/bc+jn2R2T8GKdRdXNU WY0cRChcJtqLoHGNIx1DHMXk9CdHB0GUlyzon+IbnxUWI1/RaHfXz7Qu7TXC2JTCsnAW YuaQ== X-Gm-Message-State: AOAM533hkSlZwZeR883V3Gy4p23mkJgBQeCSjhDXnxuRpoVv8Mr8bHHh NaMjzYSKYYgEvk363C8aGwvV0Jyw7hyify89+KUZA91ps3Hx0MbV5xbkV5ySQYvWH7PdZliP68W X2R0= X-Received: by 2002:a05:600c:4114:: with SMTP id j20mr17317780wmi.0.1623072012861; Mon, 07 Jun 2021 06:20:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWrjIGtA6tA1En/e7hi3+g750Zz5hLQbw0U3gAvb88A46tx2yJEtmcGiG5kA3tAKkkkOtZ5w== X-Received: by 2002:a05:600c:4114:: with SMTP id j20mr17317768wmi.0.1623072012719; Mon, 07 Jun 2021 06:20:12 -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 l3sm14492383wmh.2.2021.06.07.06.20.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jun 2021 06:20:11 -0700 (PDT) To: "Hu, Jiayu" , "dev@dpdk.org" Cc: "maxime.coquelin@redhat.com" , "Xia, Chenbo" , "Wang, Yinan" References: <1622189463-392610-1-git-send-email-jiayu.hu@intel.com> From: Maxime Coquelin Message-ID: <48481706-5745-40b6-0a1a-88911cb4ae0f@redhat.com> Date: Mon, 7 Jun 2021 15:20:11 +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: 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" Hi Jiayu, On 6/7/21 10:07 AM, Hu, Jiayu wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Friday, June 4, 2021 3:25 PM >> To: Hu, Jiayu ; dev@dpdk.org >> Cc: maxime.coquelin@redhat.com; Xia, Chenbo ; >> Wang, Yinan >> Subject: Re: [PATCH 0/2] provide thread unsafe async registration functions >> >> 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? > > Yes, if only backporting this fix patch to 20.11 LTS, it may break apps who call > async registration functions inside vhost callbacks. > > How about making this patch not a fix, but a new feature? Async will be still broken in v20.11 in this case. Maybe the better thing would be to remove async support in v20.11, as its support was quite limited in that release anyway. Does that make sense? Thanks, Maxime > Thanks, > Jiayu >> >> 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(-) >>> >