[dpdk-dev] [PATCH v4] node: switch IPv4 metadata to dynamic mbuf field

Nithin Dabilpuram nithind1988 at gmail.com
Wed Oct 28 11:33:14 CET 2020


On Wed, Oct 28, 2020 at 11:08:47AM +0100, Thomas Monjalon wrote:
> 28/10/2020 10:30, Nithin Dabilpuram:
> > From: Thomas Monjalon <thomas at monjalon.net>
> > 
> > The node_mbuf_priv1 was stored in the deprecated mbuf field udata64.
> > It is moved to a dynamic field in order to allow removal of udata64.
> > 
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
> [...]
> > +	IP4_LOOKUP_NODE_PRIV1_OFF(node->ctx) = node_mbuf_priv1_dynfield_offset;
> 
> That's interesting.
> You copy the offset in the node context for better performance.
> How much is it better than with global offset variable?
> How much it decreases compared to a static mbuf field?

Moving it to node context was not for performance but for functionality as for
graph's created in primary can be looked up in secondary and graph walk can 
be called on them. So having the dyn offset in global variable doesn't reflect
in secondary.

This is partially better than referring global offset variable directly in
node_mbuf_priv1() as it is caching the dyn offset locally and passing it to
node_mbuf_priv1() instead of loading from global variable for every mbuf.

As mentioned earlier, this is done only because currently there is no mechanism
to have a callback triggered in secondary alone where we can update the 
global variable.


> 
> 
> 
> 


More information about the dev mailing list