From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id B84E5DD2 for ; Thu, 28 Sep 2017 04:01:50 +0200 (CEST) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8S1wYkS036017 for ; Wed, 27 Sep 2017 22:01:50 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d8jfb7kpk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Sep 2017 22:01:49 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Sep 2017 12:01:46 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 28 Sep 2017 12:01:45 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8S21jT943647070 for ; Thu, 28 Sep 2017 12:01:45 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v8S21juC006943 for ; Thu, 28 Sep 2017 12:01:45 +1000 Received: from ADMINIB2M8Q79C (adminib-2m8q79c.crl.ibm.com [9.186.50.233]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v8S21ixb006884; Thu, 28 Sep 2017 12:01:44 +1000 From: "Chao Zhu" To: "'Lukasz Majczak'" , References: <20170921155953.9984-1-lma@semihalf.com> <20170925073441.23494-1-lma@semihalf.com> In-Reply-To: <20170925073441.23494-1-lma@semihalf.com> Date: Thu, 28 Sep 2017 10:01:43 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQFlSqn/I8NY2dqc1B/3Zu5skw95AAJ+3RdDo5FvLqA= Content-Language: zh-cn X-TM-AS-MML: disable x-cbid: 17092802-0016-0000-0000-00000265DC94 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092802-0017-0000-0000-000006EB6CCC Message-Id: <000b01d337fd$bc6d4e50$3547eaf0$@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-28_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709280028 Subject: Re: [dpdk-dev] [PATCH v3] librte_eal: fix wrong assert for arm and ppc 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: Thu, 28 Sep 2017 02:01:51 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lukasz Majczak > Sent: 2017=C4=EA9=D4=C225=C8=D5 15:35 > To: dev@dpdk.org > Cc: Lukasz Majczak > Subject: [dpdk-dev] [PATCH v3] librte_eal: fix wrong assert for arm = and ppc >=20 > The assertion of return value from the open() function is done against = 0, while it > is a correct value - open() returns -1 in case of an error. > It causes problems while trying to run as a daemon, in which case, = this call to > open() will return 0 as a valid descriptor. >=20 > Fixes: b94e5c9406b5 ("eal/arm: add CPU flags for ARMv7") > Fixes: 97523f822ba9 ("eal/arm: add CPU flags for ARMv8") > Fixes: 9ae155385686 ("eal/ppc: cpu flag checks for IBM Power") >=20 > Signed-off-by: Lukasz Majczak > --- > lib/librte_eal/common/arch/arm/rte_cpuflags.c | 2 +- > lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c > b/lib/librte_eal/common/arch/arm/rte_cpuflags.c > index 5636e9c1d..88f1cbe37 100644 > --- a/lib/librte_eal/common/arch/arm/rte_cpuflags.c > +++ b/lib/librte_eal/common/arch/arm/rte_cpuflags.c > @@ -137,7 +137,7 @@ rte_cpu_get_features(hwcap_registers_t out) > _Elfx_auxv_t auxv; >=20 > auxv_fd =3D open("/proc/self/auxv", O_RDONLY); > - assert(auxv_fd); > + assert(auxv_fd !=3D -1); > while (read(auxv_fd, &auxv, sizeof(auxv)) =3D=3D sizeof(auxv)) { > if (auxv.a_type =3D=3D AT_HWCAP) { > out[REG_HWCAP] =3D auxv.a_un.a_val; > diff --git a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c > b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c > index fcf96e045..970a61c5e 100644 > --- a/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c > +++ b/lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c > @@ -108,7 +108,7 @@ rte_cpu_get_features(hwcap_registers_t out) > Elf64_auxv_t auxv; >=20 > auxv_fd =3D open("/proc/self/auxv", O_RDONLY); > - assert(auxv_fd); > + assert(auxv_fd !=3D -1); > while (read(auxv_fd, &auxv, > sizeof(Elf64_auxv_t)) =3D=3D sizeof(Elf64_auxv_t)) { > if (auxv.a_type =3D=3D AT_HWCAP) > -- > 2.14.1 Acked-by: Chao Zhu