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 6D5AFA0540; Fri, 8 Jul 2022 10:13:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C0B240A7B; Fri, 8 Jul 2022 10:13:33 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 80235406B4 for ; Fri, 8 Jul 2022 10:13:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657268011; 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: in-reply-to:in-reply-to:references:references; bh=NgnJ36/u/wuzT1dg/al2V1JADO/kaZ5aVI8CxzZKtnI=; b=fjDTh4IU+ufcCsfippYofW/yMNxLu4hzCY8bINWNbSvDFX+9u42P93b/lVP3oeiWQFKNI3 ob7Ha6inZT5wMa94DXhp/ZYeg10nwyoDH9aWwLwm/0lAo4vgxWpU8j3bNyQVRTmtJv/b3o ase+hJykgWNoWxHifrVRqrFUpxtv+rY= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-368-Xe3LqAIXOLekm2uuoGFbxQ-1; Fri, 08 Jul 2022 04:13:24 -0400 X-MC-Unique: Xe3LqAIXOLekm2uuoGFbxQ-1 Received: by mail-lf1-f72.google.com with SMTP id bp15-20020a056512158f00b0047f603e5f92so7526709lfb.20 for ; Fri, 08 Jul 2022 01:13:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NgnJ36/u/wuzT1dg/al2V1JADO/kaZ5aVI8CxzZKtnI=; b=TVZg94U5/4d9CNIeNKI+S3/IEm3kvIS3SEwm6az8LIeousIPBNQXsGpHGJENia3veD ynOXCwt58MLLO9PNkM/kIULQsD/KOXTPH7MkTlYeVSR+JVyH/sD+lLSp711zYi2P//Ui rcA7J4zpydsGTICrw2GvOXuw0j12/NddC9UuVVckO7ZwBAHflgBtsvXRatqWM9MHrB4C JkmkwrCuKosH8sNpkshNpOoGcD+JfzPU/KNEQxKIc0EyEc/TQddCIHDE0z5QPKy8/VNr RjaWtY1Wpw7fGuEXClRQG0KDQ+JU0UJRNmedePgo7g4m2z1moIENY0ewgGYUIgkoz7qW cGgg== X-Gm-Message-State: AJIora+JHuKLdnJcjQUymmIRyILLj0+KDn6BgUwa0DgY+YC4Lo8jygol yQqNTesa5h96O1A91vjLu2WRAdnq9TRL+RDRSla8OEkRiyWnmsziDTHuWGXfsns5MMtQ9cq59zQ g/GeTgA4PdJwbegJdwYk= X-Received: by 2002:a2e:6e0c:0:b0:255:98fb:cb45 with SMTP id j12-20020a2e6e0c000000b0025598fbcb45mr1223601ljc.55.1657268002682; Fri, 08 Jul 2022 01:13:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDeyuHljIw/VSFFL0mZOgo0xiRIMnNyNGkBrC0zt1I/zleJS6i6yvxFKJ3nFRwu5X6Zsp+xTn4dtzhusB8yVQ= X-Received: by 2002:a2e:6e0c:0:b0:255:98fb:cb45 with SMTP id j12-20020a2e6e0c000000b0025598fbcb45mr1223560ljc.55.1657268001348; Fri, 08 Jul 2022 01:13:21 -0700 (PDT) MIME-Version: 1.0 References: <20220706092401.36815-1-asaini@xilinx.com> <04f993c8-24dc-aa76-9f02-faa4e6a25855@redhat.com> In-Reply-To: <04f993c8-24dc-aa76-9f02-faa4e6a25855@redhat.com> From: David Marchand Date: Fri, 8 Jul 2022 10:13:10 +0200 Message-ID: Subject: Re: [PATCH] vdpa/sfc: resolve race between libvhost and dev_conf To: abhimanyu.saini@xilinx.com, vsrivast@xilinx.com Cc: Maxime Coquelin , dev , "Xia, Chenbo" , Andrew Rybchenko , Abhimanyu Saini Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Hello Abhimanyu, Vijay, On Thu, Jul 7, 2022 at 2:38 PM Maxime Coquelin wrote: > On 7/6/22 11:24, abhimanyu.saini@xilinx.com wrote: > > From: Abhimanyu Saini > > > > libvhost calls dev_conf() before prosessing the > > VHOST_USER_SET_VRING_CALL message for the last VQ. So > > this message is processed after dev_conf() returns. > > > > However, the dev_conf() function spawns a thread to set > > rte_vhost_host_notifier_ctrl() before returning control to > > libvhost. This parallel thread in turn invokes get_notify_area(). > > To get the notify_area, the vdpa driver needs to query the HW and > > for this query it needs an enabled VQ. > > > > But at the same time libvhost is processing the last > > VHOST_USER_SET_VRING_CALL, and to do that it disables the last VQ. > > > > Hence there is a race b/w the libvhost and the vdpa driver. > > > > To resolve this race condition, query the HW and cache notify_area > > inside dev_conf() instead of doing it the parallel thread. > > > > Signed-off-by: Abhimanyu Saini > > --- > > drivers/vdpa/sfc/sfc_vdpa_ops.c | 36 ++++++++++++++++++------------------ > > drivers/vdpa/sfc/sfc_vdpa_ops.h | 1 + > > 2 files changed, 19 insertions(+), 18 deletions(-) > > > > During today's Release status meeting, Andrew mentioned that this patch > has been for a log time already in your internal tree. > > So it gives a bit of confidence in taking it in -rc4. - But it is neither reviewed, nor acked by the driver maintainer. Vijay, as this driver maintainer, your opinion matters. We are in rc4 stage and we merge only critical fixes now. There won't be much time to test this fix once merged (and I am not talking about fixing a regression). Are you confident with this fix? is it required for the 22.07 release? If we don't get an answer, the safer is to let those fixes slip to a next release. - Besides, I see there is a new fix for some sfc driver. https://patches.dpdk.org/project/dpdk/patch/20220708073702.29391-1-asaini@xilinx.com/ The same questions will be asked. -- David Marchand