From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0065.outbound.protection.outlook.com [104.47.34.65]) by dpdk.org (Postfix) with ESMTP id A9DA82A58 for ; Fri, 6 Jan 2017 12:41:07 +0100 (CET) Received: from BN3PR0301CA0025.namprd03.prod.outlook.com (10.160.180.163) by MWHPR03MB2480.namprd03.prod.outlook.com (10.169.200.150) 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 11:41:04 +0000 Received: from BL2FFO11FD009.protection.gbl (2a01:111:f400:7c09::199) by BN3PR0301CA0025.outlook.office365.com (2a01:111:e400:4000::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7 via Frontend Transport; Fri, 6 Jan 2017 11:41:04 +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 BL2FFO11FD009.mail.protection.outlook.com (10.173.161.15) 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 11:41:03 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v06Bf1qx014007; Fri, 6 Jan 2017 04:41:01 -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-6-git-send-email-shreyansh.jain@nxp.com> <5088350.GnaeIEgOPh@xps13> CC: , From: Shreyansh Jain Message-ID: <7af56aaf-b4dc-4933-588d-d0c375d23844@nxp.com> Date: Fri, 6 Jan 2017 17:14:34 +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: <5088350.GnaeIEgOPh@xps13> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131281764637127360; (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)(39410400002)(39400400002)(39850400002)(39840400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(377424004)(189002)(199003)(377454003)(24454002)(4001150100001)(4326007)(8676002)(64126003)(31696002)(83506001)(50466002)(6666003)(69596002)(81156014)(81166006)(105606002)(104016004)(36756003)(2950100002)(65826007)(5660300001)(6916009)(106466001)(86362001)(65956001)(47776003)(4001350100001)(65806001)(85426001)(23746002)(230700001)(8936002)(54906002)(626004)(92566002)(31686004)(2906002)(93886004)(68736007)(38730400001)(77096006)(356003)(97736004)(305945005)(50986999)(76176999)(54356999)(189998001)(33646002)(229853002)(110136003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2480; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD009; 1:IQrHuEdYFX0/tXdZ2FlJRtQxX4h7JnGUwa43Tfl+7QLUytT7PTDuEbWjFRosUHcLlGADAnEXcPyM7o12IrtqVZpaZybV/gGSsDakZP10uZnAl0RqQ1BgIL6ChfJiuJHZNJYIw9M63SoDx3wnx+tVCAl2k8ZuuolFkXg+xnXOWrStGOwih3Zj1E0EypU+1mcoSkodZSS1O9bxYdTvEbBa4umrL60l5Z9mfhdCHH1su8eHrTYEP7OEZIem1rwLNyT14oGpQNJQwlHDIxOw9Z0rEJMMLoqUcYJJmRI1uLghtVw/PJW1xcXbop2tVoho818/KS+QuiKNgM9Yx0Wn7tJ6jcy0kiWtms0ohm5ZxWz2gXh5DIgBdzbTlALALDEHnTk8viexvYLl2LEKhPgngPeGnYmn74b3G6QexA/t3RV0LFXRC6ydVhwipIjuxOcU9aEzRGE9j5Fv6M6YCJfvxuVN+7DTYORQiM4U85/xGQJ8CwNy3tHHyfqfAuEGuynpFuUv1FtOAdD9AwbyowXTyuYJ/CWVh0dDSlkqyPimMw03fzMMBkjSZHObzSdhXqahpSRP X-MS-Office365-Filtering-Correlation-Id: 8bcf5985-b223-4642-467b-08d43628e510 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2480; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2480; 3:Q7ST+KDfYtIggsXbt8eXyiLvRpPbZ50USnL0O9K2N+1qAwJsvW5rMz/q+IHKFpoqT2rHjkDMi3JUUFmH67LThDHTAmJT6ABRF6+muNe0Tmtbrr9Z+qnfmzYVbg8ccSisWOX39O4vbYaQ5AmQmxo1P9o3uxsJqysEgXl/Odedn9wn3xxuFItKfF13HVnSdnZFbaQC5DkF8Y94xDZBbsy3mTAEw+nEaYAzehAwWy3U2sAQ9im/JBRPekopJ51MfL4YexW5+9v2rqCWcf0MgM7FqGuDvprYYtuicFUlxl5R+89TG0vZZKTZoB9x/ZY1qxfWWhGKznwsAaqxZaG6u2LxIOkJlEM+1qOl7bi3A5/g1LoF2uhdd42Um/AUrs5YS0nN; 25:b4hXb8p8cStq+CEdfTwEMl5iNUqAVw1SiKn6CWhVvatoicVgfQlRLYhzazvWuN0LtxbG3CUzON1hrZv9Q0NkMiGCyPJxKYRJgmwlOUl4YjOvZr1UAR6UDR1zgXbVo0ymH5+GHpFEC9TzBpUw0TI+FdrKNkzFAp9q0pNM1wQJxbYxbdEvC/WVEAMPH3mvg8oanltb2KRpHz5wav8WvrGbdzbMROuAS/OIS3tfHeZgxOn2H9M6cgZj0YKVy+tkUfCGEkn4x8CEKD/sMVfb55IdCyYrU8zSF57xo8XfidKO5tIPuovhehtGYDSnJsSDIMOJZxymsV9WDyI7v2CuJJsRms12jYyjwRjl+3vEIxKS0nwejMn927KNP/iGWAtpjPWugvHTixbaM2S+nRHP38CVwPCjlQcC3HnCPHkXT6Wu+4zbpKF26GBPaGCQFI/cCEiT/dCwpzPjCz8lCo+T1kpw6g== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2480; 31:kNJdBjmupiFom9ecMI5rsPXQAggvS2qY3HLfS8VYw04Pk+A3/afy4VuU+t0VBTktGqTOYH+H3IFkIKzjk0K+tJaVc0QmLM5pa/+dJr092PDTzro+u4G3gvSsWzVVglCi20rjA6Yl/BqRi4q4zikjxdv3s/D4BKJGlqsoqxBRbBMAEu2ZfULEt0Ev9OjLLFoCKJyJJh7lnrEw4H7xw5+jEMiuJ5hQCZzPRkeAWPUX7S6xExlnvn6FqoRRmhwbWUpV+axJ00mpOy/OTTQq/Tnekw== 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)(13015025)(13023025)(13017025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:MWHPR03MB2480; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2480; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2480; 4:TgzrJT/JqY+Vu5/AN4FtGMSf2IwI4q4HNYCN946MKUqnxXvh+SikL4H/E4S4YiBgkoTTPirLuZdyZOHT7F7mqMnziMHcMxqFi42QJs78Vjo5O14RX8TDxCOQWE919hDCJyUDk3tyFj/vRfn4hu9bcmkXxrZbE+0Fc3Vr1ivezAasjrzWDVAcTPIiWfuMqD5EaNp7pn9CxunAtLyRe2aCywEck7Ob3eiX/Svf5wtV0AMfG+2KiYSqvL/Tfe/v1UGqTyF1Fjj3R5jLdV0FTRYXrq3rCYQzz33E2u08PDG7+LCgLpqnst5ZBkTjgxSR7ogefGOzTWRAIfm9AGI9RdpuOgLG0nEQYkDWaXkUzrs4HYw5e0U+iREh7EDwem8Zsw65KJ0bzz97eW/PQImiysYkRADg2fgjuXCecoXL8FZJgjIftu2G5DG9smDnHzOF+B/+rnvZEwiAC/wgcwESe2tWIKVlYng9uq2xCIZAh2Szhpmnw8Vt4J84uIR9fw5ssio4nit11IB1zIkB+GARABBtpDFpr2KQC/rBnfjJJRkzO8IYL5CkOQkitUK0FR7wbK2PPURjt2UuRC9OR03aiK0FAw4pXmf/mHjSZAyU2vGwUVZNCRmSCVnqgUgg9vvBI4slntSRzecZ3Hqqy2EXeGfpbg1mACiOc8kPjqTwUpXok4L5DmFdz4cFW+ea4iBBCIDuNB6C8pXGDw061rtN1qK7Ug== X-Forefront-PRVS: 01792087B6 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB2480; 23:yVme8Q+pCkl7kyW94HevIp4rRCTyk+RjFWRBX?= =?Windows-1252?Q?Bp8aYPt+EcNwTzRE7od2in9G6xLfXjwMd6EsHaP76YftaIU7y3XXW/YX?= =?Windows-1252?Q?EiQ4MkYYEeDRJ9ElU/O/9NCl/lyeyn5/y4kiD0Bx+PXOZuRhg5H3G29A?= =?Windows-1252?Q?+rJT0+BqkeBRLCCYcdc3r7/vfolWQ9dgQHos9iXUKsGdRAgoOysqPsf6?= =?Windows-1252?Q?WxrpF5R8OfLhHgQKTS2zZxWTM1+dCaEEhcF7hhc68EUI3E0NV4Ms/RBd?= =?Windows-1252?Q?bcQ83/7SIofKjttuBq1PZE47LNQm1kDTGG/kCwwefUuTKRkWgLgygvb2?= =?Windows-1252?Q?EpDcVUbf6vrYkvFPdPBMppY81lZHjSkGqjFd+sqRX0nffxK8/RAjsBe9?= =?Windows-1252?Q?u17IX5R8EmPYkrN6Qp//eDGeSarXrvBEps87L+/7bnb/FCorWBHoE860?= =?Windows-1252?Q?Jz125+kFZAjSZj6u5Z0blWuXuzb/6UIcrnAVt4BrjhwHGwYylr0pCUtq?= =?Windows-1252?Q?tOTKuZ6fjCub2/GBVdZ3t1sae+pa0R7I+Em8aUza083mmfm99iqzs5/w?= =?Windows-1252?Q?ryZz2y10fPomTol8m/igqgjqRcBEScT4sjfBQtg0XLqTlf1KQ7M/zMFB?= =?Windows-1252?Q?TURn/ogXhsjkYavoaPvorWHCT/OHFxe23VRf4Ey+r5gVXANpCtVuFB8o?= =?Windows-1252?Q?+zeOq/248GZv4gWUjzTgLtzZUTXT8NsUuF9fRtNbvEsw3N1ehUPBLrda?= =?Windows-1252?Q?sva/Vn6GmAoqIgMRBrsDsCrbN3NwfLeF+hr9ZpwaCZjjsspvWMqhrjvc?= =?Windows-1252?Q?w3jYakOssWpg0ZDnt2Me+8a6ZQq40sEv+PvlAZT340B33m7qgUl5WQhx?= =?Windows-1252?Q?SEYAnznPqCu/EdmWSQe5CGAixlPKI7FLgz06zXR2cqm2rFIKVpzAX2NR?= =?Windows-1252?Q?92Uw090o1+8/AGe08Yapyj37B07iLoG3uqObTAuHot6Ysd8qfuyKnvHp?= =?Windows-1252?Q?mpRXOuZTVXwJt9nNg6pwpphfmp5zHWhUKLWmrMvawR6UecGHyQ7CgYIP?= =?Windows-1252?Q?6+uEATala/32kVuFeA8ayAAgD+vuP8OP9BlmL1wI33UPSxwyGddwtzFi?= =?Windows-1252?Q?Cnd6SfpSrEgZH/3atEaj2ZCXOPZq4bmXFoiEe4BdJiBKEUg2+B2D07iy?= =?Windows-1252?Q?EEE1SUFcL42QZX8ehtaoQkY8byrNkqPmShBvefU7KHage1bC4+DBRg3X?= =?Windows-1252?Q?sFoWAxhOT9kJQzmMxzNWpjuwwZO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unHJ7uJvCv2eFSP7AyMTGmCKGDVb49J0GxxhDPmTZO9AB6cHs9rJJl+XCgpgtIt9z4APCPhMcSzf7vCIR2K6MRzP+Ads/1U8uDSBfSJZRP7dDuoLBNhjc2OlVTASyYCE3Y9d4yaNBn7; 24:JoZuk5IHmUDEj6+yV9r7LVcCVLQUdUHXRqdqZxKpVjM5n6pCgavzs+VtGaWtvU/saXTIKIb7E+GiqzroojSkPs4NuKOYLy2hTA33lXb1bSY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2480; 7:ihsXz0YmfJIBucCXBC38r7eg825be5n0ZlW5VkND/iStFYUaRbTAeMZScgFXLjU5O+/BaYVrdFJxEekXobdO0JdL0KRfI/pAdyqXuNnB1kcd+sapXIY8I6IvrKxqyd6cksoankwpMZo8rn5Deeco7O4pytXBaGtyzQTU8W09fI8EOx1ePDcUq7VntoaxsdOZ3VMXP4+W+X2PF5/EHtuHmKUZLSfdYyydbegmxQ0yUoLcoJiy64YTB1gb1BZks1LvrwKVRGpL1hfUrEA4O6v983YUiThihsjSQbDAuLx/uSP3xscTX8D33Tvga//Jvqwsu5eYY1yZ8qrNi+ne5T006aq65gOZEJsPyrruFK/1xycIMrxErsafEELpjEUaZrdxyoxCZJXBkwnnU7Qe7tFiLzXVzwk4HMUwnsWbih9wqec8Ru4wGXY1xkSbXKrUYVsDoZVdbqTMXY0LxN+vAWhMoA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2017 11:41:03.3383 (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: MWHPR03MB2480 Subject: Re: [dpdk-dev] [PATCH v5 05/12] eal: add probe and remove support for rte_driver 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 11:41:08 -0000 On Wednesday 04 January 2017 03:35 AM, Thomas Monjalon wrote: > 2016-12-26 18:53, Shreyansh Jain: >> --- a/lib/librte_eal/common/include/rte_dev.h >> +++ b/lib/librte_eal/common/include/rte_dev.h >> @@ -152,6 +162,8 @@ struct rte_driver { >> struct rte_bus *bus; /**< Bus serviced by this driver */ >> const char *name; /**< Driver name. */ >> const char *alias; /**< Driver alias. */ >> + driver_probe_t *probe; /**< Probe the device */ >> + driver_remove_t *remove; /**< Remove/hotplugging the device */ >> }; > > If I understand well, this probe function does neither scan nor match. > So it could be named init. Current model is: After scanning for devices and populating bus->device_list, Bus probe does: `-> bus->match() `-> rte_driver->probe() for matched driver For PCI drivers, '.probe = rte_eal_pci_probe'. For example, igb_ethdev.c: --->8--- static struct eth_driver rte_igb_pmd = { .pci_drv = { .driver = { .probe = rte_eal_pci_probe, .remove = rte_eal_pci_remove, }, ... --->8--- > > I think the probe (init) and remove ops must be specific to the bus. > We can have them in rte_bus, and as an example, the pci implementation > would call the pci probe and remove ops of rte_pci_driver. So, --- After scanning for devices (bus->scan()): Bus probe (rte_eal_bus_probe()): `-> bus->match() `-> bus->init() - a new fn rte_bus_pci_init() -> which calls rte_eal_pci_probe() -> and rte_pci_driver->probe() and remove rte_driver probe and remove callbacks because they are now redundant. (they were added in bus patches itself) --- Is the above correct understanding of your statement? Somehow I don't remember why I didn't do this in first place - it seems to be better option than introducing a rte_driver->probe()/remove() layer. I will change it (and think again why I rejected this idea in first place). Thanks. > > Please use rte_ prefix in public headers. > I am assuming you are referring to driver_probe_t/driver_remove_t.