[v2,3/3] config/arm: allow WFE to be enabled config time

Message ID 20240201215731.4543-3-pbhagavatula@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/3] config/arm: avoid mcpu and march conflicts |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing warning Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing fail Testing issues

Commit Message

Pavan Nikhilesh Bhagavatula Feb. 1, 2024, 9:57 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Allow RTE_ARM_USE_WFE to be enabled at meson configuration
time by passing it via c_args instead of modifying
`config/arm/meson.build`.

Example usage:
 meson build -Dc_args='-DRTE_ARM_USE_WFE' \
	--cross-file config/arm/arm64_cn10k_linux_gcc

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Honnappa Nagarahalli Feb. 7, 2024, 2:55 a.m. UTC | #1
> On Feb 1, 2024, at 3:57 PM, pbhagavatula@marvell.com wrote:
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Allow RTE_ARM_USE_WFE to be enabled at meson configuration
> time by passing it via c_args instead of modifying
> `config/arm/meson.build`.
> 
> Example usage:
> meson build -Dc_args='-DRTE_ARM_USE_WFE' \
> --cross-file config/arm/arm64_cn10k_linux_gcc
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> config/arm/meson.build | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 6f2308f2fa..3467bef466 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -17,7 +17,9 @@ flags_common = [
>         #    ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>         #    ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> 
> -        ['RTE_ARM_USE_WFE', false],
> +        # Enable use of ARM wait for event instruction.
> +        # ['RTE_ARM_USE_WFE', false],
> +
So, what is the default value for RTE_ARM_USE_WFE if the user does not pass the flag at the command line?

Can we do it such a way that the flag passed on the command line takes precedence?

>         ['RTE_ARCH_ARM64', true],
>         ['RTE_CACHE_LINE_SIZE', 128]
> ]
> -- 
> 2.25.1
>
  
Pavan Nikhilesh Bhagavatula Feb. 10, 2024, 6:47 a.m. UTC | #2
> > On Feb 1, 2024, at 3:57 PM, pbhagavatula@marvell.com wrote:
> >
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Allow RTE_ARM_USE_WFE to be enabled at meson configuration
> > time by passing it via c_args instead of modifying
> > `config/arm/meson.build`.
> >
> > Example usage:
> > meson build -Dc_args='-DRTE_ARM_USE_WFE' \
> > --cross-file config/arm/arm64_cn10k_linux_gcc
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> > Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > ---
> > config/arm/meson.build | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > index 6f2308f2fa..3467bef466 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -17,7 +17,9 @@ flags_common = [
> >         #    ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >         #    ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >
> > -        ['RTE_ARM_USE_WFE', false],
> > +        # Enable use of ARM wait for event instruction.
> > +        # ['RTE_ARM_USE_WFE', false],
> > +
> So, what is the default value for RTE_ARM_USE_WFE if the user does not pass
> the flag at the command line?
> 

All the checks related to RTE_ARM_USE_WFE see if it is defined or not

#rg "RTE_ARM_USE_WFE"                     
config/arm/meson.build
20:        ['RTE_ARM_USE_WFE', false],
lib/eal/arm/rte_cpuflags.c
166:#ifdef RTE_ARM_USE_WFE
lib/eal/arm/include/rte_pause_64.h
15:#ifdef RTE_ARM_USE_WFE
lib/eal/arm/rte_power_intrinsics.c
20:#ifdef RTE_ARM_USE_WFE
84:#ifdef RTE_ARM_USE_WFE

So default value would be not-defined.

> Can we do it such a way that the flag passed on the command line takes
> precedence?

No, we can't have checks based on flags passed via -Dc_args with the current meson(needs build_options() from 1.1.0).
Only option is to add via meson_option.txt which is not optimal for arch settings.

> 
> >         ['RTE_ARCH_ARM64', true],
> >         ['RTE_CACHE_LINE_SIZE', 128]
> > ]
> > --
> > 2.25.1
> >
  
Honnappa Nagarahalli Feb. 10, 2024, 4:36 p.m. UTC | #3
> On Feb 10, 2024, at 12:47 AM, Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com> wrote:
> 
>>> On Feb 1, 2024, at 3:57 PM, pbhagavatula@marvell.com wrote:
>>> 
>>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>> 
>>> Allow RTE_ARM_USE_WFE to be enabled at meson configuration
>>> time by passing it via c_args instead of modifying
>>> `config/arm/meson.build`.
>>> 
>>> Example usage:
>>> meson build -Dc_args='-DRTE_ARM_USE_WFE' \
>>> --cross-file config/arm/arm64_cn10k_linux_gcc
>>> 
>>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>>> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
>>> ---
>>> config/arm/meson.build | 4 +++-
>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/config/arm/meson.build b/config/arm/meson.build
>>> index 6f2308f2fa..3467bef466 100644
>>> --- a/config/arm/meson.build
>>> +++ b/config/arm/meson.build
>>> @@ -17,7 +17,9 @@ flags_common = [
>>>        #    ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>>>        #    ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
>>> 
>>> -        ['RTE_ARM_USE_WFE', false],
>>> +        # Enable use of ARM wait for event instruction.
>>> +        # ['RTE_ARM_USE_WFE', false],
>>> +
>> So, what is the default value for RTE_ARM_USE_WFE if the user does not pass
>> the flag at the command line?
>> 
> 
> All the checks related to RTE_ARM_USE_WFE see if it is defined or not
> 
> #rg "RTE_ARM_USE_WFE"                     
> config/arm/meson.build
> 20:        ['RTE_ARM_USE_WFE', false],
> lib/eal/arm/rte_cpuflags.c
> 166:#ifdef RTE_ARM_USE_WFE
> lib/eal/arm/include/rte_pause_64.h
> 15:#ifdef RTE_ARM_USE_WFE
> lib/eal/arm/rte_power_intrinsics.c
> 20:#ifdef RTE_ARM_USE_WFE
> 84:#ifdef RTE_ARM_USE_WFE
> 
> So default value would be not-defined.
> 
>> Can we do it such a way that the flag passed on the command line takes
>> precedence?
> 
> No, we can't have checks based on flags passed via -Dc_args with the current meson(needs build_options() from 1.1.0).
> Only option is to add via meson_option.txt which is not optimal for arch settings.

Ack
Do you expect the users to enable this flag by default for cn10k?

> 
>> 
>>>        ['RTE_ARCH_ARM64', true],
>>>        ['RTE_CACHE_LINE_SIZE', 128]
>>> ]
>>> --
>>> 2.25.1
>>> 
>
  
Pavan Nikhilesh Bhagavatula Feb. 10, 2024, 4:40 p.m. UTC | #4
> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Saturday, February 10, 2024 10:07 PM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; juraj.linkes@pantheon.tech; nd
> <nd@arm.com>; Ruifeng Wang <Ruifeng.Wang@arm.com>; Bruce Richardson
> <bruce.richardson@intel.com>; dev@dpdk.org; Chengwen Feng
> <fengchengwen@huawei.com>; Wathsala Wathawana Vithanage
> <wathsala.vithanage@arm.com>; Dhruv Tripathi <Dhruv.Tripathi@arm.com>
> Subject: [EXT] Re: [PATCH v2 3/3] config/arm: allow WFE to be enabled config
> time
> 
> External Email
> 
> ----------------------------------------------------------------------
> 
> 
> > On Feb 10, 2024, at 12:47 AM, Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com> wrote:
> >
> >>> On Feb 1, 2024, at 3:57 PM, pbhagavatula@marvell.com wrote:
> >>>
> >>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>>
> >>> Allow RTE_ARM_USE_WFE to be enabled at meson configuration
> >>> time by passing it via c_args instead of modifying
> >>> `config/arm/meson.build`.
> >>>
> >>> Example usage:
> >>> meson build -Dc_args='-DRTE_ARM_USE_WFE' \
> >>> --cross-file config/arm/arm64_cn10k_linux_gcc
> >>>
> >>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >>> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> >>> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
> >>> ---
> >>> config/arm/meson.build | 4 +++-
> >>> 1 file changed, 3 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/config/arm/meson.build b/config/arm/meson.build
> >>> index 6f2308f2fa..3467bef466 100644
> >>> --- a/config/arm/meson.build
> >>> +++ b/config/arm/meson.build
> >>> @@ -17,7 +17,9 @@ flags_common = [
> >>>        #    ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >>>        #    ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >>>
> >>> -        ['RTE_ARM_USE_WFE', false],
> >>> +        # Enable use of ARM wait for event instruction.
> >>> +        # ['RTE_ARM_USE_WFE', false],
> >>> +
> >> So, what is the default value for RTE_ARM_USE_WFE if the user does not
> pass
> >> the flag at the command line?
> >>
> >
> > All the checks related to RTE_ARM_USE_WFE see if it is defined or not
> >
> > #rg "RTE_ARM_USE_WFE"
> > config/arm/meson.build
> > 20:        ['RTE_ARM_USE_WFE', false],
> > lib/eal/arm/rte_cpuflags.c
> > 166:#ifdef RTE_ARM_USE_WFE
> > lib/eal/arm/include/rte_pause_64.h
> > 15:#ifdef RTE_ARM_USE_WFE
> > lib/eal/arm/rte_power_intrinsics.c
> > 20:#ifdef RTE_ARM_USE_WFE
> > 84:#ifdef RTE_ARM_USE_WFE
> >
> > So default value would be not-defined.
> >
> >> Can we do it such a way that the flag passed on the command line takes
> >> precedence?
> >
> > No, we can't have checks based on flags passed via -Dc_args with the current
> meson(needs build_options() from 1.1.0).
> > Only option is to add via meson_option.txt which is not optimal for arch
> settings.
> 
> Ack
> Do you expect the users to enable this flag by default for cn10k?
> 

No, AFAIK only certain users are going to enable it, mostly L1.

> >
> >>
> >>>        ['RTE_ARCH_ARM64', true],
> >>>        ['RTE_CACHE_LINE_SIZE', 128]
> >>> ]
> >>> --
> >>> 2.25.1
> >>>
> >
  

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6f2308f2fa..3467bef466 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -17,7 +17,9 @@  flags_common = [
         #    ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
         #    ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-        ['RTE_ARM_USE_WFE', false],
+        # Enable use of ARM wait for event instruction.
+        # ['RTE_ARM_USE_WFE', false],
+
         ['RTE_ARCH_ARM64', true],
         ['RTE_CACHE_LINE_SIZE', 128]
 ]