All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Chengwen Feng <fengchengwen@huawei.com>
Subject: Re: [PATCH 0/3] argparse: improve handling of multi-instance args
Date: Fri, 27 Jun 2025 12:36:47 +0200	[thread overview]
Message-ID: <4354101.7YbXXFKy9f@thomas> (raw)
In-Reply-To: <aF5qECJgWupF4Er7@bricha3-mobl1.ger.corp.intel.com>

27/06/2025 11:53, Bruce Richardson:
> On Fri, Jun 20, 2025 at 09:44:15AM +0100, Bruce Richardson wrote:
> > On Mon, Jun 16, 2025 at 11:49:40AM +0100, Bruce Richardson wrote:
> > > Coverity (correctly) identified an issue[1] where, after the recent
> > > rework[2], the internal flag, used by argparse to track what arguments
> > > were previously encountered or not, was out of range for the type and no
> > > longer having any effect. Fixing this flag to be back into range then,
> > > somewhat surprisingly, caused a number of unit test failures to occur.
> > > 
> > > The reason for these failures is that the tracking of args encountered
> > > is done via setting an internal flag on the user-passed arguments
> > > object. In the unit tests, this caused issues where the flags field was
> > > not getting properly reset between calls to the parse operation. [This
> > > is only an issue after the rework, because previously information like
> > > param type and optionality was encoded in the flags, so they were more
> > > often reset during testing].
> > > 
> > > Rather than fixing the tests directly to always reset the flags, which
> > > is simply working around the issue IMHO, this patchset instead fixes the
> > > issue in a more user-friendly way by changing the library to never
> > > modify the user-passed structure - making it completely safe to reuse
> > > across multiple calls. This is done in the first two patches.
> > > 
> > > The final, third patch, adds an additional unit test to check that the
> > > tracking of flags being seen or not, and the handling of the
> > > "RTE_ARGPARSE_FLAG_SUPPORT_MULTI" flag is correct. This closes a gap in
> > > testing, since the original issue of the flag being out-of-range should
> > > have been caught in testing, rather than having to rely on coverity.
> > > 
> > > [1] Coverity Issue: 470190
> > > [2] https://github.com/DPDK/dpdk/commit/04acc21beeeb78477b15a3f497d3628fd70a6a9f
> > > 
> > > Bruce Richardson (3):
> > >   argparse: track parsed arguments internally
> > >   argparse: mark parameter struct as const
> > >   test/argparse: add test for repeated arguments
> > > 
> > Hi Chengwen,
> > 
> > ping for review. I think this bug should be fixed for RC2.
> > 
> 
> Second ping! This patchset (indirectly) fixes an issue in the library, so
> should be included in the release. Can you please review?

No more time to wait for review, sorry.
Applied for -rc2.




  reply	other threads:[~2025-06-27 10:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 10:49 [PATCH 0/3] argparse: improve handling of multi-instance args Bruce Richardson
2025-06-16 10:49 ` [PATCH 1/3] argparse: track parsed arguments internally Bruce Richardson
2025-06-16 10:49 ` [PATCH 2/3] argparse: mark parameter struct as const Bruce Richardson
2025-06-16 10:49 ` [PATCH 3/3] test/argparse: add test for repeated arguments Bruce Richardson
2025-06-20  8:44 ` [PATCH 0/3] argparse: improve handling of multi-instance args Bruce Richardson
2025-06-27  9:53   ` Bruce Richardson
2025-06-27 10:36     ` Thomas Monjalon [this message]
2025-06-24 14:16 ` 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=4354101.7YbXXFKy9f@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.