Message ID | 20170918104234.9149-3-santosh.shukla@caviumnetworks.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1063A1AF03; Mon, 18 Sep 2017 12:43:31 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0063.outbound.protection.outlook.com [104.47.32.63]) by dpdk.org (Postfix) with ESMTP id 0DB12199AE for <dev@dpdk.org>; Mon, 18 Sep 2017 12:43:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZHM9lBX9Y+k41HOr0wUsS0gDFu0M/mp1QehzBmLowUk=; b=ZjzD1tJ50yHkRa9hYTixfcotpYn3sdL2tu/iIM9xvQqkJC5pmviucsL2Pbm6VHhx8VS0sgRqtWbx6HftvNpLsqGr016KCpqHHBvdMKALEZzUz0ptEntSCCGxcg4bML4BlFKZNWfJLZ2PYmg6wHYDNAYWPf8SCGQ2q/TynFY0yA8= Received: from localhost.localdomain (14.140.2.178) by DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9; Mon, 18 Sep 2017 10:43:21 +0000 From: Santosh Shukla <santosh.shukla@caviumnetworks.com> To: dev@dpdk.org Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, aconole@redhat.com, stephen@networkplumber.org, anatoly.burakov@intel.com, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, bruce.richardson@intel.com, sergio.gonzalez.monroy@intel.com, maxime.coquelin@redhat.com, Santosh Shukla <santosh.shukla@caviumnetworks.com> Date: Mon, 18 Sep 2017 16:12:27 +0530 Message-Id: <20170918104234.9149-3-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> References: <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> <20170918104234.9149-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0093.INDPRD01.PROD.OUTLOOK.COM (10.174.144.161) To DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c6032f6-5402-4cb7-a22c-08d4fe821903 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR07MB3097; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 3:m3ftM9tkTaRaVZtFxYkP04IsfmWPMQnwsMvoLCmwiSiaqN3WdHN9r7mBpfP7M5N0aExDoz8GUyQBi+phTq3Awl+KaBRBC5PCCRgdA+NWGLkizdzo9CDx5Cb907CaZNgB8/PMDAgVl4Ijctuf3A751INYQ9tcGIcRMJ9vTEHESGwlox1YG2svQ2qHAmjKCnP8kJBRrdj3V80AUsvlPUNb7oxyg+uszOsHHAGdkZGKeW73ghLB0DfsHGYYTuwnbqSd; 25:2LothoqpSARBp7x3cg0rKisHnzPQ+0fYZjbnf0+rnq8r259HZ7KFzZaOuw7ri0VWZuKanEXzPx8d8cv1d3ifwEHkmPI1yvc3AMaanC3PcW/B4cZZlGD0zgCh6/chBTa3/zxdQgInmC9ON6vw0sMPTmZtta2ip0B3NoVcGDuArZX/lsl0NvX+gG4EE3Wol3KOclGQoH+BcFZAhXlqPrxdTfezYThACkb3nKc9fTe1BPIBmbB/if8mlVj0igbcVG6tlcXfrqdj94/6dQxzwhjLz1QqUMXZBrU8szDp5rTbKYPSIcCYPx6/aBqHBX91DO8CmpQpmXAu5SfEaLoxv7ioOA==; 31:3cTimujNAxvKM8v/84DIvSfHoR8II4BZaYjBes89ITFm7C2q4m3unH297MyLu4OaQeXkYt49++qgw4amocdEqQPZ0V7gqRpxi4eizIy3E8p7hzoJQoi/CDys/N1MF2BjZaMWDBrLYW7LqKhlupC/YodxgjV8GAPkcPO4OwAU1NcO3hH7B5oBMW/RzxeDFSarTDmyxQ71oAHh6HbMsJ2noHLOAoeNDdkup8i78JykPUk= X-MS-TrafficTypeDiagnostic: DM5PR07MB3097: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 20:Pwhzb2Zo2ul+vxYh9I/XobyvN+OVlRLV0iT8gLbFvQJxEI7HpE6rfMbbecLuWYbM3jTS1z2Tv5YxWtnyu19XnzYRGk0l083yo1I9Dck9gjOB+Q6Q2aDz2AyE214EdZfMChKwQpJ34rC09joROJ5hOJutSvzfbWy8hp60b+iQbFt9hiZtEV2+KqeAUVVrAmt31Q1+WqzQ2o4fdXOX7vZRtwaRfkC21fBXxMvJuGM3jI2L1GlvcgPgchhDZehlf96Pblfg3P+9TTBSi4v6GC548W9wIZuaNDJM797iBT6wKmnJKVhD0hu2UUC3ADiBC2cprxBm8jcVuaTXPJvMJOZ9Axu3f7OYLF6p2+341aer5Gn+C3qpfWfdcU/qwPq/PaJ05D93fJ6z3nDkt/kzYgmfKwkKCEVnOaJ+MQAm90WOB2ittjEkENUNVEGZkIJbV2z82dx7sn82D8VR18aljfUGzSA+gpV+tD12StbEDyjptZ/xZrWrkBSN3jsk1yqnYD9UTMBK0GdG4Kh8Xp9eLskZjtJEoCFpzJaeK5nGIWpQwkc1kFNO+M8phQlrxOCqVh06AhMSoElw1IOVKiJY1yqCSYLDThC+2APzAgzPAXJUigg=; 4:S+ICDS20591pjEARthpaQMDwkTVONdiSyb/H0CRBeAezk6bBQefHoe8NLHBNimy6CPJsMdi4V6G4848r8gJXJEnPHrYtSCH45tQScn3Di400g9gbiBpOSKCsaOLGVj1frN/12II2ZV22b/z9YX6P+dnvFPX/g3haoz51/3Xn39ti/ATGKPpUD3QtGI+LItMYVngINkff8iogNjrGvr1fdgkXM/B76pvG4jnUDUTy8Csxb2UoRRUM1ZAb4Sb1wP8H X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <DM5PR07MB309737156EE69283B4A6A6C5EA630@DM5PR07MB3097.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3097; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3097; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(199003)(189002)(6486002)(76176999)(6506006)(48376002)(50466002)(25786009)(5003940100001)(107886003)(110136004)(53936002)(4326008)(101416001)(97736004)(6512007)(16586007)(106356001)(105586002)(2351001)(47776003)(305945005)(189998001)(33646002)(478600001)(5660300001)(2361001)(42882006)(6916009)(2950100002)(7416002)(5890100001)(36756003)(66066001)(2906002)(7736002)(81156014)(68736007)(50986999)(8656003)(81166006)(50226002)(316002)(8676002)(3846002)(5009440100003)(8936002)(16526017)(6116002)(1076002)(72206003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3097; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3097; 23:n9qIrWVeRcpqnTe6avke2dMEK5Tucl0L9Ygwkjo7q?= cVMCGJMZE4VFHJ/hRDC2Ips4bs4wYRyJ4a/Alro+B12SR/npSL/JdacBrFxx4lDJpGw4vpCRYF+OF0MYss3+jufuqG03tq6qjvNJW+2iJLVhLGHUXV2Sirqlre5yVfAKy7dtTxCUo9F6jFzdrCsJtYl4S6Cmp3cd2PFBWDHopnL7TNQ8oICE5ABJoy0dAsTzVmjs39ezCzxqY8bDM6X80XXUwNBxkKVrCfZ8BC/PrjcxKYUWQiT+YsPb3Z5EylVBQOIeHEcXvkc/pOfxFlCJ3dZ9FipXuEndp2xKhpUa/TABwyigSIxfRhA5uIDb3hK91uLZQ5xIMwkPoSNLUnXeRQRYSVf2YhYm9Hcfe0hKacpIgWFdReqPM1XABByQ8t/zsK55Q+i9Va/+0RVPedyvs8nqAEwVIZdcjgYYYos75+RdY0cnSYyX2HzzRhz/et76A0CpDd+q39GKoBjZxZJwFnonmJYCJETP5dyrbUBakwQJmRKrlAS2h0snm03UBkc4yfhDyoM/tZ6odwMkF/pnOPAhRiPkXfpRjHbQU2iTuDGfusnK0u5c8VX96NPfMmp/LszF6JnPRUMPageZbawCExe2D6N2U7uQQHe1GfW/WFJ3BrNiOlR1SAygWWkjVst2NAIk4a8bYQ6xrSjicV1T6Mfw/sVAcUxhKm5WT20P8e/A2KIqRoqOcG35Dp4VICYJlsIem/rbM2zJ0Cd+9GE/tk88VOZD1cy7g1qznDUMnDp+NVQVrGoVMmbGJ0ELT0/SHr20cdZBi3kqGGNn+klTkEGH1QGKLiIvlSBjappQBf/HNiY5hwOhsRCgsuC1bfcnXRmMT8RZf2OWn3rUNkDx/TzJtdgX5SxiI9WuMPi9nhiguh+P1/orQciv6FbPQIEr9zuseuIz/8rtP6XOPKIK7/lF3LZDsCXxeqTnj9BLHNnChqVV8x1ky6i9QGz8P9E8OUCbooCbsZMTBNQCN08QpjDcTvp5yWkcL1qmSIlCZzQgQQ6OUiZUa7pDTXjHMYKqL6eDEwnjI+tGzDxCv/j5op2jztyKIrBsE04C0+8zvikzYDqvQAVSD+oo96uf3+StCvJpCve/y+y0vmF72AJhefezegy2UYx3CEze5ePZk72y7OXfAEIsUW2HegbOH7QOcL4ZZn07dU/eOKUSDyFgoF2Uff+7Q+Wpo7akFIY5VeWwx68L88b57VDWd5+XTy6y6MbD/KtJhGr7JvghoQ60j9kz0FwwKDfbidQUHjf2kMsY8Pq4k4xvQdlbKs6OveHbuY= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 6:uSsH9iyMsUmcpmXxEUAkwxJij9JaOpY4rU8deakCW280Eg+AwdEMMKFWJFASa0vD8+0TYSFTSsnsp9e0iODA1H3nw3RtUsDt76LVEgpTKqtm6pp3HdxlctEragWMOA8HYZ8/9sNATLKZqB7fasj+dRJRNqIRSLwGKJZqewDhLsEzpYu1eGAG27HQQeKMSxchhZEIud/PgDAjVY34bz+vPogI/78kXFrbUMrJ141KsfZ3gomNHpeY1ibcTur3q9h+oxlCCnIcMrZFzyzZng55bJT+R0QWWmlgBunMz1ChNMmCAjf9ZK+vriV7w2nvziXFcOUDMBJrlm7fbSFNakRg3g==; 5:CjIMVnWCSNPIJbcYFSVCUWMAPAtx/z3UpEmIAdCgxwZQuIbmNQLZ1GLCZ0ZfqZ27w8YDZdhgT3YNDb/thwFKEKPz7ZGsQlXT0wej716LmUenJN+dfMx2/S4NtkPYW7HwOv6m6q3iBgxofhZa9UkfBw==; 24:VN32JKUab+FhjyiRiNMHZONxzEyx+ML/gu7kuyB7VpiwrUa3qqQjqcoVvR8bveAe6TuoRTj2zbTTNvnTm/jt4+MCsMpOcyUr7MmQLSEtdl8=; 7:j5dPfuP9J0TexnBDXfTEOIMZsgFqZhwLfO5iLlZhLH4c6s9m4Ll0NfIdcaVdZY14L/T85auexhGiPvEqc0X6JFHqbAwac323BTydfr1KGVNkUiy3ciWm1zM+uQ2SLb9/f4a4PjKaJfNOyNqau5ApjFpDvd1br/UMwDzK48pg2q1xb+gQCrCKsBSLZDZFn7/xFpDICPICdm2KItxvlTyBxxhi3upeb+YvEHoMK8hANf8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 10:43:21.7454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3097 Subject: [dpdk-dev] [PATCH v8 2/9] eal/pci: get iommu class X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Santosh Shukla
Sept. 18, 2017, 10:42 a.m. UTC
Introducing rte_pci_get_iommu_class API which helps to get iommu class of PCI device on the bus and returns preferred iova mapping mode for PCI bus. Patch also add rte_pci_get_iommu_class definition for bsdapp, in bsdapp case - api returns default iova mode. Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> --- v6 --> v7: - squashed v6 series patch [02/12] & [03/12] (Aaron comment). lib/librte_eal/bsdapp/eal/eal_pci.c | 10 ++++++++++ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + lib/librte_eal/common/include/rte_bus.h | 10 ++++++++++ lib/librte_eal/common/include/rte_pci.h | 11 +++++++++++ 4 files changed, 32 insertions(+)
Comments
On 18-Sep-17 11:42 AM, Santosh Shukla wrote: > Introducing rte_pci_get_iommu_class API which helps to get iommu class > of PCI device on the bus and returns preferred iova mapping mode for > PCI bus. > > Patch also add rte_pci_get_iommu_class definition for bsdapp, > in bsdapp case - api returns default iova mode. > > Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com> > Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com> > Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com> > --- Hi Santosh, You have probably missed my comment on previous version of this patch, but for commit history reasons i really think you should add a linuxapp stub in this commit as well as a FreeBSD stub, even though you are adding a linuxapp function in the next commit. Any linuxapp application using that function will fail to compile with this commit, despite this API being already present and declared as public.
Hi Anatoly, On Tuesday 19 September 2017 10:07 PM, Burakov, Anatoly wrote: > On 18-Sep-17 11:42 AM, Santosh Shukla wrote: >> Introducing rte_pci_get_iommu_class API which helps to get iommu class >> of PCI device on the bus and returns preferred iova mapping mode for >> PCI bus. >> >> Patch also add rte_pci_get_iommu_class definition for bsdapp, >> in bsdapp case - api returns default iova mode. >> >> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com> >> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com> >> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com> >> --- > > Hi Santosh, > > You have probably missed my comment on previous version of this patch, but for commit history reasons i really think you should add a linuxapp stub in this commit as well as a FreeBSD stub, even though you are adding a linuxapp function in the next commit. Any linuxapp application using that function will fail to compile with this commit, despite this API being already present and declared as public. > First, apologies for not following up on your note: I prefer to keep less context in each patch and for [03/9], its already has _IOVA_AS_VA flag + whole autodetection algo inside (squashed per Aron suggestion). Now if I squash [2/9] into [3/9], then would be too much info for future reader to digest for (imo). Its a kind of trade-off. On any linuxapp appl breaking with this commit: This series exposes eal api for application to use and identify iova mode. If you still feel not convinced with my explanation then I'll spin v9 and squash [02/09], [03/09] in v9. Thanks.
Hi Santosh, On 19-Sep-17 6:29 PM, santosh wrote: > Hi Anatoly, > > > On Tuesday 19 September 2017 10:07 PM, Burakov, Anatoly wrote: >> On 18-Sep-17 11:42 AM, Santosh Shukla wrote: >>> Introducing rte_pci_get_iommu_class API which helps to get iommu class >>> of PCI device on the bus and returns preferred iova mapping mode for >>> PCI bus. >>> >>> Patch also add rte_pci_get_iommu_class definition for bsdapp, >>> in bsdapp case - api returns default iova mode. >>> >>> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com> >>> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com> >>> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com> >>> --- >> >> Hi Santosh, >> >> You have probably missed my comment on previous version of this patch, but for commit history reasons i really think you should add a linuxapp stub in this commit as well as a FreeBSD stub, even though you are adding a linuxapp function in the next commit. Any linuxapp application using that function will fail to compile with this commit, despite this API being already present and declared as public. >> > First, apologies for not following up on your note: > > I prefer to keep less context in each patch and > for [03/9], its already has _IOVA_AS_VA flag + whole autodetection > algo inside (squashed per Aron suggestion). > > Now if I squash [2/9] into [3/9], then would be too much info > for future reader to digest for (imo). Its a kind of trade-off. > > On any linuxapp appl breaking with this commit: > This series exposes eal api for application to use and identify iova mode. > > If you still feel not convinced with my explanation then I'll spin v9 and squash > [02/09], [03/09] in v9. No, i don't mean squashing these two patches into one. I mean, provide a stub like for FreeBSD, and then edit it to be a proper implementation in the next commit. I.e. in this commit, add a stub that just returns 0, like for FreeBSD. Next commit, instead of starting from scratch, start from this stub. Thanks, Anatoly > > Thanks. > > >
Hi Anatoly, On Wednesday 20 September 2017 02:39 PM, Burakov, Anatoly wrote: > Hi Santosh, > > On 19-Sep-17 6:29 PM, santosh wrote: >> Hi Anatoly, >> >> >> On Tuesday 19 September 2017 10:07 PM, Burakov, Anatoly wrote: >>> On 18-Sep-17 11:42 AM, Santosh Shukla wrote: >>>> Introducing rte_pci_get_iommu_class API which helps to get iommu class >>>> of PCI device on the bus and returns preferred iova mapping mode for >>>> PCI bus. >>>> >>>> Patch also add rte_pci_get_iommu_class definition for bsdapp, >>>> in bsdapp case - api returns default iova mode. >>>> >>>> Signed-off-by: Santosh Shukla <santosh.shukla at caviumnetworks.com> >>>> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com> >>>> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com> >>>> --- >>> >>> Hi Santosh, >>> >>> You have probably missed my comment on previous version of this patch, but for commit history reasons i really think you should add a linuxapp stub in this commit as well as a FreeBSD stub, even though you are adding a linuxapp function in the next commit. Any linuxapp application using that function will fail to compile with this commit, despite this API being already present and declared as public. >>> >> First, apologies for not following up on your note: >> >> I prefer to keep less context in each patch and >> for [03/9], its already has _IOVA_AS_VA flag + whole autodetection >> algo inside (squashed per Aron suggestion). >> Now if I squash [2/9] into [3/9], then would be too much info >> for future reader to digest for (imo). Its a kind of trade-off. >> >> On any linuxapp appl breaking with this commit: >> This series exposes eal api for application to use and identify iova mode. >> >> If you still feel not convinced with my explanation then I'll spin v9 and squash >> [02/09], [03/09] in v9. > > No, i don't mean squashing these two patches into one. I mean, provide a stub like for FreeBSD, and then edit it to be a proper implementation in the next commit. > > I.e. in this commit, add a stub that just returns 0, like for FreeBSD. Next commit, instead of starting from scratch, start from this stub. > +1, Sending v9. Thanks. > Thanks, > Anatoly > >> >> Thanks. >> >> >> > >
diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 04eacdcc7..e2c252320 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -403,6 +403,16 @@ rte_pci_scan(void) return -1; } +/* + * Get iommu class of pci devices on the bus. + */ +enum rte_iova_mode +rte_pci_get_iommu_class(void) +{ + /* Supports only RTE_KDRV_NIC_UIO */ + return RTE_IOVA_PA; +} + int pci_update_device(const struct rte_pci_addr *addr) { diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index cfbf8fbd0..c6ffd9399 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -243,5 +243,6 @@ DPDK_17.11 { global: rte_pci_match; + rte_pci_get_iommu_class; } DPDK_17.08; diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index c79368d3c..9e40687e5 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -55,6 +55,16 @@ extern "C" { /** Double linked list of buses */ TAILQ_HEAD(rte_bus_list, rte_bus); + +/** + * IOVA mapping mode. + */ +enum rte_iova_mode { + RTE_IOVA_DC = 0, /* Don't care mode */ + RTE_IOVA_PA = (1 << 0), + RTE_IOVA_VA = (1 << 1) +}; + /** * Bus specific scan for devices attached on the bus. * For each bus object, the scan would be responsible for finding devices and diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index eab84c7a4..0e36de093 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -381,6 +381,17 @@ int rte_pci_match(const struct rte_pci_driver *pci_drv, const struct rte_pci_device *pci_dev); + +/** + * Get iommu class of PCI devices on the bus. + * And return their preferred iova mapping mode. + * + * @return + * - enum rte_iova_mode. + */ +enum rte_iova_mode +rte_pci_get_iommu_class(void); + /** * Map the PCI device resources in user space virtual memory address *