From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0044.outbound.protection.outlook.com [104.47.41.44]) by dpdk.org (Postfix) with ESMTP id 04A227D02 for ; Mon, 4 Sep 2017 17:32:11 +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=hbRhXvwW2vhxoF15eIrsO8yLzrAQ80Qo8Zl5Ua+l/5c=; b=F920nuXQJKmatwyplpvfMJy1azCMPUwKXgt2A4ihV8weug5i8yl9M1T9skyd4mJyiov1bflbGQ/uhOBwNAQVqYCCRK0VadKfiqGwOrE8Oa80rbeyx3EyYSHhsKu3fxeReBTlJF3c1O3PCiOVGrhEwJSCn2Gr3CDojOE9jGUUZks= Received: from [10.89.1.1] (14.140.2.178) by MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Mon, 4 Sep 2017 15:32:04 +0000 To: "Burakov, Anatoly" , "dev@dpdk.org" References: <20170814161059.6684-1-santosh.shukla@caviumnetworks.com> <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> <20170831032618.7120-3-santosh.shukla@caviumnetworks.com> <1856034f-15c1-36e2-8b26-952a584bc982@caviumnetworks.com> Cc: "thomas@monjalon.net" , "jerin.jacob@caviumnetworks.com" , "hemant.agrawal@nxp.com" , "olivier.matz@6wind.com" , "maxime.coquelin@redhat.com" , "Gonzalez Monroy, Sergio" , "Richardson, Bruce" , "shreyansh.jain@nxp.com" , "gaetan.rivet@6wind.com" , "stephen@networkplumber.org" , "aconole@redhat.com" From: santosh Message-ID: Date: Mon, 4 Sep 2017 21:01:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MWHPR15CA0055.namprd15.prod.outlook.com (10.174.254.17) To MWHPR07MB3102.namprd07.prod.outlook.com (10.172.95.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a33792d-d978-46b8-ab55-08d4f3aa1adf 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:MWHPR07MB3102; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 3:leLAU7Wxz7ZX1hBcm68jZD1ojd2Me1o4cwvCC2syYzN5Bnwgf9S/AsFYoQX2+YFELxZ1YSCjln4AauxXY/ojOat2738E5QtWZz+oqiJjY70YDQhofhBXeINb7VeqHUh/qHk0zcaT83XOuQSh91243FR7E88+EQ++8Kc6yCKFFr5IkBzpExpzGprdR2iHiVxQPckej5VJs05BN7iAm/eit45XIbDh8oiFDHHjDWd6HOnJbWncj2NBgeHQT4PpwpdK; 25:fLQsoI8F4YuRGHC5RtNSfWWly0M+pwRxWk2WK49ILKC7bgybJmgJBrnYScRtSfrcuIFflH45mw/K33RTUTtjQdzlk3E4H/If0AE3GLVAceHgMed64cibyC2V7iK6i4NYC7A1sEQfzChm8s9CGjITXgRu7SVtgX5ZrlAzAy++N8Jo84mpu+7p2FXjh3jrYdkQSafo+HtwiIooWz7Sevo8lHSrOh6knPaLIilz7UkAXLw12cI8SFsFloPzGbP/sONVvF3NZL6zTjMAVxBdr59T+seuW1Jk8VwOLYKuRumaYwn7l8oAej3/C2+pX8cqTbil0EhI3d7av4chu+lH/464cA==; 31:9+5Zx6G+jnb+S7CKrIXm02qkp5N+/EoKIfZRj5WbZrXqbyL83xzzROEydDUedl8I4ZFQscpH80psuecIqVRqIlRU2kfvDUt5SW6bTmo8D5K24QAn0MVl0URZSAt9rPADMt4VdFOvGFNp+I4fFizz+0MVi/rDPjhAWG7ExUA5aoAdlY6sqtHrI5upaYIpWDSvM+H2HkkdAqS8ZYNMD83n6bL09WDQSydZ7veEvBycfjw= X-MS-TrafficTypeDiagnostic: MWHPR07MB3102: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 20:UK1zA83G1s0t9i226ujs24hNxlCu+yPIcF49gzqki6Y/nZj3Jk9JQYVr8zm2qICrBT2b8HSvp0Jad3p8cOA+4wrp7/lQaAvNfVLSGKFcMH/9gsV92PDrPu1AM7r+sTbZl0TQWh/dH8NgqHYqQqF4VjvYoLXzG7vn9aKBYrQBfUiQx6Wc20whJOU9HBwaB3mg5WIhpaLmsL+PtmdA+UQk7KQg9NGA5CJ1NctWwKWpLtDIKJCYv8LW3xvEQxtL+gQbzxhsBJMY4R8eCN7DPxRywv3d3Mxn6FwB+poVTLa9V0Iiw6hwT9efdM2Qi/QLEC1Lleoarp1oE8+Y4CvO/icwCb/dig3SrXy+S1Ruw5qVUkxQx5clCMV6Xim7OtPgO9SLzhx50qBW1sCu6jljFPUI7OfEFQ9bl91OMJw0+0dYnZdnzp+NXhiqoexN4P0xHHR8GjMvzYaT1reBDWqNtkFm07n/Q0lPlFooqkA4zLUQIlR+NqzHEQg+NB0T9i1isD0nuuJPdaAQwQd7tIlu64bDz3YAgE7ewi7RH3c09fg4XQUEPpmlq85aEQcy2pkoJbuesqxn0iMVD0T5dluMQXJK+rt/RnYyrxR8wWl8AA1SzLo= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3102; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3102; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 4:p00h4ii687EVEc0WbTu8+/hMB5bzrttizCBTbzidFl6LYEbOUR4d3Z92/3JVtdZBsj5RF++jNpfx7wJHvoBkuMHBpPGuNG172usd0c/fuv+2For8a1rpTi6ssK4WGpwUlLEcE7/bxQhfmKT/xBuVFGfSYFqTEwgKXzaM9dSEbqqN1Y209PSIMBZ227+LD//8g7SyGBheKSsbFzK+PDRbNgarHtsxekvceyQhkWo/Lfm3tcABsTBalf+GxAN+jEF1ueUpFg02Xp5CEnmNciWrLh9TbtzE+yAo5WIXui8DgC0aq7OAhyoHlIUiQXzAfqQTBsdTU94ZykTydxE0L4V49g== X-Forefront-PRVS: 0420213CCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(24454002)(377454003)(43544003)(199003)(189002)(230700001)(8676002)(6116002)(966005)(2906002)(3846002)(7736002)(101416001)(50986999)(53546010)(53376002)(53936002)(50466002)(64126003)(305945005)(8936002)(97736004)(7416002)(90366009)(81156014)(2950100002)(105586002)(81166006)(65826007)(42882006)(83506001)(6666003)(8656003)(229853002)(25786009)(5660300001)(4326008)(5009440100003)(68736007)(77096006)(6486002)(23746002)(31696002)(72206003)(86152003)(93886005)(31686004)(33646002)(36756003)(2501003)(106356001)(54906002)(5890100001)(47776003)(65806001)(65956001)(66066001)(4001350100001)(478600001)(76176999)(54356999)(6306002)(6246003)(189998001)(42186005)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3102; H:[10.89.1.1]; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR07MB3102; 23:bADF9NqIc6CYFU45VsE9rSa/J52NFjc+AU360?= =?Windows-1252?Q?kxnPjIgcOw7Z7Xc5e38tJTWuW8maW1xMvm2zcIiPaMRpaDwzmEDW3gei?= =?Windows-1252?Q?Z4Ckf3fVbVDWkEQ37fA+vmTX6oO4yvhK9mp1mqIjlN+KQaeLMmUmzTdb?= =?Windows-1252?Q?7BTtPaJa9097dDmM0xOEnoI+4WpEqAkkn7+f6LXZ7pgR2iqRotlQ0Q2X?= =?Windows-1252?Q?xyLt1EfPvQ+2jhhNJLO8UP3O05yX2KpqdUpty+JOcEnV3tMxjwLrCJBe?= =?Windows-1252?Q?i2ghBV5YU4SNer9617HN8Lgc4s/3SKhxq6DU+8aG/aYEBfosZnpaICgQ?= =?Windows-1252?Q?ahHozWouMwNC/XKKj5w6b1gilRQi/cGBWs93/CAyfNo6sLri7bARAA+r?= =?Windows-1252?Q?oy7QiW7/S/3kdz2bDikHrESJZOjNNQho0Zs3jn0qIO09vu6/hqaCg/nr?= =?Windows-1252?Q?+rh9bk3POmXWrtaeFSV2q5lVSXconNitK49BK8QkUPR81HcQt0DtcN3S?= =?Windows-1252?Q?xUCh9CWUQxa0c33J38yIbubE0Oqn/VJmfJu89popG/8xlw+OtBR9xiL1?= =?Windows-1252?Q?I7f6ZMWlZGg47ftS2AgOlVpcHy5j4zUKrKXrEYLCOs+MJMEg2lw4S8Ml?= =?Windows-1252?Q?hJROiGTppnFPXw/qmqHvbXtIeV3EsU6WgFG7G+8UqryVl8AE3kFtddfG?= =?Windows-1252?Q?m9R3zz8pMUHRNBNS195Z89wyNOsxqGa5lz5tQCepP6hPhPlmmniWDOBh?= =?Windows-1252?Q?L7ZZinpft/I12sDy4WFPCyYnVGOO43TSSnFE6MVsqKi7JoPvi/1clGsE?= =?Windows-1252?Q?pNaDZzGCc9fXuDxx3SUbPhRhYkqUmm2dsgs74MQ8mpWHz88ddhhoNG+l?= =?Windows-1252?Q?q39d9jXH+JyAAFNJ5VoG9oQCXTXs12byMdQxnCXkghMsFaX7nFZ5NWL7?= =?Windows-1252?Q?RoQBK8liVepfjTTK70JhmfgH9NBjkWd0zQXRD2XAERTVAUqvp2lzylfd?= =?Windows-1252?Q?kniQvQDqdX+xGVZsaQ6YcfhOnv+nZC9jYnnryD3D2B3QekMlkb7MTIaO?= =?Windows-1252?Q?FJh4Q464QhG7DeR+J+VEO5qKly4682opXSS3flH8ThCNsqKwNwU0TOKF?= =?Windows-1252?Q?PAxbrxQMCEFR+eKHBjWNGV9ZCvAa7QypKPHbBO35dp7B/JYKvfvxKF0U?= =?Windows-1252?Q?rqBnX4d3nxlseXzSWDyZSbh9GUBdZUkX3Awl1GDNSH0H0L0Izapk8ZM1?= =?Windows-1252?Q?zLe372FLyH0XheN0ugb/RJBjdtHf1kecorbrR4lBhGPg80e/5QeuZBKA?= =?Windows-1252?Q?qwAzjZ45NZ3wz8GJwf9gb66zuNT/3yD0G60l6f+KidCG4ydCzXIZYeM3?= =?Windows-1252?Q?SNBd2GAQhGYh7dcUWcUaZOlsMKZyAJk7VhONVQFWhDhCCThsR1KBCD8j?= =?Windows-1252?Q?rC5LsFDKaT5qplnqN0RX8JWigMrlIBpcnKoFVnzrceO0Bn1xpNIy3SEx?= =?Windows-1252?Q?c6Yv334S7T+3lgp1rGjX0hXpwHH14rmuUPs0wVU2Koh7KEA4dS7sVDpc?= =?Windows-1252?Q?vtMlYMY06gE8SxB/ByNV0j48cch0XAfS04oO2KgOeHngDNTGz2YgS9rh?= =?Windows-1252?Q?6CfY1/xM4wKDufCnJauHjs71ZgEppM1QhOYxZhSoIsabMO0Y7Muqmpeg?= =?Windows-1252?Q?T6+ZbG0VyT8+eOUsWpEONw3ADccz5/yA3knOPEJMdNd3ocZLOGL?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3102; 6:bftSO0Rna3kjqlSJlsYU6tibRTiqhCm1QgrFCUiD1kuTZsUnF6TelJk5cw18QBw0aAMrWHpjCPq29YHfStxntqU4+qjwUZvg2E+Pe5Sj+qRHELLIgHWXSO1gSQwQoNxmMiwnWvUEG7tvFY92s4s8i0DhTDX6cHeD6ZhY4Lc7BjoXNedvNz12gybhvIxNdVK5MQkwD8i8ZMuCv41/aHukKbKc82xjnMaYjbexFOKuycy0iE9IOJtQF7rcCtahD8g75aG8Z7w0H8oJVmZPGU+q0Gx5QyBs2IS4D9vPzBM6qK8WfnBwDDe+yAKl4Mt+wnCoFRuOhuJd62THPOR1uvvarQ==; 5:+tuaeMWLuvcJlaKOyHRfViOaL/RVGAs+m4xO+kmBf8rwZ/B4bo2ZVf+fuE9nIqMQKGuGPJGBvKC9NYkmW1PfrbmCruTcAmlFcqknac8zjWY/QKmjKEl1r+J+xIbjJSoL1eeCcKiz/RFrdnY2B7ZLlQ==; 24:wziohcPFFArRGYLuFR4fyLI3mGxfN8cSJVMC8j9A64z2nNoiz8znykOqW4rz3NHkxh0Uw5RwL+2ADDVIXTIigghpnoi7SCP0LUnRO9i9flo=; 7:f7xFafgZFtd9ur6+/1gkFU9pacMG3lD+cQ86BPW1nYp8dlWF4ph2qoEd2flJmf/YDpy8Th+feRzgZowQu99xh6t080xhtb/y9BMPiNul4+8ln7L/gSZB5SNPckFZZVW9kOHme3fE+rA+5YL2goMKY/N5omRkdccIN4ovna6zdkH2iagt5snyNXNQEX4KRDUqhHMAtfLadnlCvlVhNZ7ZdWUDp4oc6v3Q+N9UdKLTIuQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 15:32:04.2875 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3102 Subject: Re: [dpdk-dev] [PATCH v7 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 15:32:12 -0000 Hi Anatoly, On Monday 04 September 2017 08:46 PM, Burakov, Anatoly wrote: > Hi Santosh, > >> From: santosh [mailto:santosh.shukla@caviumnetworks.com] >> Sent: Monday, September 4, 2017 4:14 PM >> To: Burakov, Anatoly ; dev@dpdk.org >> Cc: thomas@monjalon.net; jerin.jacob@caviumnetworks.com; >> hemant.agrawal@nxp.com; olivier.matz@6wind.com; >> maxime.coquelin@redhat.com; Gonzalez Monroy, Sergio >> ; Richardson, Bruce >> ; shreyansh.jain@nxp.com; >> gaetan.rivet@6wind.com; stephen@networkplumber.org; >> aconole@redhat.com >> Subject: Re: [PATCH v7 2/9] eal/pci: get iommu class >> >> Hi Anatoly, >> >> >> On Monday 04 September 2017 08:23 PM, Burakov, Anatoly wrote: >>>> From: Santosh Shukla [mailto:santosh.shukla@caviumnetworks.com] >>>> Sent: Thursday, August 31, 2017 4:26 AM >>>> To: dev@dpdk.org >>>> Cc: thomas@monjalon.net; jerin.jacob@caviumnetworks.com; >>>> hemant.agrawal@nxp.com; olivier.matz@6wind.com; >>>> maxime.coquelin@redhat.com; Gonzalez Monroy, Sergio >>>> ; Richardson, Bruce >>>> ; shreyansh.jain@nxp.com; >>>> gaetan.rivet@6wind.com; Burakov, Anatoly >> ; >>>> stephen@networkplumber.org; aconole@redhat.com; Santosh Shukla >>>> >>>> Subject: [PATCH v7 2/9] eal/pci: get iommu class >>>> >>>> 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 >>>> Signed-off-by: Jerin Jacob >>>> Reviewed-by: Maxime Coquelin >>>> --- >>>> 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(+) >>>> >>>> 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 c819e3084..1fdcfb460 100644 >>>> --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map >>>> +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map >>>> @@ -242,5 +242,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) >>> Hi Santosh, >>> >>> No need to set values explicitly, standard C will take care of it. >> no strong opinion, change queued for v8. recalling myself on why expressed RTE_IOVA_PA/_VA as 1 << 0/1. Since user in future (by mistake) may add new entry example: RTE_IOVA_XX = 3 then it will enable both _pa and _va both, So to avoid such programming error, deliberately kept _pa = 1 << 0 and _va = 1 << 1, if new entry comes (highly unlikely) then should be programmed as _xx = 1 << 2; If you convinced then I think - i don;t need to spin this change for v8. >>> I wonder the purpose of "don't care" mode. It's not used for anything but >> cases when no driver is bound. All the libraries (e.g. rte_malloc) will only >> check for IOVA_VA mode. Can't we just used PA in all cases where IOVA_DC >> would be applicable? >> >> Indeed policy is to use iova_pa for _dc case, but we need a way to distinguish >> between no device found vs device attached (if attached then decide upon >> its iova scheme). >> >> For more detailed info pl. refer [1]. >> >> [1] http://dpdk.org/dev/patchwork/patch/26762/ >> > Maybe make your intentions more explicit then? I.e. instead of "don't care" use "no device" or some such. No strong opinion either way though, I'm fine with leaving it as is. prefer keeping _DC, if you don;t mind, sounds more appropriate to me. > Thanks, > Anatoly