@@ -21,6 +21,8 @@ extern "C" {
odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf);
void _odp_buffer_event_type_set(odp_buffer_t buf, int ev);
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf);
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev);
int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf);
static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr)
@@ -96,6 +96,9 @@ struct odp_buffer_hdr_t {
/* Event type. Maybe different than pool type (crypto compl event) */
int8_t event_type;
+ /* Event subtype. Should be ODP_EVENT_NO_SUBTYPE except packets. */
+ int8_t event_subtype;
+
/* Burst table */
struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE];
@@ -882,12 +882,13 @@ odp_crypto_operation(odp_crypto_op_param_t *param,
if (ODP_QUEUE_INVALID != session->p.compl_queue) {
odp_event_t completion_event;
odp_crypto_generic_op_result_t *op_result;
+ odp_buffer_t buf;
/* Linux generic will always use packet for completion event */
completion_event = odp_packet_to_event(param->out_pkt);
- _odp_buffer_event_type_set(
- odp_buffer_from_event(completion_event),
- ODP_EVENT_CRYPTO_COMPL);
+ buf = odp_buffer_from_event(completion_event);
+ _odp_buffer_event_type_set(buf, ODP_EVENT_CRYPTO_COMPL);
+ _odp_buffer_event_subtype_set(buf, ODP_EVENT_NO_SUBTYPE);
/* Asynchronous, build result (no HW so no errors) and send it*/
op_result = get_op_result_from_event(completion_event);
op_result->magic = OP_RESULT_MAGIC;
@@ -1081,9 +1082,11 @@ odp_crypto_compl_result(odp_crypto_compl_t completion_event,
void
odp_crypto_compl_free(odp_crypto_compl_t completion_event)
{
- _odp_buffer_event_type_set(
- odp_buffer_from_event((odp_event_t)completion_event),
- ODP_EVENT_PACKET);
+ odp_buffer_t buf =
+ odp_buffer_from_event((odp_event_t)completion_event);
+
+ _odp_buffer_event_type_set(buf, ODP_EVENT_PACKET);
+ _odp_buffer_event_subtype_set(buf, ODP_EVENT_PACKET_BASIC);
}
void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
@@ -19,6 +19,21 @@ odp_event_type_t odp_event_type(odp_event_t event)
return _odp_buffer_event_type(odp_buffer_from_event(event));
}
+odp_event_subtype_t odp_event_subtype(odp_event_t event)
+{
+ return _odp_buffer_event_subtype(odp_buffer_from_event(event));
+}
+
+odp_event_type_t odp_event_types(odp_event_t event,
+ odp_event_subtype_t *subtype)
+{
+ odp_buffer_t buf = odp_buffer_from_event(event);
+
+ *subtype = _odp_buffer_event_subtype(buf);
+
+ return _odp_buffer_event_type(buf);
+}
+
void odp_event_free(odp_event_t event)
{
switch (odp_event_type(event)) {
@@ -268,6 +268,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len)
CONFIG_PACKET_TAILROOM;
pkt_hdr->input = ODP_PKTIO_INVALID;
+ pkt_hdr->buf_hdr.event_subtype = ODP_EVENT_PACKET_BASIC;
}
static inline void init_segments(odp_packet_hdr_t *pkt_hdr[], int num)
@@ -259,6 +259,7 @@ static void init_buffers(pool_t *pool)
buf_hdr->size = seg_size;
buf_hdr->type = type;
buf_hdr->event_type = type;
+ buf_hdr->event_subtype = ODP_EVENT_NO_SUBTYPE;
buf_hdr->pool_hdl = pool->pool_hdl;
buf_hdr->uarea_addr = uarea;
/* Show user requested size through API */
@@ -566,6 +567,16 @@ void _odp_buffer_event_type_set(odp_buffer_t buf, int ev)
buf_hdl_to_hdr(buf)->event_type = ev;
}
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf)
+{
+ return buf_hdl_to_hdr(buf)->event_subtype;
+}
+
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev)
+{
+ buf_hdl_to_hdr(buf)->event_subtype = ev;
+}
+
odp_pool_t odp_pool_lookup(const char *name)
{
uint32_t i;
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> --- platform/linux-generic/include/odp_buffer_inlines.h | 2 ++ platform/linux-generic/include/odp_buffer_internal.h | 3 +++ platform/linux-generic/odp_crypto.c | 15 +++++++++------ platform/linux-generic/odp_event.c | 15 +++++++++++++++ platform/linux-generic/odp_packet.c | 1 + platform/linux-generic/odp_pool.c | 11 +++++++++++ 6 files changed, 41 insertions(+), 6 deletions(-) -- 2.11.0