DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH] eal: add const to init function parameter
Date: Fri, 3 Nov 2023 12:44:09 +0000	[thread overview]
Message-ID: <ZUTrGchZghynAlRM@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <ZUTIzU3MQwC92ZB3@bricha3-MOBL.ger.corp.intel.com>

On Fri, Nov 03, 2023 at 10:17:49AM +0000, Bruce Richardson wrote:
> On Thu, Nov 02, 2023 at 11:55:41AM -0700, Stephen Hemminger wrote:
> > On Thu,  2 Nov 2023 18:11:48 +0000 Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > 
> > > From: Bruce Richardson <bruce.richardson@intel.com> To: dev@dpdk.org
> > > Cc: stephen@networkplumber.org,  Bruce Richardson
> > > <bruce.richardson@intel.com> Subject: [PATCH] eal: add const to init
> > > function parameter Date: Thu,  2 Nov 2023 18:11:48 +0000 X-Mailer:
> > > git-send-email 2.39.2
> > > 
> > > Change the parameter type of argv parameter to rte_eal_init from
> > > "char **" to "char * const *", since we don't modify the argv
> > > pointers passed in.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > 
> > Looks good but probably needs to cascade down a few more levels
> 
> Yep. I only did a quick compile test, which passed, but I see the CI has
> thrown up a bunch more issues. I'll do a v2 later.
> 
Actually, this is not going to work as a patch. Marking as rejected in
patchwork. This is because after parsing the EAL args, we actually assign
the last arg handled, often "--", to be a copy of argv[0]. In short, we
guarantee that when we do:

	int ret = rte_eal_init(argc, argv);
	/* error handling */
	argv += ret;
	argc -= ret;

that argv[0] is the original program name set as argv[0], and so
application arg processing can be done in the usual way. Because of this,
we do modify the params, and so can't set it as an array of const pointers.

/Bruce

  reply	other threads:[~2023-11-03 12:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 18:11 Bruce Richardson
2023-11-02 18:55 ` Stephen Hemminger
2023-11-03 10:17   ` Bruce Richardson
2023-11-03 12:44     ` Bruce Richardson [this message]
2023-11-03  1:06 ` Konstantin Ananyev

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=ZUTrGchZghynAlRM@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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).