From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0085.outbound.protection.outlook.com [104.47.41.85]) by dpdk.org (Postfix) with ESMTP id 62A325323 for ; Tue, 17 Jan 2017 05:59:50 +0100 (CET) Received: from CY1PR03CA0002.namprd03.prod.outlook.com (10.174.128.12) by DM5PR03MB2475.namprd03.prod.outlook.com (10.168.233.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 04:59:48 +0000 Received: from BN1AFFO11FD008.protection.gbl (2a01:111:f400:7c10::108) by CY1PR03CA0002.outlook.office365.com (2603:10b6:600::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Tue, 17 Jan 2017 04:59:48 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD008.mail.protection.outlook.com (10.58.52.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Tue, 17 Jan 2017 04:59:47 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0H4xjwW009905; Mon, 16 Jan 2017 21:59:46 -0700 To: Ferruh Yigit , References: <1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com> <1484581107-2025-6-git-send-email-shreyansh.jain@nxp.com> <4721b3d8-7374-76e8-d859-61c86a88a314@intel.com> CC: , From: Shreyansh Jain Message-ID: <0d943156-b700-3964-3e4f-9d8083ebd783@nxp.com> Date: Tue, 17 Jan 2017 10:33:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <4721b3d8-7374-76e8-d859-61c86a88a314@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131291027879832786; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39450400003)(39410400002)(39400400002)(39860400002)(39850400002)(39380400002)(2980300002)(1110001)(1109001)(3190300001)(339900001)(24454002)(189002)(199003)(377454003)(38730400001)(36756003)(83506001)(86362001)(54906002)(23746002)(4326007)(85426001)(54356999)(305945005)(50466002)(104016004)(76176999)(5001770100001)(4001350100001)(189998001)(64126003)(50986999)(97736004)(5660300001)(81166006)(230700001)(6666003)(2950100002)(8936002)(229853002)(68736007)(2906002)(31686004)(47776003)(31696002)(92566002)(81156014)(105606002)(77096006)(65956001)(65826007)(106466001)(8676002)(33646002)(65806001)(626004)(356003)(30001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2475; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD008; 1:tLiz1zX9nzwlqFPXXldk+n/QtcnbpDyuUTRH5+3dzGud4k3uC1pn/ITJhDAAcvBrVobqkqedg0LwL5en2hIbhueo8I4dR+hHaw2hM9bjnAwtBT5JgAq65GgFzqQEkopsSyGno9GgKL4Vh+qygg+tYQy8CVHuQoEHapnckKi7BIO63OXENYpqC/NzoNsjxDsn4aRXCPUDoUyfN3aUJfaEwgmAkrOSKT/sKdbmBULqBrtzPOTF2l7iJ3oxvoAjHGLVT9yEhhcUHe7UJLbQUHsORWs4NCFV5RWf4XxXkGHDLy/8i6hYTfKPO4zmFJ5/dlstBPAJDfmcCtN3/9X2NA0FH3R2/HRcZMwLQi7oHcPuK34r3nG/o+7B//gcb0wjnUIuF8Na8Cd53Uh8uGTfuKyfsHLLWagsXIWR7hj3ZAiXcHjefakm2fSBjqKf2z/5tLsywwGh23zeBqCzs9P6Qo/Qap1G+spf+2zOOT3uc9XEc/6fZxTbvjspE2qwMWtDseuHg22cTk+51pwvsS8EYqsZCQXo4x0JQF6Df1dFNyrB9eno3j8K7Lo/VX/YWS4KWHkosfCHlIGx67M/5y6V+YdtO2Te1VtJ64JuuH/ity6220vhRDDSgK+XpClHkFIIif2N X-MS-Office365-Filtering-Correlation-Id: 826c0b20-9536-4a30-cb00-08d43e95a96d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2475; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 3:G6roBbnXysKk/fuCC5/jhF14WxfqNKhcFphebeI31IBvDNjQbMzBLvBy/JbYpZcDnf19oJhmkVN0Xz39+FmLEuO3rJl33QDez86CkzXx46deHKPZQonbRHdWZbZAOb0nDcES5vrwG5GYi1EM4WydIPWnpOzuHQDchcHNt++Qhyc5gFoAX7VFJW+7V+FZnEru6QLjGfDdrDvFahFdL7u2d9+su1vKMkK4fV0IePYJNzxhY1upFD4Uqfa/IOla3dcwcoWUXq3/y77pJjeXi/A9tAtfeGFSjy+8tGCnE7oKPy0CTWUk7rdd6QaQp+Pbq3xUKDjj53+KlxOcMRQE1q+7UCYi2+81Kg+zWgRECFA5HW3gdqqRu1Y7wdnXD3pFcfYE; 25:pVzTSZGSxtESSxVdmtbr29BWb5GkWDitvEpw7akbcF9pAvlajSFItjcbzPTg/k/yu/AiE87qtQgen3R0wobCle8xjbMAkX+OHntGKWXdfKI5zc24BSNuJPCQh5XY8mBvE9iycPCwaK8nISoE9kwH1zwGCDWb1ALcbB3iw0z2svSGCJETRrZ9RCLj33cIRFluwC/2Sm3VB4DnmrYQtxdCa+nUshDWn54Eb6+rCIPkVNtFvMytI4ya6uHdnNk3vKNcN0CFrrWI8v/+5iTbbA1prO2T9lni44xjFr6ZDbvZAXS4clXEV1J18QmQmEdx+WYb/Pbt/B4qY4ba2/JBdZtAimo/yFHG3rNV+1NDAiTTbakTCi9aqXDigvfPF+I3vc1lksidmqppVZ6Tec8YPLkP4rrEz5tEH0d56dlSW4eBtz+/zKbues6v5pG9jEaagaGhothg4Wy2fdKQbbRSf5J9yA== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 31:sJQQXbfgAkwzzWEW9peGf69Gdi1Qv48QnNZIRk9B2U1bSZK/xZtMK0OmmzJgWMrhZjO0+QXmHh6YHMQVLazOKpHMPJfVvg8Ot+Y1CKS8M9ZCMglzvppguuu+UJhwAVTtfK4nfZPcuTGtLwBmL9HIbYdwBhLBjYfcG/37pYQWwCbf4iDNTcSzIQtWnWkxw8s79DK8lOVgDe+HXxsxMMQN5SrpoPt3XLbn59/a7q/dD1ZQriT/4PkpR0hwQJiN+JmPiwIDUk5so4Ah/f1tPvOc5A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13017025)(13023025)(13024025)(13015025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(20161123559025); SRVR:DM5PR03MB2475; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2475; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 4:aHaIoh+iZth/tBTrbat5HVmAuVJSvJQhE2efjYQ6Dm7LFW17fSKS8y8xrJANChT8E09RlRwUd8G1MpJBV6G/EgiFeUtneKbY86CZe55cLsATrgBUJvby7p2aOOp9vpZZ7cUBwkQEIQrt4CmOxf0RPix58H8r6QuetrcwCq77D8VLOBhYJj4ooFqToP/I4fgaggQcBvJK5XldQVD1fv3uXfDscCdrRQ7srLUMhZFBLgaoGcujjVPtOIXooP1eWNNXnBLXXdU29YruG0I2ad/dfWFihawakBkwxlPFOPnfbxxIu8yDcB7B1k7qIg03ZeuqznNvj46l4sLabPT/ZejIoCAvtQ323Leu4j87RCrXhlJZ8nhpBSL3V+rEGjTkBXfqdNUXdckYKORt6cXAcrmjpVG8ogDCrxAg+VO+tUPEatrwjZdKyKjLFUYhqu29Z4gimEv7nuj1sBiv3JtFxvOmPhKj7IhYjTjFqOA6OiRuW3RDBWQeGU58YQdsFxeS1rr5u/uWoKJ3Uk0fJXM0iD7DQcwH51kuS54DFGLbQ5+iiSgb4qztsxx3ujXgMqs62gin/WKhHS4go1Sbn6th+umJxD+EjH5XZa0uzEaLe9p0w2fcPDGzOI0vgSwnEknXaWna44pvpSKRiS/7sx2c/dhlnFXrHGj7nJIqwv8CVXp3+Zx1wg+kTad3IwYZ8P3pn3S8gNHadkZgM6QuKCI8t/UBZldbnCclDWSBDBORsNWZYnLkr+hYBooas7y1qliMGDBP X-Forefront-PRVS: 01901B3451 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR03MB2475; 23:Ko3AOYVNKaVKBF11vMychUBdOpQAlOCJfnn9u?= =?Windows-1252?Q?r019yYFkp15eo83So3277Y4uzrWTMAHUvRla2bR2EnRKUXBmCEHL2LlF?= =?Windows-1252?Q?9niVh+KaAmanFKImj7AdPcTopN3pE0XaVri4cAV1CyLYIIHypEcG/ba9?= =?Windows-1252?Q?WuBcjyAcLtofvXVaFIzF88yANfJvcjf1rGS3vvo62oh3YWwQJ5fLONp2?= =?Windows-1252?Q?G/RhGklcer+RrM29NyofwjFnk3ubwYzheHUSsTq4GfigNEakM52Troi7?= =?Windows-1252?Q?Td6Hj4700O0KDYbfrLwYoBAINDR8lg8i8hNbgbfhnK464Q5uZ9ryV3xJ?= =?Windows-1252?Q?tKSFww2kvmgGOYS1MLl59N9mjgjBGtScTmxKcHdmfOR7PFPqm8HY0ION?= =?Windows-1252?Q?kVcKxSwhkjoGt6VyGeweLFcXnrVLtYriJ/sSAw9FzyE+/bGZjM9BHsyc?= =?Windows-1252?Q?rKIDN9UDj5hgs1Rw6Z1CopwU0VTHthJjr+jAR5wNc+LdOI4Y8gqYliX5?= =?Windows-1252?Q?SXHEl3hsA/eyhDcinVsiJkNEcg+v2tBVg4AAATIm8GHQ4tJInbYL3EvW?= =?Windows-1252?Q?yqd04FQ2MVhC9wcAfj4aMRRjJWyFpX7ljOaYvK77kdSVtato8urSLzx6?= =?Windows-1252?Q?3nlQJwexxWR6PA5hSeEZEEJ1LFESIxaN1LMHZxJUNDOQ1CtBtwtcMAwm?= =?Windows-1252?Q?MMFV9f+0HO13G6zqxFlUR/6B+5wXJRJw+rzTYknr3GmX+dmQ/K4UgE+X?= =?Windows-1252?Q?Pikn9lPfs51QJdfP7MtMQXIZwLoqw1w+8AO5dcOYxzh2owY4OmuRCdcu?= =?Windows-1252?Q?YrOgMq6FEHul8SzWVGECkeVCmmX8OtZVpd2rkAa4eCUl8imrmfJN+Wif?= =?Windows-1252?Q?l+SX8eVEXurYnhfZu66AXWruJvVGZbT2D85PrW5JCnpX0awV+kI4Rgni?= =?Windows-1252?Q?ubzX70f2q0DdfpuXQJnc8NpsdHmNqTSD1ArNBBrFPktMed/U4Y7IXi3u?= =?Windows-1252?Q?tboYnyKmSAViBFvOhjqTaYcnOkIoW8i0BvAKD9OVKmGP+22FmbU5Mwhd?= =?Windows-1252?Q?8yBZ6iGBXoIgPKECQE/9516Sv3xXol44c4F8fLtkEJ7mjnMQuCR/Y5ZA?= =?Windows-1252?Q?t+iXZPdE9zhCZXaCwiX0OCyW+4wacUTBG2Fimca16Y6jlurWxeBx4mRw?= =?Windows-1252?Q?iJj9SFQ4pMI6pN4xXB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0giyINPUslzmJsKfoIhS+aWe/+AJFe0AhaWCvoyhT4FHSN+DH5GHLdZjGQXJiYeOsYZ5SUNXjPotYWQjhgK2Jr3V2S3pt9mNS7tSQDh/GE7fN7V0iqrcgJCs1sGi8DTuWhR7auC8jCPqVsU7mjsfCItsek+fYK2gCviEMs3zOWt60jw49uk9ZUcd1gEOj9; 24:eJsWF2L4po2/NN0CgHJG2+WBsdb1y2vtnRkBNaPuuLjnNYV6IrQ1505Shsubsi2yKNW6Qzc0Hh6g39hQBiXqAGTzC0GcbU/L5HK63X9GJLc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 7:sdKhovYQ+0tO0IHBUTLR8Dwe59heLhMBhfvjNjdqbubYhWbrp1L2jEQGUmC85DXo3bD0q3UFJTcTS+gPzW+RFTEVw9SUSlPAalgpJSFwrJPwRo3oeuIeEJeYglt2z81gnA2tfnZABOH6TezKKzv6CQWqfuEwQaO+goivA2LgY3JLs6aQn9QFbgxzrflm6xG8FYlo3XkE5+aoqYlN4xugEnC95vX+4LY2PlfvlR0W/N6M0zYsW+TMVqN32sCJwiUP1W7orjAAgZJheSSBWtmQvpXyyEwbuKiN/6j2oKjdqO5zV7sr2osDfj1Wpr6aLkx0a9KX709WT0XANEqTwmJ15ekgL+lyN8+QkAqERvyS7Yr3+Nd/cVySAZP3i6PLd3R+SpNQ0lLaNNTn/ahnGN+qwSLIphUjQjy/h6su56+Chs3mu9/djjBlwuDOUxNP8XIqNYO1p7nW1yiJs4KORd+1+Q== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 04:59:47.7959 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2475 Subject: Re: [dpdk-dev] [PATCH v6 5/8] eal: introduce bus scan and probe in EAL 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: Tue, 17 Jan 2017 04:59:50 -0000 On Tuesday 17 January 2017 01:28 AM, Ferruh Yigit wrote: > On 1/16/2017 3:38 PM, Shreyansh Jain wrote: >> Each bus implementation defines their own callbacks for scanning bus >> and probing devices available on the bus. Enable EAL to call bus specific >> scan and probe functions during DPDK initialization. >> >> Existing PCI scan/probe continues to exist. It will removed in subsequent >> patches. >> >> Signed-off-by: Shreyansh Jain > > <...> > >> +/* Scan all the buses for registering devices */ >> +int >> +rte_bus_scan(void) > > I hesitate to make this kind of (not really functional) comments in this > stage of the release, but please feel free to ignore them as your wish. No issues - any review comment is welcome. > > Previous patch is (4/8) for adding bus scan support, so why not this > function (also .map and .h file part of it) added in prev patch? Maybe I didn't get your point well, but this is my take: 4/8 is for introducing the scan callbacks into the Bus layer. There is no work done for EAL yet in 4/8. This patch, 5/8, adds functions (not callbacks) and modifications to EAL for plugging the bus (with its scan/probe) into EAL. > > And if there is a specific patch for scan, probe can be another one? I agree with this. > >> +{ >> + int ret; >> + struct rte_bus *bus = NULL; >> + >> + TAILQ_FOREACH(bus, &rte_bus_list, next) { >> + ret = bus->scan(); >> + if (ret) { >> + RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", >> + bus->name); >> + /* Error in scanning any bus stops the EAL init. */ >> + return ret; >> + } >> + } >> + >> + return 0; >> +} > > <...> > >> diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c >> index 0d799be..35da451 100644 > <...> >> + >> +/* Add a PCI device to PCI Bus */ >> +void >> +rte_eal_pci_add_device(struct rte_pci_bus *pci_bus, >> + struct rte_pci_device *pci_dev) > > I think more generic approach from previous version was better > (rte_eal_bus_add_device()), but I guess they sacrificed for less > modification. There was a lot of offline discussions after the reviews were posted until v5. From the gist of it, I gathered that smaller 'specific' changes are preferred as compared to complete generic approach without an upfront usecase. Also, this change became irrelevant once I moved out the device/driver lists from rte_bus to rte_xxx_bus. This is inline with existing model of (rte_pci_device->rte_device, rte_pci_driver->rte_driver, rte_pci_bus->rte_bus) and having pci_device_list/pci_driver_list private to PCI itself. I guess what is going to happen is that in near future when buses start moving to drivers/bus/*, this kind of generic layer would come in. > >> +{ >> + TAILQ_INSERT_TAIL(&pci_bus->device_list, pci_dev, next); >> + /* Update Bus references */ >> + pci_dev->device.bus = &pci_bus->bus; >> +} >> + > > <...> > >> >> +/** >> + * Structure describing the PCI bus >> + */ >> +struct rte_pci_bus { >> + struct rte_bus bus; /**< Inherit the generic class */ >> + struct rte_pci_device_list device_list; /**< List of PCI devices */ >> + struct rte_pci_driver_list driver_list; /**< List of PCI drivers */ > > Why bus device/driver lists moved from rte_bus? Each bus will need this? > Is it to change as less code as possible? Yes, to move towards a minimal change. Also, in sync with existing 'pci_device_list/pci_driver_list'. > > <...> > >> + >> +/** >> + * Insert a PCI device in the PCI Bus at a particular location in the device >> + * list. It also updates the PCI Bus reference of the new devices to be >> + * inserted. > > Minor issue in document compilation: > > - warning: argument 'pci_dev' of command @param is not found > > - parameter 'new_pci_dev' not documented > > Similar warnings exists for rte_eal_pci_remove_device() too. > > Also following in rte_bus_scan(void) and rte_bus_probe(void) > - warning: argument 'void' of command @param is not found I will fix and post v7 very shortly. > >> + * >> + * @param exist_pci_dev >> + * Existing PCI device in PCI Bus >> + * @param pci_dev >> + * PCI device to be added before exist_pci_dev >> + * @return void >> + */ >> +void rte_eal_pci_insert_device(struct rte_pci_device *exist_pci_dev, >> + struct rte_pci_device *new_pci_dev); >> + > > <...> > >