From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH v6 05/17] eal: introduce init macros Date: Thu, 28 Jul 2016 15:06:10 +0530 Message-ID: <5799D20A.4020804@nxp.com> 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> <578722DB.3030900@nxp.com> <20160714175707.43755987@jvn> <5788BF88.3060607@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Cc: , , To: Jan Viktorin Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0069.outbound.protection.outlook.com [104.47.33.69]) by dpdk.org (Postfix) with ESMTP id 69E8C37AC for ; Thu, 28 Jul 2016 11:36:35 +0200 (CEST) In-Reply-To: <5788BF88.3060607@nxp.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Jan, On Friday 15 July 2016 04:18 PM, Shreyansh jain wrote: > On Thursday 14 July 2016 09:27 PM, Jan Viktorin wrote: >> On Thu, 14 Jul 2016 10:57:55 +0530 >> Shreyansh jain wrote: >> >>> 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? >> >> Please. The time is almost gone. 18/7/2016 is the release (according >> to the roadmap)... I have to fix it in my patchset, otherwise it >> does not build (after moving the .name from rte_pci_driver to >> rte_driver). >> > > I didn't consider 18/Jul. > Please go ahead. I will continue to send v7 _without_ the above change so that your patchset doesn't break. This way you will not get blocked because of me. > Now that we have already skipped the 16.07, I will fix this in my code and release an updated version as soon as 16.07 is officially available. Is that OK? Also, I have fixed most review comments except [1]. I am still not sure of the impact of this change. So, I will publish the v7 without this and then probably a v8 in case this change has any impact. That way we can have your patchset not blocked because of this series. [1] http://dpdk.org/ml/archives/dev/2016-July/044004.html [...] - Shreyansh