From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0073.outbound.protection.outlook.com [104.47.33.73]) by dpdk.org (Postfix) with ESMTP id 55F0A2C37 for ; Fri, 6 Jan 2017 11:27:56 +0100 (CET) Received: from BN3PR0301CA0065.namprd03.prod.outlook.com (10.160.152.161) 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.817.10; Fri, 6 Jan 2017 10:27:55 +0000 Received: from BY2FFO11OLC012.protection.gbl (2a01:111:f400:7c0c::105) by BN3PR0301CA0065.outlook.office365.com (2a01:111:e400:401e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Fri, 6 Jan 2017 10:27:55 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11OLC012.mail.protection.outlook.com (10.1.15.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Fri, 6 Jan 2017 10:27:54 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v06ARpaw007167; Fri, 6 Jan 2017 03:27:52 -0700 To: Thomas Monjalon References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-2-git-send-email-shreyansh.jain@nxp.com> <12579803.ZHBMo4GdSA@xps13> CC: , From: Shreyansh Jain Message-ID: Date: Fri, 6 Jan 2017 16:01:24 +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: <12579803.ZHBMo4GdSA@xps13> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131281720744940236; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39450400003)(39850400002)(39380400002)(39860400002)(39400400002)(39840400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(377424004)(24454002)(199003)(57704003)(189002)(76104003)(377454003)(4001150100001)(6306002)(2906002)(356003)(31686004)(31696002)(105606002)(626004)(305945005)(50986999)(76176999)(4326007)(15395725005)(92566002)(104016004)(23746002)(86362001)(97736004)(33646002)(93886004)(230700001)(77096006)(8676002)(47776003)(38730400001)(2950100002)(65826007)(36756003)(65956001)(6916009)(85426001)(189998001)(68736007)(54906002)(81166006)(5660300001)(50466002)(106466001)(65806001)(69596002)(83506001)(229853002)(8936002)(54356999)(64126003)(81156014)(4001350100001)(110136003)(6666003)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2475; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC012; 1:XLVI/JDAzl8fU8ErcU5iERiLRmbEXHu/tal17DUZ0CeaV/J7ZseWkWATGnJ83IIy+lA7EV+rpztD/j6FJJQM6AWH3MrfLobU0+qYCiX4qNiPOOhXaU8TXKNBXRxHzksyYS4IcNDBAHVoEhoP5KXvWpmLmUEmCLtuufbyiy2QbD5b/8ljLp2bvDk3TvoaMZ7TCQAK8FemNIkj1t/jc4jzegkSBT1DmahlFy0m4AJqw5UT9825tZ7ZKHaf17xLLlP+QjBSJ1aVTaq8JcQWfMkPX9pDgM6TGT8svGf6UbBCY2vQ5OcAbER+gHZ2D4X9nILaKMe3Y+sxQylBF9t1pc2M+ibpWvXnh00a5SCIR1HPAQxJQl3cpY0cJfxCrpuyGLY35ehdj3oROJ1Kn9UoxGbEM1Bvx4PsiW5Z42LljPSGkk61U05pd1yMHwSd1qAfem4ccipA9elWyQOPmJQTzlIjlYjYwkbwS/YZFw53ECIH0NomQO8wb/HcZlWjd5xrrnohXQEdxeBuo3999aAtrMbYVEZ6wh8eBLxLy4OdSEn/o+65mkcK25qdZY0Mfwyqd5H6 X-MS-Office365-Filtering-Correlation-Id: 74a8a48f-e8d3-4824-080c-08d4361eace5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2475; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 3:vqOB1uoYedoTIdgAqfMkz7MMiLkB459dbdpCHBoyQ13WpVefWxJUmjAs8mIsxZ9QgKL14Z5g8M0QcmqnjBJjvbKcfmlJODYGaVSZoE3mb+KseEJsC27tiqvnPdaNmW28ztnejamTT+X0jYlYjFrv4MFhJkm5QDVX4I0lbNac0Kzx7VXH1eGJOLrml45UHcccGwp4GF74GWIQ8q7qSmQnZ16dNsjKAREL5FJlNz1zeLdtXwVg4FBvA9cK6cz+bV2CjamgoNquWJw2TJdzsWHFQbjRPBb6hpAXYGNnJn/L7ElCgi8V9o8dF7VOyLLRq74fmSRUVv5sdfPk5zdbD7K/KMiUjfXtJ8EBgnkgJkCq6WuKWl+5fhk8f8rbU3cUijnU; 25:BzXsPKNHECeY+FaLpoazaanb6vRmuaaMQlfrEEuT5ZhLjt8ve8gQODdM3x0lWn49zGEPfVxJ3krAl5+QNi73tDXhjdiv+ZrK4QL2TzoUXRqhIQVbS4CX+BRmPY7s28LVpxcLcL8w7WKw9xaCr4UIVKSJ+XGIssp8nt4h4y1Q7yjUmWrMk/VQmkydy7/QL5TseJfomyWC6b8ZTKZRTyijD4objIiMtC8g7EjX5wE9jmfisL6NU7Nq5oEhSudfJQylLtVwnFlY0Ca8OX191bCKQa0yFTrNNFOpzTX/EMKNjKP+ct7+fVY5i8eKQQtzyqFIEibPwVz0MC8aUXULe63Mw370SwGpK4Mzf6CRTBfpyFahAw8l53RHdVSgb7wLv67GRbaq0/Rhk/39A2YM51fM5Sx2j0lnv5kYzOfScGCSidAiK521g6YkPP4p1+7yfE2ZRp7fFdist03UrQMUJK1iaw== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 31:kNjLZB3k7cQWlV89d4MB7TyJ/ZRg1V0/sJue7UHYiAFRmA3hIlXrHPYQkBimR6ORRb+Gyo2cohd1T5Yio8BQ3FC8ay6HzmSI9/KCpXRv2+EZOrvOvaCBf9t/mYelsN/wPUbL2zIi3VOYWCjmmXV8JtdIE0JZPGKezuQQ4jFEVyiLiA/HA+LAlf142AV7d9/Nw5+Mhwg5QQeIGYpiOd2FWkewGt1lq+FNrIJ+aUXQtg/ysNm76UfGwo0JnOz1NDNsWPinwZ6j5MulYGoiZ4MLZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13024025)(13023025)(13015025)(13017025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(20161123559025)(20161123561025)(20161123565025); SRVR:DM5PR03MB2475; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2475; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 4:Qs6aP4+H0N59U6t2+ieuphe9c/xkOfXPcJ8qyecjKiwWRAJtPWl9uA8lFIdTvZ3cuHZY1Nn5lXSAh3C0nyU4D7eefuzaGN7W/2DQtouypVySuijXhTpyo1BF5O49levro8o0RM7h68yh3uHOaoQsSJMwVawfZjDjLy/J3N/Eu2CJDSa+DXR2og2Cp+ATLD3TAHZ1vf8bdYZrz7+wx+fLyx0mEUEWaRf2z/1A7MXt/67VHHy5V8b0DbM/eE6SEYm33ylhXmI+y7vqYvrOh7VFsgCXEOeaWpqPCT1v/sHxAo2lzOim9tES7s/4hpqjttoMdDxSEiKemAgtmosw7HM6KPD3/0n4AZt0ITWcSh/2qI3ZqgSsX9ZrVS74B+a9ygfTZ6qP/Tnvo28cSv61kcuoMwTWHVjkkGo5+GVmGwfu9REhJWdm4k5oJ8e+AbBnSzWxxlRzNTxHJhabObrbSJ7byzXusEbebCR5G++HswiOAfTwKqjo70ujkHp7Gq8BvtLxfDQ4q1krxz+nYLkIbVBfPSc5znQgU1qvlYziKguPjyUHlVuVki2A9vLdwJMuTM0eE+CsSMLP2qJUc2nW49rLCr7xptCAGmCTEbtG3pMi+p/h5AijswczrP9kcC1VR3+e3jgxuc/7M0PxDYry+78DygvJs3JuBNsjDroV8cUxiaRcGnEUcnf8mVnti7noCdWsGIoG6HuwEmDa2cvAS5j3Ug== X-Forefront-PRVS: 01792087B6 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR03MB2475; 23:ikHbG94CMyHz0o4yLf8L+fAOZIWVgZVK35SNy?= =?Windows-1252?Q?vbOzG8+z4m6gqbWrtOw3EfUgFadPfFUo0ZAiegMsA4Y/hmJvFKA2+fJx?= =?Windows-1252?Q?G/qeu3QaNQfEYQllWQeZ3xYqtt0fJiHWF/ehUYn+hwhOhUomHN9L973m?= =?Windows-1252?Q?G6IZby8K8LaB+e9uaaG+tvFHgFdOsivf9VqAvfe2JUyR3DM8qrj/5V63?= =?Windows-1252?Q?ORx0F955GfDF7mGTMC/xny6Uu48E3Kl5HcXOOjCuiNXG7omui7dG5L4l?= =?Windows-1252?Q?g4O9yHAFvK6mX+bl1kmDGIGvYOlbIZIv3sXjkE8/r4/M5m5nwaD3DSxa?= =?Windows-1252?Q?S+04OA/0tu6XsjlE4s3IjFwVe5sxSRigqq6BWBXM9b6dXGuAtT/J6Etq?= =?Windows-1252?Q?hHVCFnQcnl+v2Q7QRnketgyZ9ROTXvzHZES8TfWIaW2dlIKgIsIWrNZ5?= =?Windows-1252?Q?rdihGujetYIvcKVW7Zjj3oIARTmOMGTJyDFDOICuN8WVcuuzoZzylW4S?= =?Windows-1252?Q?CgItmlzSM7uv5hdaOf4caMPUxj5m10w/B+wgen5K7q5lFf57ms8QTNuX?= =?Windows-1252?Q?roqqt5ju7S5WJvmg6pKlIjiH5qf+dRmYfXPB/mHyjIinSZKnPef3ecWn?= =?Windows-1252?Q?90TuFZqHlVf0YEowuyPj6KF6O/yNjSjpICAFkTZlln0Z9sXHHOsX+2iC?= =?Windows-1252?Q?iNIzQXZ7Ua3P3aMxX67OvQb+pRvM98r2ShFqnPVm9p3IoUuT9NiMqeBa?= =?Windows-1252?Q?4QCRPwA6Utn9ioMJVpp3jyle0Rj55yAihyuQ40aKpZJ36xv0czb90hL+?= =?Windows-1252?Q?FOSwPRkMjzv7o5l20cqXemJIQQURz2i7+lYNHZHHZMlP87fknZANXk/8?= =?Windows-1252?Q?8IC8HyuEVWwwCGqAZbJDiFqdLru+YtCDrhqFXRyKub3HueZ8mz9ON8DC?= =?Windows-1252?Q?+MA72JBeUmWZFcQK3sgAEKiKOE+pToUfqZffxw/QOFG18yvewL4BAE6k?= =?Windows-1252?Q?b3mZ1MZRf1t5Dltvz+NiU8JHMQ8PYFa8Z3xc4wSNplK1XgzwostOauwo?= =?Windows-1252?Q?o9Xw+4IADTl57rRiXQIylKqZndGDh4YgTgsGsg6iTeRwiO3lWDZqj/6f?= =?Windows-1252?Q?5RBeokFAEnIBbSYP56DVKCy1S4tLQPL5amjgsFhBzZWSsx3apPZq0wCZ?= =?Windows-1252?Q?sXNnO3008vHIVnleddfAXUrs6DOI7qa40J6uBDuGt4Wlits1EwNPm07e?= =?Windows-1252?Q?rb10EZm/5mz/13zsQdTsP7HSJfhcui1D/C33OFet2o9wy7Eu7IZ2uhnw?= =?Windows-1252?Q?WsXteYPnFfTBwS/IoSBTl4jGzSaGtLi//FV0+OtrsfU4EHYilk36zfCd?= =?Windows-1252?Q?+ax2hIvfPON4/tDlqVkrCMRbizalEwxYTaqGHTGx9oZbtTtNIFG2+YCz?= =?Windows-1252?Q?W7bbyuc/bdzSvHTRLRu6StESC9S/4S0X26jgIhpQoOlcH/lLrjleymXE?= =?Windows-1252?Q?UpvCnnm/0C2AyLkTSiAkOu0S+AfVIfWgRTR/Rsv+1COh38xV4L9QwTSV?= =?Windows-1252?Q?9xlG3yM+ghh6Nz2YkD2/vignOarF1/zQXaaTSSQ0SRNDZmzJC6tN5UNa?= =?Windows-1252?Q?QV95yJi1FUM/bLb0SylMVqAuiGP3EFmYVO34pvV9bNVDmy3WGGygBMdt?= =?Windows-1252?Q?irmn+OBq+YnVYgBMTHAc0BVVXnk8noU6V22UQyTpQVbutIsXPw4C4TkW?= =?Windows-1252?Q?nhccwCCXb7B+aiw/qNXqAQgezFWhQCa3P/xzsX0/awgSfuKwjg8oAnuo?= =?Windows-1252?Q?FmcqzUGcMpU/kye7q2oNAi7Sxej0/3kVv+YFIGLVSQU/MY=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 6:kSIega7QlhThlS2R7x9y/Y44txXgOY2KlzUDJYp6fimbg4MjYfmcl8BS+hOd0yB2n/LvZwOYe6pZ4W1o2P0ifBy3N/BNd2euBFF1PPC52Few9DNvVAyHtqHixRs4LKhHEIhmEqO1DKq8ZRFrTqY4XXyAvkCa4vEcs8ss7aMAXeMVwCekAt78j/FtecVPN4F/+oS6bpJc4rEFeesBTsav2a60u0JADlJjsJI3YwPpVkia5xm2BqszchCovzbxQ0L/UelA8EznBQ9pELL6BK8fyA9nBWxxJNFS9UMfmxhXuYH5xevudsBBBhEhLXjd0qX4HcZYGzl1aGkl49qe7cx3T5ytDj7d/je9y115lQHAlhBIKITnWTFWHJLGGfdDDNYKcIEP4J/AaQThhMWDWE5LMjuOJ9SPD7j2udPpWADnm2KEk+AuctQuk+fmUzmDiWj4; 5:eafcvkhNTfFpFS7zmo4noYnYphQacQltRYrN7LPK/wvYg6O04kvXGtFjVKEoYDZ/IXTJQ5J7FFInQJ62NHmYuY824wICAO655AK/JYO1EiavvG4Po4QeAbMFPi8gmFQrydlm3gNP4V3kDBgq+cgVzq7Ld5UBRwrWI3XVMV58+emLoBSPr+rqd63tzhhj2MdA; 24:JtkoifkI2U9aRaMOLWFrVHKGjNhDvEkSEENw/mQIG/urCvHFo2sHJJe4thT6rN0vA7yisAAS6vNp56uUL+s3n2VwCoGExPH/QfH3pho5umI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2475; 7:a2ilSnuXwzn0LvNyghYtJ8855nVp1XKYThc6S/eNDv1cs8p00lub0iaG/u3c1sik0zLqVN8vqILGREDYHGKqYzcr85rTD3kLb6JjmqqWTVAKckFHkPLmGfoMwyPUwA9wm7SNmY5dIZkUe9uSw8p4DfOC6Mm3xd/CNMFFMZLDcpM56lhOGPBznW7bhpBl9EGTpGUFLat/IRJd/6VYXyg4MDjScZewfbcDHIxk1/Nn8VVVDrY19zwwseR/ZGAIsPIxt4AJ03p7ko/5XmoFErhNpD9+Z6EDxNWvAqnQbwPOunFlW1UX4j8WZbcZyqC+NqmfQ21rhgXxamwzgWxt7u9+WycpGDtbosVy/pOKVtCOrVCfoUySX6sq/3SdNG43K9ezi+5hdedW0gyfpyLjdEo3aIAxhIUTjzk/bRE6yPSA6aex0ymAuwYe7FcFHun2o9q0IAXSIlKaQLpQgm6JJQfkHg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2017 10:27:54.1196 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2475 Subject: Re: [dpdk-dev] [PATCH v5 01/12] eal/bus: introduce bus abstraction 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: Fri, 06 Jan 2017 10:27:56 -0000 On Wednesday 04 January 2017 03:22 AM, Thomas Monjalon wrote: > 2016-12-26 18:53, Shreyansh Jain: >> +DPDK_17.02 { >> + global: >> + >> + rte_bus_list; >> + rte_eal_bus_add_device; >> + rte_eal_bus_add_driver; >> + rte_eal_bus_get; >> + rte_eal_bus_dump; >> + rte_eal_bus_register; >> + rte_eal_bus_insert_device; >> + rte_eal_bus_remove_device; >> + rte_eal_bus_remove_driver; >> + rte_eal_bus_unregister; > > I think the prefix can be just rte_bus_ instead of rte_eal_bus_. Ok. I will change these. I thought as these symbols are part of librte_eal/*, naming should reflect that. > >> +/** Double linked list of buses */ >> +TAILQ_HEAD(rte_bus_list, rte_bus); >> + >> +/* Global Bus list */ >> +extern struct rte_bus_list rte_bus_list; > > Why the bus list is public? I will revisit this. When I made it public, intention was that some element external to EAL (e.g. drivers/bus) might require to iterate over this list. But, as of now I don't think any such user/case exists (except test*). > >> +/** >> + * A structure describing a generic bus. >> + */ >> +struct rte_bus { >> + TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */ >> + struct rte_driver_list driver_list; >> + /**< List of all drivers on bus */ >> + struct rte_device_list device_list; >> + /**< List of all devices on bus */ >> + const char *name; /**< Name of the bus */ >> +}; > > I am not convinced we should link a generic bus to drivers and devices. > What do you think of having rte_pci_bus being a rte_bus and linking > with rte_pci_device and rte_pci_driver lists? This is different from what I had in mind. You are saying: Class: rte_bus `-> No object instantiated for this class Class: rte_pci_bus inheriting rte_bus `-> object instantiated for this class. Here, rte_bus is being treated as an abstract class which is only inherited and rte_pci_bus is the base class which is instantiated. And I was thinking: Class: rte_bus `-> Object: pci_bus (defined in */eal/eal_pci.c) Here, rte_bus is that base class which is instantiated. I agree that what you are suggesting is inline with current model: rte_device -> abstract class (no one instantiates it) `-> rte_pci_device -> Base class which inherits rte_device and is instantiated. When I choose not to create rte_pci_bus, it was because I didn't want another indirection in form of rte_bus->rte_pci_bus->object. There were no 'non-generic' bus functions which were only applicable for rte_pci_bus. Eventually, rte_pci_bus ended up being a direct inheritance of rte_bus. > > I'm thinking to something like that: > > struct rte_bus { > TAILQ_ENTRY(rte_bus) next; > const char *name; > rte_bus_scan_t scan; > rte_bus_match_t match; > }; > struct rte_pci_bus { > struct rte_bus bus; > struct rte_pci_driver_list pci_drivers; > struct rte_pci_device_list pci_devices; > }; if we go by rte_bus->rte_pci_bus->(instance of rte_pci_bus), above is fine. Though, I am in favor of rte_bus->(instance of rte_bus for PCI) because I don't see any 'non-generic' information in rte_pci_bus which can't be put in rte_bus. > >> +/** Helper for Bus registration. The constructor has higher priority than >> + * PMD constructors >> + */ >> +#define RTE_REGISTER_BUS(nm, bus) \ >> +static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \ >> +{\ >> + (bus).name = RTE_STR(nm);\ >> + rte_eal_bus_register(&bus); \ >> +} > > By removing the lists from rte_bus as suggested above, do you still need > a priority for this constructor? I think yes. Even if we have rte_pci_bus as a class, object of rte_bus should be part of Bus list *before* registration of a driver (because, driver registration searches for bus by name). (This is assuming that no global PCI/VDEV/XXX bus object is created which is directly used within all PCI specific bus operations). There was another suggestion on list which was to check for existence of bus _within_ each driver registration and create/instantiate an object in case no bus is registered. I didn't like the approach so I didn't use it. From David [1], and me [2] [1] http://dpdk.org/ml/archives/dev/2016-December/051689.html [2] http://dpdk.org/ml/archives/dev/2016-December/051698.html > >> struct rte_device { >> TAILQ_ENTRY(rte_device) next; /**< Next device */ >> + struct rte_bus *bus; /**< Device connected to this bus */ >> const struct rte_driver *driver;/**< Associated driver */ >> int numa_node; /**< NUMA node connection */ >> struct rte_devargs *devargs; /**< Device user arguments */ >> @@ -148,6 +149,7 @@ void rte_eal_device_remove(struct rte_device *dev); >> */ >> struct rte_driver { >> TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ >> + struct rte_bus *bus; /**< Bus serviced by this driver */ >> const char *name; /**< Driver name. */ >> const char *alias; /**< Driver alias. */ >> }; > > Do we need to know the bus associated to a driver in rte_driver? > Bus and driver are already associated in rte_device. > > Two reasons: 1/ A driver should be associated with a bus so that if required, all bus can be directly extracted - even when probing has not been done. 2/ device->driver would only be updated after probe. device->driver->bus would not be valid in such cases, if required. Overall, I don't have objections for rte_bus->rte_pci_bus=>object as compared to rte_bus=>PCI-object. But, I would still like to get a final confirmation of a more preferred way. Meanwhile, I will make changes to accommodate this change to save time in case rte_pci_bus class is final/preferred method. - Shreyansh