From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 06/16] vfio: generalize pci_vfio_has_supported_extensions Date: Sun, 10 Jul 2016 19:36:57 +0200 Message-ID: <2658506.JKWTbPl3g7@xps13> References: <1467645411-15494-1-git-send-email-viktorin@rehivetech.com> <1467645411-15494-7-git-send-email-viktorin@rehivetech.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, Anatoly Burakov , David Marchand , Keith Wiles , Santosh Shukla , Stephen Hemminger , Shreyansh Jain To: Jan Viktorin Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id D12B419F5 for ; Sun, 10 Jul 2016 19:36:59 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id o80so23860224wme.1 for ; Sun, 10 Jul 2016 10:36:59 -0700 (PDT) In-Reply-To: <1467645411-15494-7-git-send-email-viktorin@rehivetech.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is a small error in this patch: 2016-07-04 17:16, Jan Viktorin: > The pci_vfio_has_supported_extensions is not PCI-specific and it is a= private > function of the eal_pci_vfio.c. We just rename the function and make = it > available even for non-PCI devices. |...] |> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c > @@ -62,6 +62,39 @@ vfio_set_iommu_type(int vfio_container_fd) { > } > =20 > int > +vfio_has_supported_extensions(int vfio_container_fd) { > +=09int ret; > +=09unsigned idx, n_extensions =3D 0; > +=09for (idx =3D 0; idx < RTE_DIM(iommu_types); idx++) { > +=09=09const struct vfio_iommu_type *t =3D &iommu_types[idx]; > + > +=09=09ret =3D ioctl(vfio_container_fd, VFIO_CHECK_EXTENSION, > +=09=09=09=09t->type_id); > +=09=09if (ret < 0) { > +=09=09=09RTE_LOG(ERR, EAL, " could not get IOMMU type, " > +=09=09=09=09"error %i (%s)\n", errno, > +=09=09=09=09strerror(errno)); > +=09=09=09close(vfio_container_fd); lib/librte_eal/linuxapp/eal/eal_vfio.c:77:4: error: implicit declaration of function =E2=80=98close=E2=80=99 It is fixed in patch 8 with "#include ".