> On 12.04.2021., at 12:50, David Gohberg <[email protected]> wrote: > > Damjan, > > After looking at the vlib_buffer_clone_256 function I realize that it > modifies the original buffer pointer, like you said. > my packets are coming in down a custom node path (originating from an asic > data plane), so they will always have the l2 header. > The node that performs the cloning is the last stop before packets get sent > to the hardware interface. > Is there an "elegant" way to always get a buffer that points to the start of > the packet data, regardless of vlan tags and other encapsulations?
See VNET_BUFFER_F_L2_HDR_OFFSET_VALID flag in b->flags. If that flag is set then vnet_buffer (b)->l2_hdr_offset tells you where l2 header starts. — Damjan
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#19181): https://lists.fd.io/g/vpp-dev/message/19181 Mute This Topic: https://lists.fd.io/mt/81938105/21656 Group Owner: [email protected] Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
