[dpdk-dev] [PATCH] net/ark: fix meson build

Ed Czeck ed.czeck at atomicrules.com
Thu Aug 20 17:41:37 CEST 2020


On Thu, Aug 20, 2020 at 7:16 AM Ferruh Yigit <ferruh.yigit at intel.com> wrote:
>
...
>
> Logging can be controlled in runtime, that is what we should use.
> In data path, we use compile time flags because of the performance issues. So OK
> to have 'CONFIG_RTE_LIBRTE_ARK_DEBUG_RX' & 'CONFIG_RTE_LIBRTE_ARK_DEBUG_TX' as
> compile time flag, but why having compile time flag for rest?

Agreed.  We'll remove most of these macro in the next commit pushing
the behavior
into run-time log control.

> >
> > +Note that enabling debugging options may affect system performance.
> > +These options may be set by specifying them in CFLAG
> > +environment before the meson build set.   E.g.::
> > +
> > +    export CFLAGS="-DARK_DEBUG_TRACE"
> > +    meson build
> > +
>
> When you passed the flag as above, it is still global to all components in the
> DPDK, this is not just for ark. What is the motivation to remove the
> "RET_LIBRTE_" prefix?

There are 2 issues here.
1) With the makefile flow, users could add other configurations with
the documented
and recommended sed commands.  I.e.,
sed -ri 's/(CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE)=n/\1=y/' build/.config
The makefiles took care of everything from there.  This no longer works with the
meson build flow.  The solution is to set that macro passing it in the
CFLAG environment.
We're open to other recommendations.
2) Is there an advantage of promoting a PMD macro to a global macro?
It seems to add to the noise of dpdk configuration and there are many
PMD specific macros throughout the code base.

>
> >
> >  Building DPDK
> >  -------------
> > diff --git a/drivers/net/ark/ark_logs.h b/drivers/net/ark/ark_logs.h
> > index 44aac6102..125583475 100644
> > --- a/drivers/net/ark/ark_logs.h
> > +++ b/drivers/net/ark/ark_logs.h
> > @@ -6,14 +6,12 @@
> >  #define _ARK_DEBUG_H_
> >
> >  #include <inttypes.h>
> > -#include <rte_log.h>
> > -
> >
> >  /* Configuration option to pad TX packets to 60 bytes */
> > -#ifdef RTE_LIBRTE_ARK_PAD_TX
> > -#define ARK_TX_PAD_TO_60   1
> > -#else
> > +#ifdef ARK_NOPAD_TX
> >  #define ARK_TX_PAD_TO_60   0
> > +#else
> > +#define ARK_TX_PAD_TO_60   1
> >  #endif
>
> So you don't want to convert this to runtime configuration.
>
> The point we are reducing compile time flags:
> 1) It forks the code paths and by time it leave not tested, even not compiled
> code paths which may cause rotten code by time.
>
> 2) Multiple code paths will lead deployment problems. When you deploy an
> application, you won't able to change the compile time configuration in customer
> environment and need to re-compile (most probably re-test) and re-deploy it.
> Also there is not easy way to figure out from binary in customer environment
> that with which compile time flags it has been built.
>
> Switching to CFLAGS="..." doesn't make above concerns go away and indeed it
> makes (1) worst since hides the config options within the driver. Previously it
> was possible to trigger each config option and do testing using scripts, now
> since config options are hidden in driver we can't do even that.
>
> Can you please detail why "ARK_TX_PAD_TO_60" is needed exactly?
> And can you please justify why it has to be compile time config option?
>
The need to pad packets is dependent on the underlying FPGA hardware
implementation which lies outside the control of our deliverables.  Thus we
leave control up to our customer and how they deliver and deploy DPDK.  This
needs to be a compile-time macro since the code executes within the
per-packet processing under rte_eth_tx_burst().

We can change the macro to ARK_MIN_TX_PKTLEN, which should have zero
overhead when set to 0.  (I'm assuming that compiles will remove if
(unsigned < 0) blocks.)  Should this be an RTE_LIBRTE macro?  How does
a user change this during compile?

> <...>
>
> > @@ -11,3 +11,5 @@ sources = files('ark_ddm.c',
> >       'ark_pktgen.c',
> >       'ark_rqp.c',
> >       'ark_udm.c')
> > +
> > +install_headers('ark_ext.h')
> >
>
> Installing PMD header file is not required but this has an unique usage.
>
> Ark PMD is wrapper to the external shared library which should implement the
> functions that has prototypes in the 'ark_ext.h'.
>
> Since this header is not needed by users of the dpdk library, but needed by
> extension developers for the ark PMD, I think the header should not be installed.

So is your recommendation that anyone developing an ark pmd extension
must have access to DPDK source, in addition to the installed code?
It seems like one include location is better than two.

Many thanks,
Ed.


More information about the dev mailing list