[dpdk-dev] [PATCH 09/15] net/vmxnet3: switch MSS hint to dynamic mbuf field

Thomas Monjalon thomas at monjalon.net
Mon Oct 26 17:50:25 CET 2020


26/10/2020 16:21, Andrew Rybchenko:
> On 10/26/20 6:14 PM, Andrew Rybchenko wrote:
> > On 10/26/20 8:20 AM, Thomas Monjalon wrote:
> >> -			rxm->udata64 = rcde->segCnt;
> >> +			*RTE_MBUF_DYNFIELD(rxm, vmxnet3_segs_dynfield_offset,
> >> +					uint8_t *) = rcde->segCnt;
> > 
> > I think it should be a rule of thumb to introduce helper
> > macro to access a dynamic field (as you do in few of
> > previous patches).
> > 
> > It should be just nearby declaration of the the offset
> > variable.
> 
> May be inline function is even better since, IMHO, if you
> both ways are possible, inline function is the right choice.
> In this particular case inline function will not add value
> from type safety point of view, but it is still better as
> an example to follow. In some case inline function could be
> used as a place to put build assertion to check size.

OK I will review the patches to provide a static inline getter function
for each dynamic field.





More information about the dev mailing list