[dpdk-dev] [PATCH 09/11] examples/l3fwd: add event em main loop
stephen at networkplumber.org
Fri Sep 27 19:29:35 CEST 2019
On Thu, 26 Sep 2019 15:35:56 +0530
<pbhagavatula at marvell.com> wrote:
> +#define L3FWD_EM_EVENT_MODE \
> +EM_FP(tx_d, 0, 0, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_SINGLE) \
> +EM_FP(tx_d_burst, 0, 1, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_BURST) \
> +EM_FP(tx_q, 1, 0, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_SINGLE) \
> +EM_FP(tx_q_burst, 1, 1, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_BURST) \
> +#define EM_FP(_name, _f2, _f1, flags) \
> +int \
> +em_event_main_loop_ ## _name(__attribute__((unused)) void *dummy);
> +#undef EM_FP
Not a fan of this style of macro programming.
First off, macros should be setup not take a semi-colon at the end.
That is why checkpatch is grumbling about it.
And it is quite opaque to know the result of this template.
Why not just expand it as real code.
More information about the dev