aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-06-21 15:52:29 +0300
committerMatias Elo <matias.elo@nokia.com>2023-07-07 12:57:03 +0300
commit45f9da2e051612a64f4d36df5974b2dd5f5f4600 (patch)
treef92402f3475c87eced8a7ddc03d7c5e71688a3a7
parent87fdba5b1666d5ff252df4916d7841fc8c4b9362 (diff)
api: event: add odp_event_user_area_and_flag() function
Add new odp_event_user_area_and_flag() function, which returns both event user area and user flag value with a single function call. This can improve throughput compared to calling individual functions separately. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Ashwin Sekhar T K <asekhar@marvell.com>
-rw-r--r--include/odp/api/spec/event.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index 9dc614329..23e77bcb6 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -94,6 +94,28 @@ int odp_event_type_multi(const odp_event_t event[], int num,
void *odp_event_user_area(odp_event_t event);
/**
+ * Event user area and flag
+ *
+ * Returns pointer to the user area and outputs value of user flag associated
+ * with the event. The user area maps to the user area of underlying event type
+ * (e.g. odp_packet_user_area() for packets). If the event does not have user
+ * area, NULL is returned.
+ *
+ * The user flag maps to the user flag value of underlying event type (e.g.
+ * odp_packet_user_flag() for packets). If the event does not have user flag, a
+ * negative value is outputted.
+ *
+ * @param event Event handle
+ * @param[out] flag User flag value pointer for output. >0 if user flag is
+ * set, 0 if flags is not set, or <0 if event does not have
+ * user flag.
+ *
+ * @return Pointer to the user area of the event
+ * @retval NULL The event does not have user area
+ */
+void *odp_event_user_area_and_flag(odp_event_t event, int *flag);
+
+/**
* Filter and convert packet events
*
* Checks event type of all input events, converts all packet events and outputs