This patch adds support for packet references and splices following
discussions at LAS16 on this subject. This is more than an RFC as it is fully
operational, but I haven't added the validation test suite enhancements to
test this until we are agreed on the syntax and semantics of these APIs. I'll
post a revision with those additions once we're happy with the base functions.

I've changed things around from Petri's original proposal by splitting this
into two separate APIs: odp_packet_splice() and odp_packet_ref(), where the
latter is just a splice of a zero-length header on to a base packet. The
various odp packet manipulation APIs have also been enhanced to behave
sensibly when presented with a spliced packet as input. Reference counts are
used to enable odp_packet_free() to not free a packet until all splices based
on it are also freed.

Also added is a new API odp_packet_is_spliced() that tells whether an input
packet is a splice, as this seems necesssary for completeness. Note that there
is no odp_packet_unsplice() API. We should discuss and decide if such an API
is warranted for symmetry.

Changes for v2:
- Bug fixes
- Enhance ODP packet segment APIs to behave properly with spliced packets

Bill Fischofer (2):
  api: packet: add support for packet splices and references
  linux-generic: packet: implement splice/reference apis

 include/odp/api/spec/packet.h                      |  86 ++++++++
 .../linux-generic/include/odp_packet_internal.h    |  54 ++++-
 platform/linux-generic/odp_packet.c                | 235 ++++++++++++++++++---
 3 files changed, 338 insertions(+), 37 deletions(-)

-- 
2.7.4

Reply via email to