[dpdk-dev] spinlock: Move constructor function out of header file

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Jul 15 17:08:21 CEST 2016


2016-07-15 16:37, Thomas Monjalon:
> I will apply it with trivial changes suggested by Jan and
> the small needed changes that I describe below:
> 
> 2016-07-14 20:03, Jan Viktorin:
> > On Thu, 14 Jul 2016 15:27:29 +0200
> > damarion at cisco.com wrote:
> > > --- /dev/null
> > > +++ b/lib/librte_eal/common/arch/x86/rte_spinlock.c
> [...]
> > > +uint8_t rte_rtm_supported; /* cache the flag to avoid the overhead
> > > +			      of the rte_cpu_get_flag_enabled function */
> 
> This variable must be exported in the .map file.
> 
> > > --- a/lib/librte_eal/linuxapp/eal/Makefile
> > > +++ b/lib/librte_eal/linuxapp/eal/Makefile
> > > @@ -106,6 +106,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_keepalive.c
> > >  
> > >  # from arch dir
> > >  SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_cpuflags.c
> > > +SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_spinlock.c
> > 
> > This is not good, you provide rte_spinlock.c only for x86. Building
> > for any other arch would fail to find this file.
> 
> This change do the trick:
> 
> -SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_spinlock.c
> +SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
> 
> (Note that CONFIG_RTE_EXEC_ENV_LINUXAPP check is not needed inside linuxapp EAL)
> 
> > Moreover, the bsdapp/eal/Makefile should reflect this situation as
> > well.
> 
> Yes

Applied with above changes, thanks


More information about the dev mailing list