Added an API to check if current execution is in interrupt
context. This will be helpful to handle nested interrupt cases.
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
int
rte_intr_cap_multiple(struct rte_intr_handle *intr_handle);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * @internal
+ * Check if currently executing in interrupt context
+ *
+ * @return
+ * - non zero in case of interrupt context
+ * - zero in case of process context
+ */
+__rte_experimental
+int
+rte_thread_is_intr(void);
+
#endif /* _RTE_EAL_INTERRUPTS_H_ */
{
RTE_SET_USED(intr_handle);
}
+
+int rte_thread_is_intr(void)
+{
+ return pthread_equal(intr_thread, pthread_self());
+}
return 0;
}
+
+int rte_thread_is_intr(void)
+{
+ return pthread_equal(intr_thread, pthread_self());
+}
# added in 19.11
rte_log_get_stream;
rte_mcfg_get_single_file_segments;
+
+ # added in 20.02
+ rte_thread_is_intr;
};