[dpdk-dev] [PATCH 13/15] examples/rxtx_callbacks: switch timestamp to dynamic field

Thomas Monjalon thomas at monjalon.net
Thu Oct 29 11:44:39 CET 2020


29/10/2020 11:21, Andrew Rybchenko:
> On 10/29/20 12:27 PM, Thomas Monjalon wrote:
> > The mbuf timestamp is moved to a dynamic field
> > in order to allow removal of the deprecated static field.
> > 
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > ---
> >  examples/rxtx_callbacks/main.c | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
> > index b9a98ceddc..4798e0962c 100644
> > --- a/examples/rxtx_callbacks/main.c
> > +++ b/examples/rxtx_callbacks/main.c
> > @@ -19,6 +19,10 @@
> >  #define MBUF_CACHE_SIZE 250
> >  #define BURST_SIZE 32
> >  
> > +static int hwts_dynfield_offset = -1;
> > +#define HWTS_FIELD(mbuf) (*RTE_MBUF_DYNFIELD(mbuf, \
> > +		hwts_dynfield_offset, rte_mbuf_timestamp_t *))
> > +
> 
> Why is approach here differs? Macro vs inline function.

Because it is a self-contained file,
and there is already a macro for another field.

If you really want a function, I could it for both fields.




More information about the dev mailing list