DPDK patches and discussions
 help / color / mirror / Atom feed
From: Euan Bourke <euan.bourke@intel.com>
To: dev@dpdk.org
Cc: Euan Bourke <euan.bourke@intel.com>
Subject: [PATCH 24.03 0/4] add new command line argument parsing library
Date: Wed, 22 Nov 2023 16:45:46 +0000	[thread overview]
Message-ID: <20231122164550.3873633-1-euan.bourke@intel.com> (raw)

A recent thread on the mailing list[1] discussed corelist and coremask parsing
and the idea of a new library dedicated to command line parsing was
mentioned[2]. As I had been working on a public corelist parsing API at the
time, this patchset adds the library, along with the new APIs, edits to EAL
functions to call the API instead of implementing their own, and changes to
the dlb2 driver to call the API.

The new APIs work similar to existing functions in EAL, however instead of
filling a core array like this:
[1, -1, -1, 2, 3] (a non -1 refers to an 'active core' at that index)
It fills it like this:
[0, 3, 4] (with the value at each index being an 'active core').

The new APIs will also return the number of cores contained in the passed
corelist/coremask, so in the above example, 3 would be returned.

Planned future work for the library contains more parsing functions such as a
"core string parser" which would take a string and return whether its a corelist
or coremask based on heuristics. This could then be passed into the appropriate
function.

There are also several functions in EAL that implement their own version of a
corelist/coremask parser, so the plan is to rework those in future versions of
this patch.

[1] Link to start of thread:
https://mails.dpdk.org/archives/dev/2023-November/280957.html
[2] Link to the mention of a new library:
https://mails.dpdk.org/archives/dev/2023-November/280966.html

Euan Bourke (4):
  arg_parser: new library for command line parsing
  arg_parser: add new coremask parsing API
  eal: add support for new arg parsing library
  dlb2: add new arg parsing library API support

 .mailmap                                   |   1 +
 MAINTAINERS                                |   5 +
 doc/api/doxy-api-index.md                  |   3 +-
 doc/api/doxy-api.conf.in                   |   1 +
 drivers/event/dlb2/dlb2_priv.h             |   4 +-
 drivers/event/dlb2/pf/base/dlb2_resource.c |  54 +++----
 lib/arg_parser/arg_parser.c                | 171 +++++++++++++++++++++
 lib/arg_parser/meson.build                 |   7 +
 lib/arg_parser/rte_arg_parser.h            |  99 ++++++++++++
 lib/arg_parser/version.map                 |  11 ++
 lib/eal/common/eal_common_options.c        | 114 ++------------
 lib/eal/meson.build                        |   2 +-
 lib/meson.build                            |   1 +
 13 files changed, 334 insertions(+), 139 deletions(-)
 create mode 100644 lib/arg_parser/arg_parser.c
 create mode 100644 lib/arg_parser/meson.build
 create mode 100644 lib/arg_parser/rte_arg_parser.h
 create mode 100644 lib/arg_parser/version.map

-- 
2.34.1


             reply	other threads:[~2023-11-22 16:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 16:45 Euan Bourke [this message]
2023-11-22 16:45 ` [PATCH 24.03 1/4] arg_parser: new library for command line parsing Euan Bourke
2023-11-23 15:50   ` Bruce Richardson
2023-11-22 16:45 ` [PATCH 24.03 2/4] arg_parser: add new coremask parsing API Euan Bourke
2023-11-23 15:55   ` Bruce Richardson
2023-11-22 16:45 ` [PATCH 24.03 3/4] eal: add support for new arg parsing library Euan Bourke
2023-11-22 16:45 ` [PATCH 24.03 4/4] dlb2: add new arg parsing library API support Euan Bourke
2023-11-28 14:07 ` [PATCH 24.03 v2 0/5] add new command line argument parsing library Euan Bourke
2023-11-28 14:07   ` [PATCH 24.03 v2 1/5] arg_parser: new library for command line parsing Euan Bourke
2023-11-29 22:12     ` Stephen Hemminger
2023-11-29 22:12     ` Stephen Hemminger
2023-11-29 22:14     ` Stephen Hemminger
2023-11-30  8:59       ` Bruce Richardson
2023-11-28 14:07   ` [PATCH 24.03 v2 2/5] arg_parser: add new coremask parsing API Euan Bourke
2023-11-28 14:07   ` [PATCH 24.03 v2 3/5] eal: add support for new arg parsing library Euan Bourke
2023-11-28 14:07   ` [PATCH 24.03 v2 4/5] eal: update to service core related parsers Euan Bourke
2023-11-28 14:07   ` [PATCH 24.03 v2 5/5] event/dlb2: add new arg parsing library API support Euan Bourke

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=20231122164550.3873633-1-euan.bourke@intel.com \
    --to=euan.bourke@intel.com \
    --cc=dev@dpdk.org \
    /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).