[dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath selection
Pavan Nikhilesh Bhagavatula
pbhagavatula at marvell.com
Tue Apr 23 11:12:42 CEST 2019
>From: dev <dev-bounces at dpdk.org> On Behalf Of Thomas Monjalon
>Sent: Tuesday, April 23, 2019 2:05 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula at marvell.com>
>Cc: dev at dpdk.org; Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Marko
>Kovacevic <marko.kovacevic at intel.com>; Ori Kam <orika at mellanox.com>;
>Bruce Richardson <bruce.richardson at intel.com>; Pablo de Lara
><pablo.de.lara.guarch at intel.com>; Radu Nicolau <radu.nicolau at intel.com>;
>Akhil Goyal <akhil.goyal at nxp.com>; Tomasz Kantecki
><tomasz.kantecki at intel.com>; stable at dpdk.org
>Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath
>23/04/2019 04:47, Pavan Nikhilesh Bhagavatula:
>>From: Thomas Monjalon <thomas at monjalon.net>
>> >10/04/2019 09:29, Pavan Nikhilesh Bhagavatula:
>> >> From: Pavan Nikhilesh <pbhagavatula at marvell.com>
>> >> Currently, l3wfd em mode has two datapath modes em_sequential and
>> >> em_hlm. We can select either of them by defining
>> >> to one or zero.
>> >> The code checks if NO_HASH_MULTI_LOOKUP is defined or not instead
>> >> of checking for the value.
>> >> Fixes: 52c97adc1f0f ("examples/l3fwd: fix exact match performance")
>> >> Cc: stable at dpdk.org
>> >> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
>> >> ---
>> >> --- a/examples/l3fwd/l3fwd_em.c
>> >> +++ b/examples/l3fwd/l3fwd_em.c
>> >> #if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
>> >> defined(NO_HASH_MULTI_LOOKUP)
>> >> +#if NO_HASH_MULTI_LOOKUP
>> >A quick grep shows that it used in another place with #ifdef:
>> >examples/l3fwd/l3fwd.h:#if !defined(NO_HASH_MULTI_LOOKUP) &&
>> #if !defined(NO_HASH_MULTI_LOOKUP) &&
>> defined(RTE_MACHINE_CPUFLAG_NEON) #define
>> This macro is used to set l3fwd_em_sequential as the default EM
>> datapath on AARCH64 as its performance is better.
>> make -C examples/l3fwd #Selects l3fwd_em_sequential by default on
>> Currently, we cannot select em_hlm without manually editing the macro
>> as using the below command still sets em_sequential as the default
>> datapath because the macro modified in the patch that selects the datapath
>checks if NO_HASH_MULTI_LOOKUP is defined or not rather than its value.
>> EXTRA_CFLAGS='-DNO_HASH_MULTI_LOOKUP=0' make -C examples/l3fwd
>> I hope I cleared up things a bit.
>In my understanding, we should check the value in the other case too, instead
>of #if defined.
That will lead to undefined and redefined error:
[dpdk] # make -C examples/l3fwd
make: Entering directory '/root/pavan/dpdk-int/examples/l3fwd'
In file included from /root/dpdk/examples/l3fwd/l3fwd_lpm.c:28:0:
/root/dpdk/examples/l3fwd/l3fwd.h:14:6: error: "NO_HASH_MULTI_LOOKUP" is not defined, evaluates to 0 [-Werror=undef]
#if !NO_HASH_MULTI_LOOKUP && defined(RTE_MACHINE_CPUFLAG_NEON)
[dpdk] # EXTRA_CFLAGS='-DNO_HASH_MULTI_LOOKUP=0' make -C examples/l3fwd
make: Entering directory '/root/dpdk/examples/l3fwd'
CC main.o ]
#define NO_HASH_MULTI_LOOKUP 1
n file included from /root/dpdk/examples/l3fwd/l3fwd_lpm.c:28:0:
#define NO_HASH_MULTI_LOOKUP 1is the location of the previous definition
More information about the dev