[dpdk-dev] [PATCH 1/7] eal: use different constructor priorities for initcalls

Shreyansh Jain shreyansh.jain at nxp.com
Thu Feb 16 06:59:19 CET 2017


On Wednesday 15 February 2017 08:35 PM, Jan Blunck wrote:
> On Wed, Feb 15, 2017 at 3:37 PM, Shreyansh Jain <shreyansh.jain at nxp.com> wrote:
>> On Wednesday 15 February 2017 03:32 PM, Jan Blunck wrote:
>>>
>>> --- a/lib/librte_eal/common/include/rte_eal.h
>>> +++ b/lib/librte_eal/common/include/rte_eal.h
>>> @@ -258,8 +258,16 @@ static inline int rte_gettid(void)
>>>         return RTE_PER_LCORE(_thread_id);
>>>  }
>>>
>>> -#define RTE_INIT(func) \
>>> -static void __attribute__((constructor, used)) func(void)
>>> +#define RTE_EAL_INIT(func) \
>>> +static void __attribute__((constructor(101), used)) func(void)
>>> +
>>> +#define RTE_POST_EAL_INIT(func) \
>>> +static void __attribute__((constructor(102), used)) func(void)
>>> +
>>> +#define RTE_DEV_INIT(func) \
>>> +static void __attribute__((constructor(103), used)) func(void)
>>
>>
>> Shouldn't we simply allow this priority to be default to allow for some
>> priority space between buses and default init?
>>
>
> The absolute numbers are not that important. We can always adjust
> them. Important is the relative order. If you have a use-case for
> something that needs to be initialized before the devices but can't
> get initialized with the eal/post-eal then please speak up.
>

No use-case as of now.


More information about the dev mailing list