[dpdk-dev] [PATCH 03/15] pmd: Add PMD_REGISTER_DRIVER macro

Olivier MATZ olivier.matz at 6wind.com
Thu Apr 17 10:08:29 CEST 2014


Hi Neil,

On 04/16/2014 07:29 PM, Neil Horman wrote:
> Ok, so look it up.  DPDK is open source and cscope is easy to use.  A
> module initilization macro is a common method for doing init time binding in
> modular programming (the best examples are the module_init() and module_exit()
> macros in the linux kernel).  It wraps up what you need to do to tie a modular
> piece of your software into the larger main component, without having to know
> all the boilerplate behind it.
>
> Also, if you expose the use of the constructor, then you've
> broken out the initalization phase to every pmd you implement, and as a result,
> if you ever need to add code to the initilization step, you have to add it in
> every pmd, instead of just updating the macro.
>
> The bottom line is, your method is 5 lines of boilerplate code thats going to
> have to get repeated as nauseum for every pmd that gets written giving every PMD
> author the opportunity to miscode the constructor, vs my one line that, if it
> compiles, will be correct every time.
OK, some of your arguments are legitimate and it's a detail point of
your patches that are globally a nice improvement of the DPDK code.

But I'd be happy to continue this discussion over a beer ;)

Regards,
Olivier



More information about the dev mailing list