diff mbox series

[ovs-dev] dpdk: Check other_config:dpdk-extra for '--lcores'.

Message ID 20240612170854.89877-1-ktraynor@redhat.com
State Superseded
Headers show
Series [ovs-dev] dpdk: Check other_config:dpdk-extra for '--lcores'. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Kevin Traynor June 12, 2024, 5:08 p.m. UTC
Currently dpdk lcore args for DPDK EAL init can be generated or it
can be written directly by the user through dpdk-extra.

If dpdk-extra does not contain '-l' or '-c', a '-l' argument with
a core list for DPDK EAL init will be generated.

The '--lcores' argument should also be checked, as if it is used in
dpdk-extra, a '-l' is still generated and that causes DPDK EAL init
to fail:

|00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@18 --in-memory -l 0.
|00012|dpdk|ERR|EAL: Option -l is ignored, because (--lcore) is set!

Add check for '--lcores' in dpdk-extra config and don't add '-l' if
it is detected:

|00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@8 --in-memory.

Fixes: 0a0f39df1d5a ("netdev-dpdk: Add support for DPDK 16.07")
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 lib/dpdk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

David Marchand June 13, 2024, 8:52 a.m. UTC | #1
Hello Kevin,

On Wed, Jun 12, 2024 at 7:09 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Currently dpdk lcore args for DPDK EAL init can be generated or it
> can be written directly by the user through dpdk-extra.
>
> If dpdk-extra does not contain '-l' or '-c', a '-l' argument with
> a core list for DPDK EAL init will be generated.
>
> The '--lcores' argument should also be checked, as if it is used in
> dpdk-extra, a '-l' is still generated and that causes DPDK EAL init
> to fail:
>
> |00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@18 --in-memory -l 0.
> |00012|dpdk|ERR|EAL: Option -l is ignored, because (--lcore) is set!

Not important for this patch, but there is a typo in the DPDK error
message, should be --lcores.
Can you send a fix on DPDK side?

>
> Add check for '--lcores' in dpdk-extra config and don't add '-l' if
> it is detected:
>
> |00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@8 --in-memory.
>
> Fixes: 0a0f39df1d5a ("netdev-dpdk: Add support for DPDK 16.07")

I am not clear why you point at this commit.

--lcores were introduced in DPDK v2.0.0.
In 0a0f39df1d5a (which swaps DPDK from 16.04 to 16.07), only -c is
handled so passing additional -l and --lcores via dpdk-extra would
already be a problem.

I would point at:
Fixes: 543342a41cbc ("DPDK: add support for v2.0.0")

> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>

With the Fixes: tag sorted out, you can add:
Reviewed-by: David Marchand <david.marchand@redhat.com>
Kevin Traynor June 13, 2024, 9 a.m. UTC | #2
On 13/06/2024 09:52, David Marchand wrote:
> Hello Kevin,
> 
> On Wed, Jun 12, 2024 at 7:09 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>>
>> Currently dpdk lcore args for DPDK EAL init can be generated or it
>> can be written directly by the user through dpdk-extra.
>>
>> If dpdk-extra does not contain '-l' or '-c', a '-l' argument with
>> a core list for DPDK EAL init will be generated.
>>
>> The '--lcores' argument should also be checked, as if it is used in
>> dpdk-extra, a '-l' is still generated and that causes DPDK EAL init
>> to fail:
>>
>> |00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@18 --in-memory -l 0.
>> |00012|dpdk|ERR|EAL: Option -l is ignored, because (--lcore) is set!
> 
> Not important for this patch, but there is a typo in the DPDK error
> message, should be --lcores.
> Can you send a fix on DPDK side?
> 

Yes, i noticed that and it caused me a bit of confusion. Will send a fix.

>>
>> Add check for '--lcores' in dpdk-extra config and don't add '-l' if
>> it is detected:
>>
>> |00009|dpdk|INFO|EAL ARGS: ovs-vswitchd --lcores 0@8 --in-memory.
>>
>> Fixes: 0a0f39df1d5a ("netdev-dpdk: Add support for DPDK 16.07")
> 
> I am not clear why you point at this commit.
> 

It's sooo old, I'd forgotten about the v2.X tags and just looked at the
first tags for the DPDK commit and then went by the NEWS for next OVS
update!

> --lcores were introduced in DPDK v2.0.0.
> In 0a0f39df1d5a (which swaps DPDK from 16.04 to 16.07), only -c is
> handled so passing additional -l and --lcores via dpdk-extra would
> already be a problem.
> 
> I would point at:
> Fixes: 543342a41cbc ("DPDK: add support for v2.0.0")
> 

Makes sense. Thanks for reviewing.

>> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> 
> With the Fixes: tag sorted out, you can add:
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
>
diff mbox series

Patch

diff --git a/lib/dpdk.c b/lib/dpdk.c
index d76d53f8f..940c43c07 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -338,5 +338,7 @@  dpdk_init__(const struct smap *ovs_other_config)
 #endif
 
-    if (args_contains(&args, "-c") || args_contains(&args, "-l")) {
+    if (args_contains(&args, "-c") ||
+        args_contains(&args, "-l") ||
+        args_contains(&args, "--lcores")) {
         auto_determine = false;
     }