[dpdk-dev] [PATCH v3] mbuf: support dynamic fields and flags

Stephen Hemminger stephen at networkplumber.org
Thu Oct 24 19:07:34 CEST 2019


On Thu, 24 Oct 2019 17:44:09 +0200
Thomas Monjalon <thomas at monjalon.net> wrote:

> 24/10/2019 17:30, Stephen Hemminger:
> > On Thu, 24 Oct 2019 10:13:37 +0200
> > Olivier Matz <olivier.matz at 6wind.com> wrote:
> >   
> > > +/**
> > > + * Copy dynamic fields from msrc to mdst.
> > > + *
> > > + * @param mdst
> > > + *   The destination mbuf.
> > > + * @param msrc
> > > + *   The source mbuf.
> > > + */
> > > +static inline void
> > > +rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
> > > +{
> > > +	memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
> > > +}  
> > 
> > Since size is fixed and both are of same type, why not just assign structures?  
> 
> Because they are not structures?
> 	uint64_t dynfield1[2];

your right. and gcc will emit simple stores for this.


More information about the dev mailing list