From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9E73D5677 for ; Mon, 8 Feb 2016 10:15:46 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 08 Feb 2016 01:15:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,415,1449561600"; d="scan'208";a="44212606" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 08 Feb 2016 01:15:45 -0800 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Feb 2016 09:15:43 +0000 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.100]) by irsmsx112.ger.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0248.002; Mon, 8 Feb 2016 09:15:43 +0000 From: "Burakov, Anatoly" To: Santosh Shukla , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 3/4] eal/linux: vfio: ignore mapping for ioport region Thread-Index: AQHRYa67/BXqAfDIVkKWrI7KJExGV58h3u2g Date: Mon, 8 Feb 2016 09:15:42 +0000 Message-ID: References: <1454853068-14621-1-git-send-email-sshukla@mvista.com> <1454853068-14621-4-git-send-email-sshukla@mvista.com> In-Reply-To: <1454853068-14621-4-git-send-email-sshukla@mvista.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 3/4] eal/linux: vfio: ignore mapping for ioport region X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 09:15:47 -0000 > vfio_pci_mmap() try to map all pci bars. ioport region are not mapped in > vfio/kernel so ignore mmaping for ioport. >=20 > Signed-off-by: Santosh Shukla > --- > lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) >=20 > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index ffa2dd0..4832313 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -659,6 +659,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > struct pci_map *maps; > uint32_t msix_table_offset =3D 0; > uint32_t msix_table_size =3D 0; > + uint32_t ioport_bar; >=20 > dev->intr_handle.fd =3D -1; > dev->intr_handle.type =3D RTE_INTR_HANDLE_UNKNOWN; @@ -853,6 > +854,25 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > return -1; > } >=20 > + /* chk for io port region */ > + ret =3D pread64(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar), > + > VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) > + + PCI_BASE_ADDRESS_0 + i*4); > + > + if (ret !=3D sizeof(ioport_bar)) { > + RTE_LOG(ERR, EAL, > + "Cannot read command (%x) from config > space!\n", > + PCI_BASE_ADDRESS_0 + i*4); > + return -1; > + } > + > + if (ioport_bar & PCI_BASE_ADDRESS_SPACE_IO) { > + RTE_LOG(INFO, EAL, > + "Ignore mapping IO port bar(%d) addr: > %x\n", > + i, ioport_bar); > + continue; > + } > + > /* skip non-mmapable BARs */ > if ((reg.flags & VFIO_REGION_INFO_FLAG_MMAP) =3D=3D 0) > continue; > -- > 1.7.9.5 Acked-by: Anatoly Burakov