DPDK patches and discussions
 help / color / mirror / Atom feed
From: Volodymyr Fialko <vfialko@marvell.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Reshma Pattan <reshma.pattan@intel.com>,
	David Marchand <david.marchand@redhat.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>
Subject: RE: [EXT] Re: [PATCH] reorder: fix registration of dynamic field in mbuf
Date: Mon, 13 Mar 2023 17:29:24 +0000	[thread overview]
Message-ID: <MW2PR18MB228235A2F5E350C8115558BFA8B99@MW2PR18MB2282.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20230313085105.65a0320e@hermes.local>



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, March 13, 2023 4:51 PM
> To: Volodymyr Fialko <vfialko@marvell.com>
> Cc: dev@dpdk.org; Reshma Pattan <reshma.pattan@intel.com>; David Marchand
> <david.marchand@redhat.com>; Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Anoob Joseph <anoobj@marvell.com>
> Subject: [EXT] Re: [PATCH] reorder: fix registration of dynamic field in mbuf
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Mon, 13 Mar 2023 10:34:50 +0100
> Volodymyr Fialko <vfialko@marvell.com> wrote:
> 
> > +rte_reorder_dynf_register(void)
> > +{
> > +	int ret;
> > +
> > +	static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
> > +		.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
> > +		.size = sizeof(rte_reorder_seqn_t),
> > +		.align = __alignof__(rte_reorder_seqn_t),
> > +	};
> > +
> 
> This does not need to be static, can just be on stack variable.

I agree, static is unnecessary here since the parameters will be copied to the internal storage during the register call.
So it can be on stack, but static sort of indicates/hints that this is one time initialization.
Also, static is present near every dynfield register in this codebase.
In fact, this patch simply moved the dynamic field declaration from create() to init() - static was already present.
Therefore, if the maintainers decide to remove static, it should be done in all other places too, it's not in scope of this patch.

      reply	other threads:[~2023-03-13 17:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13  9:34 Volodymyr Fialko
2023-03-13 10:19 ` David Marchand
2023-03-13 13:08   ` [EXT] " Volodymyr Fialko
2023-03-13 13:04 ` [PATCH v2] " Volodymyr Fialko
2023-03-15 15:29   ` Volodymyr Fialko
2023-03-15 15:43     ` David Marchand
2023-03-15 15:46       ` Pattan, Reshma
2023-03-16 15:36         ` David Marchand
2023-03-16 15:55   ` David Marchand
2023-03-13 15:51 ` [PATCH] " Stephen Hemminger
2023-03-13 17:29   ` Volodymyr Fialko [this message]

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=MW2PR18MB228235A2F5E350C8115558BFA8B99@MW2PR18MB2282.namprd18.prod.outlook.com \
    --to=vfialko@marvell.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=anoobj@marvell.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=reshma.pattan@intel.com \
    --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).