DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: <dev@dpdk.org>
Cc: <david.marchand@redhat.com>, Chengwen Feng <fengchengwen@huawei.com>
Subject: Re: [RFC PATCH 3/7] argparse: make argparse EAL-args compatible
Date: Thu, 22 May 2025 11:44:36 +0100	[thread overview]
Message-ID: <aC8AFA425744qaH-@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20250520164025.2055721-4-bruce.richardson@intel.com>

On Tue, May 20, 2025 at 05:40:20PM +0100, Bruce Richardson wrote:
> The argparse library was missing two key features which made it
> unsuitable for use by EAL or any program wanting similar behaviour.
> 
> 1. It didn't stop parsing arguments when it hit a "--" character
> 2. It never returned the number of arguments parsed
> 
> Fix both these issues - the latter is a change to the ABI, since we now
> return >= 0 rather than == 0 on success. However, the ABI is still
> experimental so we can make exactly these sorts of tweaks to it.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Thinking about it further, for EAL we can actually do without these changes
to the argparse library*. However, this is also functionality that may be
useful in other cases, so looking for feedback on whether to continue with
this patch, or drop it?

Question:
* should argparse library stop processing args at "--"?
* should argparse library return number of args parsed, or zero on success?

/Bruce

*The reason we don't need these is because we clone the argv data on
eal_init so we can return it via telemetry library. This splits the args
into eal and non-eal args, so we can use just the "eal" arg array to pass to
arg-parse, if we don't include this patch.

  reply	other threads:[~2025-05-22 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20 16:40 [RFC PATCH 0/7] rework EAL argument parsing in DPDK Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 1/7] eal: add long options for each short option Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 2/7] argparse: add support for string and boolean args Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 3/7] argparse: make argparse EAL-args compatible Bruce Richardson
2025-05-22 10:44   ` Bruce Richardson [this message]
2025-05-20 16:40 ` [RFC PATCH 4/7] eal: define the EAL parameters in argparse format Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 5/7] eal: gather EAL args before processing Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 6/7] eal: combine parameter validation checks Bruce Richardson
2025-05-20 16:40 ` [RFC PATCH 7/7] eal: simplify handling of conflicting cmdline options Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aC8AFA425744qaH-@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).