From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0076.outbound.protection.outlook.com [104.47.40.76]) by dpdk.org (Postfix) with ESMTP id BA9062BA2 for ; Thu, 14 Jul 2016 07:27:25 +0200 (CEST) Received: from DM2PR03CA0026.namprd03.prod.outlook.com (10.141.96.25) by CY4PR03MB2503.namprd03.prod.outlook.com (10.168.165.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Thu, 14 Jul 2016 05:27:23 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::143) by DM2PR03CA0026.outlook.office365.com (2a01:111:e400:2428::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.539.14 via Frontend Transport; Thu, 14 Jul 2016 05:27:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; rehivetech.com; dkim=none (message not signed) header.d=none;rehivetech.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 BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Thu, 14 Jul 2016 05:27:21 +0000 Received: from [10.232.14.199] (Tophie.ap.freescale.net [10.232.14.199]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6E5RHdg009868; Wed, 13 Jul 2016 22:27:18 -0700 To: Jan Viktorin References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-6-git-send-email-shreyansh.jain@nxp.com> <20160713112043.2fd847ca@jvn> <20160713193430.65b6df9c@jvn> CC: , , From: Shreyansh jain Message-ID: <578722DB.3030900@nxp.com> Date: Thu, 14 Jul 2016 10:57:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160713193430.65b6df9c@jvn> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131129476428533327; (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)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(377454003)(24454002)(230700001)(97736004)(86362001)(92566002)(586003)(305945005)(4326007)(85426001)(8676002)(6806005)(81166006)(81156014)(104016004)(65816999)(110136002)(64126003)(106466001)(77096005)(87936001)(2906002)(2950100001)(8936002)(54356999)(87266999)(76176999)(33656002)(50986999)(4001350100001)(83506001)(99136001)(93886004)(105606002)(19580395003)(23746002)(356003)(47776003)(7846002)(36756003)(59896002)(65806001)(80316001)(65956001)(19580405001)(50466002)(68736007)(11100500001)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2503; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD046; 1:RaM5ouZvoFkROOjJp0gVFIEpYbf1JTPbImkxdTTVdQJP2G8Bh4TZ+/fV+ugD2p4FJVeq7ikR2GUppliu1THIV683MC5KJwIh4L8lyk5FKgKZSgQHXUhShf+yuyuMDOL1oaW7NAy8JBIlK04o041D4OHcaXZNleLNd0vxpsIXG/LPlvLbGwPcqrqJiWn7GzaxP/yzXxubpzPLdXnPdIJBc1LEXSPPUbKO0Zrd3odUtksmKnVG9QzI1f/CIdIhiNN6VB1WXohl8+BkU92+Y03J5aDFvQhuN600zi2f9V1txbxuKZqe3UvPAJbVKo68loHF2Rfzl8lwVV7jMSqwAmu5loar2RS6Fk+oBrZsgXcSApUaJHfH2SfR4+AsZGQX+pcH0axjTvUuXmxo0yjj0zmz4W0D9ZJOhbDHB0KvNQcZbcZU4Gy/GBWVuFujYMZFyPY+WBZawy83IUFgMX+DYYPpUzovmRZlHg4AC34O/69lgWgLyc0eK9nPFYXio1+seSI0HpATpJEHjzH5uNzao5gsqaTP5OAY3C7k0+ms9OPwuThdYeAD/Govi7J90oPn6kxYAsJSHMnaPH68/pYakHTaLA== X-MS-Office365-Filtering-Correlation-Id: d5da2427-f7bd-407d-0e4f-08d3aba78892 X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2503; 2:zqX2mWh8lSG/epfm6xN5hVia3eAjbomIydInAzEmLRdfgSaEeWBA238sJH/ja+/bCO1WlDAinP5d05HextM38uqlrqtpO9H6FSJvDzWIwb4xWAKjX0yZp+uDoIJ6sgIhVq/LbxQNgqg9xZYGBycsl2/WzKm/Juff8yIoeEb5bw9AhT4J1dOmFzNdp+wVp2DG; 3:YMNLZtTOqTLPAYUHoUEWz3VXN0BpLNeLi41EaYT4kRol5L8hQLwQ5ruo9R75BPuCbN/sW8co0cwsh0v0JYQukn6iBmlFa1ZvsVPryixsDwGTyj8421A/CP7rgYjP1RswlL5g92P1qVAf6y2Dy1hYFaOQDKV4sMWPmCCJGufwRmp1cHK3JweLpgnhu2Dq8I3g9imwCZi2/32OPh0Pi9Iji/lNqPgxvd6VWdgAU76vogk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2503; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2503; 25:9/UOOhHug8+Z70rWRQlSDXdpZqVChmFqTb0pFAvgF0VlDNiUtQwwWhniQ8csSullNmrqL5f800IcUnFMaD4Mrl0viyXKrN532LcaRjrEuTvqZ4ex3bp3aCKeZa1n9uoA4ubVZ4URR02ALnv64QTsSYdZaPOn+UeLb6yL1OUv/XlTdhEFXC76Qlx59+7/uOcfTBdSSc5dMMqDE/JV7xNiPcz0emBRgJkZnBGSn7vjzb2s7D+Q+EgB7xE0S1uBTm4PYm7AXWuD6RH3eFdosveFo1gFaSXknSmAHSBIScfNx6ECPc7Ip/kUosk8orw/ebwL0IMh8PSXENI06q1PDzeny12sFLtFPVwgV+BNeaoClOcEbU4ZRj6ohsHXXG1p2bU3YkptIW7BCsbZKwUE4QflTHhJ6hvXXIlTCsVFRo0Xys+E4lu2PfkPqElA/ws8HXO+953SwZEZUffE7K53X5MTlyTMRI2J6m4O7KgTUfNESwrGQjTS3ypgk015aI7EpRcUEdLX5MjIuUdPXQoH1In2jE5XkWgTloxJ1DMwaoVE92JEaxXiGf5W8o8twCG7yiZ74sX9xzUSsfnucaY+w3AjDBMKK60vQIwbTRNESKCy7aJ+xNpovTXA4jDMNZxc+mCQ65bsLyfk6LQL49M53RCFGH0PATyD1cnYjM3+n2bExmKSZtDnE4PyNd8REEAC7X1olExi61ZIrWg22MVEoxJ+SA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(5005006)(8121501046)(13015025)(13018025)(13024025)(3002001)(10201501046)(6055026); SRVR:CY4PR03MB2503; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2503; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2503; 4:DUf+E0s5vhiCF9ngk6sQWsfkkymPGuguQBxal028/qcREGnUwjkdllVXRPLk4HNNrOX4TwGfldHdPe2jyDT4rHchQvEMPgMDBKY42rsIP946zgGwk3Y1lQilN2DeGSuWqtx94p74PQTuJYaqDPHXUIjrL/6cSkG1ZuChzXXvBBM5BPm8sgkXOlG1rNaXeyXRpOSx39ijByTkrgqo2JN6N4uf2sKBDlPi0f7JoZ9ZS79MKRvrfcxXT/6jqT+cu4j3j9pyvzYB82zSsyJG8B4PV167hVOiBrpwP9dpI+Y5c55RNhcKbYOdg5tho1GlbEZv5JYRnPvOPdzaPRSjjHqUVcNdWM4Mg9UCVeuSyQkXyHYWOgpgMC9o5f3W7xTwA8/er7usCbZobHp0WLgaHX8awmGimUJzY8ekt9eDUufVqnf/5yeTbDr4joh1NtwOjcYZBUytjGAHNkt9EqYQIxhK4qW3kD7zNLikJ5inUd3MCwLHystRWS3WjIQ6StZ9n4rIdWx9+AjynWyJkmtpkLDjcQ== X-Forefront-PRVS: 00032065B2 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB2503; 23:k6hi/phrqyg7KM3sFqUaNyPHVwnLrkP7MOSXc?= =?Windows-1252?Q?lySbkmoSdHT63jJ/xMFHZ9kbY/RjIrL7LQPO4s9yVfIW4ezPN9fcw6fQ?= =?Windows-1252?Q?83TssmZeZJ0oio/d4XXonMat2byxvGSi7b6UIaF0WAWOd2TZ071LKNUx?= =?Windows-1252?Q?CnKAXLuswuXJuBtLQ/rAtMyEfEohmDRufyEAATy60fqvfNlJ0Vk62AGn?= =?Windows-1252?Q?PgJaUagJA+M6XC4SbXIQ5hInmU4i/mv/pStkJ+0tm9TFasUQLMv5Ys/R?= =?Windows-1252?Q?6ksixpPGGtEev4gUkFYWFLr3AwRGb5HUIoAOWSP2iYB2K+3OaqFj6Q7d?= =?Windows-1252?Q?baD8mMuBkK3AgSfUNjvcl/tbHiiqGGUzYxAxMJpMOMNaBN6xF+QasTAV?= =?Windows-1252?Q?0HHB6+tWzpY2P48ZPLkCORqouG7hktTXT/RSSkAMgVR18PxBfGTee20c?= =?Windows-1252?Q?MAuJ7g++mqAixyHNSlw9fyGXdEBSH+RjyEFFqNSiiG5QTuORMtO09spw?= =?Windows-1252?Q?hWZ+P9PryWkd1UhdyIOI/XqFY/iru2B0p4F+AKMCczXGyaAXvgrAvYTT?= =?Windows-1252?Q?VDjSpiGOfOFh9SSHrTg2YiQTAkHzHc9jIMF0RhEV9x10/RKg4wKLUrmX?= =?Windows-1252?Q?uTaC7pVVScmxEOUrHZ5MbgxOxqU2g6BET6/ui/1xECEzfFQrkwZ8a0ab?= =?Windows-1252?Q?zeU+VcW3x6uj0duiBQenoSX9n2Gv4Wsiqe2GJPfIBmcWQoCMR5+KaAjb?= =?Windows-1252?Q?t26Nw132DACkMjUlhM5nf+tOv3QxBqCZ7e5MEoo/od2RTJISTlaovmof?= =?Windows-1252?Q?/5Dr1ruqGDb9FajYWWsO1IhfwGAtsHsHPoDeFpOe1vz2yZpFiCxcnFr4?= =?Windows-1252?Q?0pjg+zMq0Zfc1hiaAJYFqRuc4F4bPcUcaTAJU4W1R/c9uI/wL/6TQRra?= =?Windows-1252?Q?HSvQijH0QqX5g7CPEn1xR3cFPuzls8CFG4PARjtRatJSmHaizDS+uuo1?= =?Windows-1252?Q?QBa3PWFRsqN+MyAvdcOPrjrTfcMa+Hd79vY7z8XXpE8as4OB4wdaXsvp?= =?Windows-1252?Q?W8UvIX7ffYzFp+CArP6F/C3wwye5LfUn/P3nFJ6Fhra1nz9qN3pvG1QV?= =?Windows-1252?Q?ExLqoM6HXeFei+4pxr3ShO95za0wPI8zgKj80ks52xgAzCeKRfjLYJkI?= =?Windows-1252?Q?GjMnQi8MYT9KFURjHa7BkYdo6+xHTqcsxf00k2JxX60tgt6NDkshXcG3?= =?Windows-1252?Q?OIIQjWoNuNZPzw8rsA1sMN3x0NTtSjHSMYMEup8zvZYPvZFY+13WhCEr?= =?Windows-1252?Q?cIFHwjwN2cFUOEd6kW08GRT7PqQnC31AngEcxYyj8v3bmAYXxJxJTFVr?= =?Windows-1252?Q?KGeJWRHNRpwtWehSDqtVGf12Ylf9yR3SOW2Y3ZDcRI0m/Frdh2n5cAZ2?= =?Windows-1252?Q?tyw7By/mITkTtkbd6ssFWv4s/ZmyDnZbhpfoWbZFA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2503; 6:f4vpKQfOktUwMZse3C472mfjq8/wlhPI38Zhb3P4/tQKAtQrYdjI/zvok6ZEP7YXNn6oPOwjuyZcepjMvzoFACRIopA1vq/SwE8yRBVEJghpXu3DjtP9iNPrfDbW60VOn4XH3muRmQfr16AukoBSQjeib63H8unSevZh9zgoNhD5ir7qa6hq6qtMRWPlUhJ6qZN7FyeNJ/pmiZXSJxqqVPIof4pR3jXZiS+wc+4iMpxYrwuhT2poBPBq6GTIDHGu8SldSH4jUaAXoRgzStI2t6yFKC8PukjweUAWdY8eZ3E=; 5:UgqXqdeq7eseAAaLpe4/1amip7Zn7qEPuh02K6VypDGGkjV58NbUkP3MtUlWZa9kvynx0A2fevR885o/33xpiww18yQ8cVZLHbxG6gQ4q8EH2WseloTDvyCmCTon0B47D8UvVsJ9QzeSZEvB7CEtrvNXC4UQkFjNvjZfaYpd0dk=; 24:M03PUWZdLJAe10JLqYunl2xXIt+rSOfs9m5SMuJKFF/jcblUe6yPqxeopMiqnp79a50CQtgVE2MerRriQ1jhxeVLZ/7bNQss33sLbI+HHTo=; 7:tWrQl+bOfmHeoRk/3blCYCpvCGmXlINVfGA6rgSJnyxcU8dcOzUMHj12IVVcHOS90dV82Iv8nTypoUVlcRZ/AUcRP3JuyuZ9fgeglGvYmLIfV2zuvPHecNXk+u4HNvwoQbj/6j4uMmDk4bymfcyylJPt3tY8V8IvurJ31sBb31/aUlGPzvNt3FHBz1/RPdvwq93S51Sjc4A/jOpJWsLwNJlBIW50MD9D3RRvQP4962iFx4ekyPBMvNuANYwKCLGY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2016 05:27:21.3089 (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: CY4PR03MB2503 Subject: Re: [dpdk-dev] [PATCH v6 05/17] eal: introduce init macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 05:27:26 -0000 Hi Jan, On Wednesday 13 July 2016 11:04 PM, Jan Viktorin wrote: > On Wed, 13 Jul 2016 11:20:43 +0200 > Jan Viktorin wrote: > >> Hello Shreyansh, >> >> On Tue, 12 Jul 2016 11:31:10 +0530 >> Shreyansh Jain wrote: >> >>> Introduce a RTE_INIT macro used to mark an init function as a constructor. >>> Current eal macros have been converted to use this (no functional impact). >>> DRIVER_REGISTER_PCI is added as a helper for pci drivers. >>> >>> Suggested-by: Jan Viktorin >>> Signed-off-by: David Marchand >>> Signed-off-by: Shreyansh Jain >>> --- >> >> [...] >> >>> +#define RTE_INIT(func) \ >>> +static void __attribute__((constructor, used)) func(void) >>> + >>> #ifdef __cplusplus >>> } >>> #endif >>> diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h >>> index fa74962..3027adf 100644 >>> --- a/lib/librte_eal/common/include/rte_pci.h >>> +++ b/lib/librte_eal/common/include/rte_pci.h >>> @@ -470,6 +470,14 @@ void rte_eal_pci_dump(FILE *f); >>> */ >>> void rte_eal_pci_register(struct rte_pci_driver *driver); >>> >>> +/** Helper for PCI device registeration from driver (eth, crypto) instance */ >>> +#define DRIVER_REGISTER_PCI(nm, drv) \ >>> +RTE_INIT(pciinitfn_ ##nm); \ >>> +static void pciinitfn_ ##nm(void) \ >>> +{ \ >> >> You are missing setting the name here like PMD_REGISTER_DRIVER does >> now. Or should I include it in my patch set? >> >> (drv).name = RTE_STR(nm); That is a miss from my side. I will publish v7 with this. You want this right away or should I wait a little while (more reviews, or any pending additions as per Thomas's notes) before publishing? > > Moreover, it should accept the rte_pci_driver *, shouldn't it? Here, it > expects a wrapper around it (eth_driver)... I now, my SoC patches were > supposing the some... but I think it is wrong. > > The original David's patch set contains calls like this: > > RTE_EAL_PCI_REGISTER(bnx2xvf, rte_bnx2xvf_pmd.pci_drv); > > So, I think, we should go the original way. I have a slightly different opinion of the above. IMO, aim of the helpers is to hide the PCI details and continue to make driver consider itself as a generic ETH driver. In that case, dereferencing pci_drv would be done by macro. Also, considering that in future pci_drv would also have soc_drv, the helpers can effectively hide the intra-structure naming of these. It would help when more such device types (would there be?) are introduced - in which case, driver framework has a consistent coding convention. But, I am ok switching back to David's way as well - I don't have any strong argument against that. > > Jan > >> >>> + rte_eal_pci_register(&drv.pci_drv); \ >>> +} >>> + >>> /** >>> * Unregister a PCI driver. >>> * [...] - Shreyansh