diff options
author | Jerin Jacob <jerinj@marvell.com> | 2020-09-03 15:30:39 +0530 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2020-11-19 09:49:08 +0200 |
commit | 527561e9a4c71e7edcddf380a86478f824e46496 (patch) | |
tree | 6578d2ee3c282c3919afefe40dca276898d2e930 /include | |
parent | cdc1750bc40b72fc194ad69bb4db57618f13f2ac (diff) |
api: event: introduce packet vector event
Introduce packet vector events which hold an array of odp_packet_t.
This patch also introduce the odp_packet_vector_from_event()
and odp_packet_vector_to_event() event conversion APIs.
In order to build the linux-generic in --disable-abi-compat mode,
A dummy definition of odp_packet_vector_t has been added.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/odp/api/abi-default/event.h | 11 | ||||
-rw-r--r-- | include/odp/api/abi-default/packet.h | 5 | ||||
-rw-r--r-- | include/odp/api/spec/event.h | 2 | ||||
-rw-r--r-- | include/odp/api/spec/packet.h | 38 | ||||
-rw-r--r-- | include/odp/api/spec/pool.h | 1 |
5 files changed, 52 insertions, 5 deletions
diff --git a/include/odp/api/abi-default/event.h b/include/odp/api/abi-default/event.h index c9d03735c..a63571ca0 100644 --- a/include/odp/api/abi-default/event.h +++ b/include/odp/api/abi-default/event.h @@ -25,15 +25,16 @@ typedef _odp_abi_event_t *odp_event_t; #define ODP_EVENT_INVALID ((odp_event_t)0) typedef enum { - ODP_EVENT_BUFFER = 1, - ODP_EVENT_PACKET = 2, - ODP_EVENT_TIMEOUT = 3, + ODP_EVENT_BUFFER = 1, + ODP_EVENT_PACKET = 2, + ODP_EVENT_TIMEOUT = 3, ODP_EVENT_CRYPTO_COMPL = 4, - ODP_EVENT_IPSEC_STATUS = 5 + ODP_EVENT_IPSEC_STATUS = 5, + ODP_EVENT_PACKET_VECTOR = 6 } odp_event_type_t; typedef enum { - ODP_EVENT_NO_SUBTYPE = 0, + ODP_EVENT_NO_SUBTYPE = 0, ODP_EVENT_PACKET_BASIC = 1, ODP_EVENT_PACKET_CRYPTO = 2, ODP_EVENT_PACKET_IPSEC = 3, diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h index 57e255c57..3660cfa29 100644 --- a/include/odp/api/abi-default/packet.h +++ b/include/odp/api/abi-default/packet.h @@ -19,16 +19,21 @@ typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_packet_t; /** @internal Dummy type for strong typing */ typedef struct { char dummy; /**< *internal Dummy */ } _odp_abi_packet_seg_t; +/** @internal Dummy type for strong typing */ +typedef struct { char dummy; /**< *internal Dummy */ } _odp_abi_packet_vector_t; + /** @ingroup odp_packet * @{ */ typedef _odp_abi_packet_t *odp_packet_t; typedef _odp_abi_packet_seg_t *odp_packet_seg_t; +typedef _odp_abi_packet_vector_t *odp_packet_vector_t; #define ODP_PACKET_INVALID ((odp_packet_t)0) #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)0) #define ODP_PACKET_OFFSET_INVALID 0xffff +#define ODP_PACKET_VECTOR_INVALID ((odp_packet_vector_t)0) typedef uint8_t odp_proto_l2_type_t; diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index f9fe17dac..731d2656a 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -58,6 +58,8 @@ extern "C" { * - Crypto completion event (odp_crypto_compl_t) * - ODP_EVENT_IPSEC_STATUS * - IPSEC status update event (odp_ipsec_status_t) + * - ODP_EVENT_PACKET_VECTOR + * - Vector of packet events (odp_packet_t) as odp_packet_vector_t */ /** diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index fa56b5d02..5b04d5f7d 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -177,6 +177,16 @@ extern "C" { */ /** + * @typedef odp_packet_vector_t + * ODP packet vector + */ + +/** + * @def ODP_PACKET_VECTOR_INVALID + * Invalid packet vector + */ + +/** * Protocol */ typedef enum odp_proto_t { @@ -2027,6 +2037,34 @@ uint64_t odp_packet_cls_mark(odp_packet_t pkt); /* * + * Packet vector handling routines + * ******************************************************** + * + */ + +/** + * Get packet vector handle from event + * + * Converts an ODP_EVENT_PACKET_VECTOR type event to a packet vector handle + * + * @param ev Event handle + * @return Packet vector handle + * + * @see odp_event_type() + */ +odp_packet_vector_t odp_packet_vector_from_event(odp_event_t ev); + +/** + * Convert packet vector handle to event + * + * @param pktv Packet vector handle + * + * @return Event handle + */ +odp_event_t odp_packet_vector_to_event(odp_packet_vector_t pktv); + +/* + * * Debugging * ******************************************************** * diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 21963e468..fc83e7f3b 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -407,6 +407,7 @@ typedef struct odp_pool_param_t { * * The pool to hold a vector of general type such as odp_packet_t. * Each vector holds an array of generic types of the same type. + * @see ODP_EVENT_PACKET_VECTOR */ #define ODP_POOL_VECTOR (ODP_POOL_TIMEOUT + 1) |