> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Monday, March 13, 2023 4:51 PM
> To: Volodymyr Fialko <vfia...@marvell.com>
> Cc: dev@dpdk.org; Reshma Pattan <reshma.pat...@intel.com>; David Marchand
> <david.march...@redhat.com>; Andrew Rybchenko 
> <andrew.rybche...@oktetlabs.ru>; Jerin Jacob
> Kollanukkaran <jer...@marvell.com>; Anoob Joseph <ano...@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 <vfia...@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 via email to