Hi Stephen,

Thanks,
Nitin

On Fri, Apr 4, 2025 at 8:51 PM Stephen Hemminger
<step...@networkplumber.org> wrote:
>
> On Fri, 4 Apr 2025 08:11:07 +0000
> Pavan Nikhilesh Bhagavatula <pbhagavat...@marvell.com> wrote:
>
> > > Hi Stephen,
> > >
> > > Thanks for commenting. See response inline.
> > >
> > > Regards,
> > > Nitin
> > >
> > > On Tue, Apr 1, 2025 at 7:45 PM Stephen Hemminger
> > > <step...@networkplumber.org> wrote:
> > > >
> > > > On Tue, 1 Apr 2025 09:50:46 +0530
> > > > Nitin Saxena <nsax...@marvell.com> wrote:
> > > >
> > > > > +int rte_node_mbuf_dynfield_register(void)
> > > > > +{
> > > > > +     struct node_mbuf_dynfield_mz *f = NULL;
> > > > > +     const struct rte_memzone *mz = NULL;
> > > > > +     int dyn_offset;
> > > > > +
> > > > > +     RTE_BUILD_BUG_ON(sizeof(rte_node_mbuf_dynfield_t) <
> > > RTE_NODE_MBUF_DYNFIELD_SIZE);
> > > > > +     RTE_BUILD_BUG_ON(sizeof(rte_node_mbuf_overload_fields_t) <
> > > > > +                      RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE);
> > > > > +
> > > > > +     mz =
> > > rte_memzone_lookup(NODE_MBUF_DYNFIELD_MEMZONE_NAME);
> > > >
> > > > Seems wasteful to have a whole memzone for this, the data is small.
> > > > Is there a reason it could not just be a global variable like timestamp.
> > > >
> > > Replaced usage of memzone with global variable in v2
> >
> > We need to use memzone to share the offset between primary and secondary
> > processes I don’t see any other way.
>
>
> Normally secondary just uses dynamic field lookup to find the offset.

rte_node_mbuf_dynfield_register() is doing both: register_offset() +
lookup_offset()
Very first call to rte_node_mbuf_dynfield_register() actually
registers dynamic offset for the buffer. All subsequent calls returns
offset based on what was registered earlier

Since secondary process support is required, should I bring back
memzone based implementation? since global variable would not work

Reply via email to