+1. Note the vnet_buffer(b) and vnet_buffer2(b) macros. Track down the 
definitions in .../src/vlib/buffer.h and .../src/vnet/buffer.h and you'll 
understand how these opaque buffer metadata spaces are to be used.

Depending on where your graph nodes land, you must be careful not to smash 
metadata which will be used downstream.

Due to load-store unit pressure, (especially) vnet_buffer(b) fields are 
overlaid and have multiple uses. Any new use-case needs careful [manual] 
life-cycle analysis.

Example: if you set vnet_buffer(b)->sw_if_index[VLIB_TX] to a random number and 
ship that buffer to ip4/6-lookup, you'll get a nasty surprise.

D.

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Damjan Marion via 
Lists.Fd.Io
Sent: Friday, September 21, 2018 6:36 AM
To: Prashant Upadhyaya <praupadhy...@gmail.com>
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] Regarding pre_data field in vlib_buffer_t


pre_data is not intended for that. It is headroom space which may be used
for outer headers in case of different tunnel encapsulation.

You can use opaque area in vlib_buffer_t....

--
Damjan


On 21 Sep 2018, at 07:59, Prashant Upadhyaya 
<praupadhy...@gmail.com<mailto:praupadhy...@gmail.com>> wrote:

Hi,

I want to pass around some custom data between my plugins using vlib_buffer_t.
I believe the pre_data field of 128 bytes can be used for this. (I use
the DPDK plugin)

However, are there some best practices to use this field ? I ask this
because I do see that some debug capabilities of VPP use this field
and if I start using this field then it might interfere with those
debug capabilties.

Regards
-Prashant
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10594): https://lists.fd.io/g/vpp-dev/message/10594
Mute This Topic: https://lists.fd.io/mt/25840898/675642
Group Owner: vpp-dev+ow...@lists.fd.io<mailto:vpp-dev+ow...@lists.fd.io>
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  
[dmar...@me.com<mailto:dmar...@me.com>]
-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10598): https://lists.fd.io/g/vpp-dev/message/10598
Mute This Topic: https://lists.fd.io/mt/25840898/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to