From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 817EAA0577; Mon, 6 Apr 2020 15:25:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C57A2BE2; Mon, 6 Apr 2020 15:25:23 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id B767A2B96 for ; Mon, 6 Apr 2020 15:25:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586179521; 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=2U3Efc3R29q+E6r7YOtfqOxQzvCXRYGHblPGwXcjFtw=; b=P9R1WzTlufFNWiJ68bdxjEuXfI3kvPAISS6yvsqJwluykxCRG4VGtBk9l/2M8cVgJwwTM2 Hx5MMiejcMrRjrZXPS38X+qF2JcMGm0MLcX/jRpb0iF1w4x2pZso0mdcyF5jb26kCzhxDv /+DoSvhFpfjZ9uOHu24KJb9Lxu+SvaU= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-JQZS13haP2u-AovKjwNKmQ-1; Mon, 06 Apr 2020 09:25:19 -0400 X-MC-Unique: JQZS13haP2u-AovKjwNKmQ-1 Received: by mail-vk1-f198.google.com with SMTP id 193so5682826vkx.0 for ; Mon, 06 Apr 2020 06:25:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ih7vPgLNHP/J+JUdIF3Dn2ho+PsKo2LRtlGTtOcY1zU=; b=NyzhIjXlx7yxGht5ELO1GxpGT9+tH2Mn8Z0Xpo5DRKWt2TMI/UC9rpzED/JO0YiRvq 1CFQXWe0SKPntdUzidTtRN/Y9JMa0td2CU+YyHXdQGCAY+QjihUTGB4LEDMaOSA8SN8k 1UIdn3KpEo6DnwqdWOeqdkGRD40BzPmP6gcHcfINWf0QRlEXSNzGlvOC+dxIJYIRu0OP RtAVeuYIHbLA/XtzhlyN5xJgSe6G0EhxAxn7OVjbBcIjBSnxVAk011fXXE7bjLHLqr6D ts+swIXdv1La76rnlmDtfuWAjj7N2wSAyfbAUYYCE2x8Fie26p4n+uRlbjuUNyN3BXDe /o7Q== X-Gm-Message-State: AGi0Pub1lBGQ8Q9RWVS0YZ1S7P5JxwzauWjNwlTeJJQY2wND9MEf1J+v lNN3UZXoMvhWYfJOIBOewIr+GlMtZ/nkCOcoFHKOhA5fUfu1HCWklpTwf9yanHtaW7VRiFtEFsJ g4tSfyn6mpTUMrQNK/Ws= X-Received: by 2002:a1f:5f53:: with SMTP id t80mr14787013vkb.39.1586179519057; Mon, 06 Apr 2020 06:25:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKmtlpCB3wqojWGQv7QLExhqmMiXmgIJIfQDEHHBAx4ctuNbyZtyrRFN7PxxRJQ7ahUpZJ5IS5QprfHVCHuf74= X-Received: by 2002:a1f:5f53:: with SMTP id t80mr14786995vkb.39.1586179518784; Mon, 06 Apr 2020 06:25:18 -0700 (PDT) MIME-Version: 1.0 References: <20200331165657.29368-1-michael.haeuptle@hpe.com> In-Reply-To: From: David Marchand Date: Mon, 6 Apr 2020 15:25:05 +0200 Message-ID: To: "Burakov, Anatoly" , Michael Haeuptle Cc: dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] eal: Fixes VFIO/sysfs race condition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Thu, Apr 2, 2020 at 12:11 PM Burakov, Anatoly wrote: > > On 31-Mar-20 5:56 PM, Michael Haeuptle wrote: > > This fix treats a 0 return value from vfio_open_group_fd > > in vfio_get_group_fd as the intended error condition instead > > of putting an incorrect 0 file descriptor in the vfio_group table. > > > > Sometimes, the creation of device files in sysfs is not > > instantaneously causing vfio_open_groupfd to return 0. > > This has been observed when hot removing/adding multiple > > NVMe devices (>=3D4). > > > > Signed-off-by: Michael Haeuptle > > --- > > lib/librte_eal/linux/eal_vfio.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal= _vfio.c > > index 4502aefed..1979f6fdd 100644 > > --- a/lib/librte_eal/linux/eal_vfio.c > > +++ b/lib/librte_eal/linux/eal_vfio.c > > @@ -379,7 +379,7 @@ vfio_get_group_fd(struct vfio_config *vfio_cfg, > > } > > > > vfio_group_fd =3D vfio_open_group_fd(iommu_group_num); > > - if (vfio_group_fd < 0) { > > + if (vfio_group_fd <=3D 0) { > > RTE_LOG(ERR, EAL, "Failed to open group %d\n", iommu_grou= p_num); > > return -1; > > } > > > > If it's returning an invalid value, is that a kernel bug? > > I mean, looks fine to me, so > > Acked-by: Anatoly Burakov We are missing a fixes line. Does this deserve a backport? --=20 David Marchand