Add api for packet reference count support. Which is useful in case: - multicast support - TCP retransmission - traffic generator
Introduced new call: newpkt = odp_packet_create_ref(pkt) which creates reference to original packet, but handles for reference packet and original are different. Signed-off-by: Maxim Uvarov <[email protected]> --- include/odp/api/config.h | 5 +++++ include/odp/api/packet.h | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/include/odp/api/config.h b/include/odp/api/config.h index 302eaf5..2441f72 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -126,6 +126,11 @@ extern "C" { */ #define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_SEG_LEN_MIN*6) +/** + * Maximum packet references. + */ +#define ODP_CONFIG_PACKET_REFS 2 + /** Maximum number of shared memory blocks. * * This the the number of separate SHM areas that can be reserved concurrently diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index 5d46b7b..f9745fb 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -125,6 +125,15 @@ odp_packet_t odp_packet_from_event(odp_event_t ev); */ odp_event_t odp_packet_to_event(odp_packet_t pkt); +/** + * Create reference for packet handle + * + * @param pkt Packet handle + * + * @return New packet handle + */ +odp_packet_t odp_packet_create_ref(odp_packet_t pkt); + /* * * Pointers and lengths -- 1.9.1 _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
