From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id C86321B2F4 for ; Sat, 28 Oct 2017 12:54:27 +0200 (CEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9SAre7H053517 for ; Sat, 28 Oct 2017 06:54:26 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.91]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dvpefbtbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 28 Oct 2017 06:54:26 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Sat, 28 Oct 2017 10:54:25 -0000 Received: from us1a3-smtp02.a3.dal06.isc4sb.com (10.106.154.159) by smtp.notes.na.collabserv.com (10.106.227.143) with smtp.notes.na.collabserv.com ESMTP; Sat, 28 Oct 2017 10:54:21 -0000 Received: from us1a3-mail173.a3.dal06.isc4sb.com ([10.146.71.126]) by us1a3-smtp02.a3.dal06.isc4sb.com with ESMTP id 2017102810542120-235334 ; Sat, 28 Oct 2017 10:54:21 +0000 In-Reply-To: <20171028062255.11910-1-jerin.jacob@caviumnetworks.com> To: Jerin Jacob Cc: Anatoly Burakov , dev@dpdk.org, thomas@monjalon.net From: "Jonas Pfefferle1" Date: Sat, 28 Oct 2017 12:54:20 +0200 References: <20171028062255.11910-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 X-KeepSent: 54C5FC0A:14218344-002581C7:003AD241; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1 October 14, 2013 X-LLNOutbound: False X-Disclaimed: 8695 X-TNEFEvaluated: 1 x-cbid: 17102810-9951-0000-0000-000004CE5F34 X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.4332; ST=0; TS=0; UL=0; ISC=; MB=0.000003 X-IBM-SpamModules-Versions: BY=3.00007967; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00937647; UDB=6.00472582; IPR=6.00717910; BA=6.00005662; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017761; XFM=3.00000015; UTC=2017-10-28 10:54:24 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2017-10-28 06:15:14 - 6.00007525 x-cbparentid: 17102810-9952-0000-0000-00002F64D2D5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-28_03:, , signatures=0 X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix vfio device reset 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: , X-List-Received-Date: Sat, 28 Oct 2017 10:54:28 -0000 Jerin Jacob wrote on 28/10/2017 08:22:55: > From: Jerin Jacob > To: dev@dpdk.org > Cc: thomas@monjalon.net, Jerin Jacob=20 > , Jonas Pfefferle=20 > , Anatoly Burakov > Date: 28/10/2017 08:23 > Subject: [dpdk-dev] [PATCH] bus/pci: fix vfio device reset >=20 > If the device is not capable of resetting, then Linux kernel updates > the errno as EINVAL. > https://urldefense.proofpoint.com/v2/url? > u=3Dhttp-3A=5F=5Felixir.free-2Delectrons.com=5Flinux=5Fv4. > 9=5Fsource=5Fdrivers=5Fvfio=5Fpci=5Fvfio-5Fpci.c-23L887&d=3DDwIBAg&c=3Djf= =5FiaSHvJObTbx- > siA1ZOg&r=3DrOdXhRsgn8Iur7bDE0vgwvo6TC8OpoDN-pXjigIjRW0&m=3DV- > sbOkvx7qxOMbwyk3n1Fb=5F1NCjAhl0io- > hqldJ0r6M&s=3DOXV7lrxTpahVIsA3J3nCNUlLqW21nlMiQiYveAzyQhc&e=3D >=20 > Honor the EINVAL errno value to avoid pci vfio setup failure. >=20 > Fixes: f25f8f367644 ("bus/pci: check VFIO reset ioctl error") >=20 > Cc: Jonas Pfefferle > Cc: Anatoly Burakov >=20 > Signed-off-by: Jerin Jacob > --- > drivers/bus/pci/linux/pci=5Fvfio.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/bus/pci/linux/pci=5Fvfio.c b/drivers/bus/pci/ > linux/pci=5Fvfio.c > index 360eed380..11df64846 100644 > --- a/drivers/bus/pci/linux/pci=5Fvfio.c > +++ b/drivers/bus/pci/linux/pci=5Fvfio.c > @@ -338,8 +338,11 @@ pci=5Fvfio=5Fsetup=5Fdevice(struct rte=5Fpci=5Fdevic= e=20 > *dev, int vfio=5Fdev=5Ffd) > return -1; > } >=20 > - /* Reset the device */ > - if (ioctl(vfio=5Fdev=5Ffd, VFIO=5FDEVICE=5FRESET)) { > + /* > + * Reset the device. If the device is not capable of resetting, > + * then it updates errno as EINVAL. > + */ > + if (ioctl(vfio=5Fdev=5Ffd, VFIO=5FDEVICE=5FRESET) && errno !=3D EINVA= L) { > RTE=5FLOG(ERR, EAL, "Unable to reset device! Error: %d (%s)\n", > errno, strerror(errno)); > return -1; > --=20 > 2.14.3 >=20 Looks good to me. Reviewed-by: Jonas Pfefferle Thanks, Jonas