* RE: [PATCH] config: remove explicit undef of unset values
2022-06-13 9:54 ` Bruce Richardson
@ 2022-06-13 10:01 ` Morten Brørup
2022-06-13 12:26 ` David Marchand
2022-06-13 14:46 ` Tyler Retzlaff
2 siblings, 0 replies; 9+ messages in thread
From: Morten Brørup @ 2022-06-13 10:01 UTC (permalink / raw)
To: Bruce Richardson, dev; +Cc: david.marchand, junx.dong
> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Monday, 13 June 2022 11.55
> To: dev@dpdk.org
> Cc: david.marchand@redhat.com; junx.dong@intel.com
> Subject: Re: [PATCH] config: remove explicit undef of unset values
>
> On Thu, Dec 16, 2021 at 11:14:30AM +0000, Bruce Richardson wrote:
> > Rather than explicitly clearing any setting of undefined values in
> our
> > rte_config.h file, it's better to instead just add a comment that the
> > value is not set. Using a comment allows the user to set the value
> using
> > CFLAGS or similar mechanism without the config file clearing the
> value
> > again.
> >
> > The text used "<VALUE> is not set" is modelled after the kernel
> approach
> > of doing the same thing.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >
> > Although DPDK coding convention forbids use of "//" for comments,
> using
> > regular C comment style makes the config settings less clear, as they
> can
> > be confused with regular comments in the file. Using "//" makes them
> stand
> > out better, so I prefer it. However, if others feel strongly, they
> can be
> > changed to standard.
> >
> > Note: this is a resubmission of patch [1] which was part of a
> rejected
> > series. However, the reasons for rejection - values in config being
> out
> > of sync with those used for building apps - are less relevant for
> > many, if not all, of these setting, so I believe the benefits for
> > testing outweigh the potential downsides. If any setting is likely
> > problematic, I can keep the explicit undef for that case in a new
> patch
> > version.
> >
> > [1] http://patches.dpdk.org/project/dpdk/patch/20200903144942.671870-
> 2-bruce.richardson@intel.com/
> > ---
>
> Ping for review or feedback for this patch. I'd like to see it move
> forward
> into a DPDK release if possible.
>
> /Bruce
>
> > config/rte_config.h | 14 +++++++-------
> > 1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > index cab4390a97..953216babd 100644
> > --- a/config/rte_config.h
> > +++ b/config/rte_config.h
> > @@ -83,17 +83,17 @@
> >
> > /* ip_fragmentation defines */
> > #define RTE_LIBRTE_IP_FRAG_MAX_FRAG 8
> > -#undef RTE_LIBRTE_IP_FRAG_TBL_STAT
> > +// RTE_LIBRTE_IP_FRAG_TBL_STAT is not set
> >
Yes, this is the right way to do it.
Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] config: remove explicit undef of unset values
2022-06-13 9:54 ` Bruce Richardson
2022-06-13 10:01 ` Morten Brørup
@ 2022-06-13 12:26 ` David Marchand
2022-06-13 12:37 ` Bruce Richardson
2022-06-13 14:46 ` Tyler Retzlaff
2 siblings, 1 reply; 9+ messages in thread
From: David Marchand @ 2022-06-13 12:26 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Dong, JunX, Morten Brørup, Thomas Monjalon
On Mon, Jun 13, 2022 at 11:54 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> On Thu, Dec 16, 2021 at 11:14:30AM +0000, Bruce Richardson wrote:
> > Rather than explicitly clearing any setting of undefined values in our
> > rte_config.h file, it's better to instead just add a comment that the
> > value is not set. Using a comment allows the user to set the value using
> > CFLAGS or similar mechanism without the config file clearing the value
> > again.
> >
> > The text used "<VALUE> is not set" is modelled after the kernel approach
> > of doing the same thing.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >
> > Although DPDK coding convention forbids use of "//" for comments, using
> > regular C comment style makes the config settings less clear, as they can
> > be confused with regular comments in the file. Using "//" makes them stand
> > out better, so I prefer it. However, if others feel strongly, they can be
> > changed to standard.
> >
> > Note: this is a resubmission of patch [1] which was part of a rejected
> > series. However, the reasons for rejection - values in config being out
> > of sync with those used for building apps - are less relevant for
> > many, if not all, of these setting, so I believe the benefits for
> > testing outweigh the potential downsides. If any setting is likely
> > problematic, I can keep the explicit undef for that case in a new patch
> > version.
> >
> > [1] http://patches.dpdk.org/project/dpdk/patch/20200903144942.671870-2-bruce.richardson@intel.com/
> > ---
>
> Ping for review or feedback for this patch. I'd like to see it move forward
> into a DPDK release if possible.
I'd like a check like (below), to avoid new additions:
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 34a2e43845..8dae47165e 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -158,6 +158,14 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # '// XXX is not set' must be preferred over '#undef XXX'
+ awk -v FOLDERS='config/rte_config.h' \
+ -v EXPRESSIONS='#undef' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using "#undef XXX", prefer "// XXX is not set"' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
return $res
}
Otherwise, the change lgtm.
--
David Marchand
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] config: remove explicit undef of unset values
2022-06-13 12:26 ` David Marchand
@ 2022-06-13 12:37 ` Bruce Richardson
2022-06-13 14:20 ` David Marchand
0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2022-06-13 12:37 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Dong, JunX, Morten Brørup, Thomas Monjalon
On Mon, Jun 13, 2022 at 02:26:14PM +0200, David Marchand wrote:
> On Mon, Jun 13, 2022 at 11:54 AM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > On Thu, Dec 16, 2021 at 11:14:30AM +0000, Bruce Richardson wrote:
> > > Rather than explicitly clearing any setting of undefined values in our
> > > rte_config.h file, it's better to instead just add a comment that the
> > > value is not set. Using a comment allows the user to set the value using
> > > CFLAGS or similar mechanism without the config file clearing the value
> > > again.
> > >
> > > The text used "<VALUE> is not set" is modelled after the kernel approach
> > > of doing the same thing.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > >
> > > Although DPDK coding convention forbids use of "//" for comments, using
> > > regular C comment style makes the config settings less clear, as they can
> > > be confused with regular comments in the file. Using "//" makes them stand
> > > out better, so I prefer it. However, if others feel strongly, they can be
> > > changed to standard.
> > >
> > > Note: this is a resubmission of patch [1] which was part of a rejected
> > > series. However, the reasons for rejection - values in config being out
> > > of sync with those used for building apps - are less relevant for
> > > many, if not all, of these setting, so I believe the benefits for
> > > testing outweigh the potential downsides. If any setting is likely
> > > problematic, I can keep the explicit undef for that case in a new patch
> > > version.
> > >
> > > [1] http://patches.dpdk.org/project/dpdk/patch/20200903144942.671870-2-bruce.richardson@intel.com/
> > > ---
> >
> > Ping for review or feedback for this patch. I'd like to see it move forward
> > into a DPDK release if possible.
>
> I'd like a check like (below), to avoid new additions:
>
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index 34a2e43845..8dae47165e 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -158,6 +158,14 @@ check_forbidden_additions() { # <patch>
> -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> "$1" || res=1
>
> + # '// XXX is not set' must be preferred over '#undef XXX'
> + awk -v FOLDERS='config/rte_config.h' \
> + -v EXPRESSIONS='#undef' \
> + -v RET_ON_FAIL=1 \
> + -v MESSAGE='Using "#undef XXX", prefer "// XXX is not set"' \
> + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> + "$1" || res=1
> +
> return $res
> }
>
> Otherwise, the change lgtm.
>
Good idea. Do you want me to add your check above as a patch to this to
make a two-patch set for v2?
/Bruce
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] config: remove explicit undef of unset values
2022-06-13 12:37 ` Bruce Richardson
@ 2022-06-13 14:20 ` David Marchand
2022-06-13 14:48 ` Bruce Richardson
0 siblings, 1 reply; 9+ messages in thread
From: David Marchand @ 2022-06-13 14:20 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Dong, JunX, Morten Brørup, Thomas Monjalon
On Mon, Jun 13, 2022 at 2:37 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> > I'd like a check like (below), to avoid new additions:
> >
> > diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> > index 34a2e43845..8dae47165e 100755
> > --- a/devtools/checkpatches.sh
> > +++ b/devtools/checkpatches.sh
> > @@ -158,6 +158,14 @@ check_forbidden_additions() { # <patch>
> > -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> > "$1" || res=1
> >
> > + # '// XXX is not set' must be preferred over '#undef XXX'
> > + awk -v FOLDERS='config/rte_config.h' \
> > + -v EXPRESSIONS='#undef' \
> > + -v RET_ON_FAIL=1 \
> > + -v MESSAGE='Using "#undef XXX", prefer "// XXX is not set"' \
> > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> > + "$1" || res=1
> > +
> > return $res
> > }
> >
> > Otherwise, the change lgtm.
> >
> Good idea. Do you want me to add your check above as a patch to this to
> make a two-patch set for v2?
If you are fine with the check, I don't mind it is part of this simple patch.
I can do it when applying if you are okay with it.
--
David Marchand
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] config: remove explicit undef of unset values
2022-06-13 14:20 ` David Marchand
@ 2022-06-13 14:48 ` Bruce Richardson
0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2022-06-13 14:48 UTC (permalink / raw)
To: David Marchand; +Cc: dev, Dong, JunX, Morten Brørup, Thomas Monjalon
On Mon, Jun 13, 2022 at 04:20:04PM +0200, David Marchand wrote:
> On Mon, Jun 13, 2022 at 2:37 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > > I'd like a check like (below), to avoid new additions:
> > >
> > > diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> > > index 34a2e43845..8dae47165e 100755
> > > --- a/devtools/checkpatches.sh
> > > +++ b/devtools/checkpatches.sh
> > > @@ -158,6 +158,14 @@ check_forbidden_additions() { # <patch>
> > > -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> > > "$1" || res=1
> > >
> > > + # '// XXX is not set' must be preferred over '#undef XXX'
> > > + awk -v FOLDERS='config/rte_config.h' \
> > > + -v EXPRESSIONS='#undef' \
> > > + -v RET_ON_FAIL=1 \
> > > + -v MESSAGE='Using "#undef XXX", prefer "// XXX is not set"' \
> > > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> > > + "$1" || res=1
> > > +
> > > return $res
> > > }
> > >
> > > Otherwise, the change lgtm.
> > >
> > Good idea. Do you want me to add your check above as a patch to this to
> > make a two-patch set for v2?
>
> If you are fine with the check, I don't mind it is part of this simple patch.
> I can do it when applying if you are okay with it.
>
Yes, I'm fine with it, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] config: remove explicit undef of unset values
2022-06-13 9:54 ` Bruce Richardson
2022-06-13 10:01 ` Morten Brørup
2022-06-13 12:26 ` David Marchand
@ 2022-06-13 14:46 ` Tyler Retzlaff
2 siblings, 0 replies; 9+ messages in thread
From: Tyler Retzlaff @ 2022-06-13 14:46 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, david.marchand, junx.dong
On Mon, Jun 13, 2022 at 10:54:33AM +0100, Bruce Richardson wrote:
> On Thu, Dec 16, 2021 at 11:14:30AM +0000, Bruce Richardson wrote:
> > Rather than explicitly clearing any setting of undefined values in our
> > rte_config.h file, it's better to instead just add a comment that the
> > value is not set. Using a comment allows the user to set the value using
> > CFLAGS or similar mechanism without the config file clearing the value
> > again.
> >
> > The text used "<VALUE> is not set" is modelled after the kernel approach
> > of doing the same thing.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >
> > Although DPDK coding convention forbids use of "//" for comments, using
> > regular C comment style makes the config settings less clear, as they can
> > be confused with regular comments in the file. Using "//" makes them stand
> > out better, so I prefer it. However, if others feel strongly, they can be
> > changed to standard.
> >
> > Note: this is a resubmission of patch [1] which was part of a rejected
> > series. However, the reasons for rejection - values in config being out
> > of sync with those used for building apps - are less relevant for
> > many, if not all, of these setting, so I believe the benefits for
> > testing outweigh the potential downsides. If any setting is likely
> > problematic, I can keep the explicit undef for that case in a new patch
> > version.
> >
> > [1] http://patches.dpdk.org/project/dpdk/patch/20200903144942.671870-2-bruce.richardson@intel.com/
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
^ permalink raw reply [flat|nested] 9+ messages in thread