.stats = (void *)&ntuple_stats
};
- static __attribute__((noreturn)) void
+ static __rte_noreturn void
lcore_main(cls_app)
{
uint16_t port;
.. code-block:: c
static
- attribute ((noreturn)) int main_loop(__rte_unused void *dummy)
+ __rte_noreturn int main_loop(__rte_unused void *dummy)
{
// ...
The function ``pthread_exit()`` has additional special handling. The standard
system header file pthread.h declares ``pthread_exit()`` with
-``__attribute__((noreturn))`` this is an optimization that is possible because
+``__rte_noreturn`` this is an optimization that is possible because
the pthread is terminating and this enables the compiler to omit the normal
handling of stack and protection of registers since the function is not
expected to return, and in fact the thread is being destroyed. These
.. code-block:: c
- static __attribute__((noreturn)) void
+ static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port classifying the packets and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(struct flow_classifier *cls_app)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
/*
* CPU-load stats collector
*/
-static int __attribute__((noreturn))
+static int __rte_noreturn
cpu_load_collector(__rte_unused void *arg) {
unsigned i, j, k;
uint64_t hits;
}
/* main processing loop */
-static int __attribute__((noreturn))
+static int __rte_noreturn
pthread_tx(void *dummy)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
* An exiting lthread must not terminate the pthread it is running in
* since this would mean terminating the lthread scheduler.
* We override pthread_exit() with a macro because it is typically declared with
- * __attribute__((noreturn))
+ * __rte_noreturn
*/
void pthread_exit_override(void *v);
* The lcore main. This is the main thread that does the work, reading from an
* input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t portid;
}
-static __attribute__((noreturn)) int
+static __rte_noreturn int
main_loop(__rte_unused void *dummy)
{
uint64_t current_time, last_time = rte_rdtsc();
* Main thread that does the work, reading from INPUT_PORT
* and writing to OUTPUT_PORT
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
rte_timer_reset(tim, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
}
-static __attribute__((noreturn)) int
+static __rte_noreturn int
lcore_mainloop(__rte_unused void *arg)
{
uint64_t prev_tsc = 0, cur_tsc, diff_tsc;
* @param arg
* opaque pointer
*/
-__attribute__((noreturn)) void *eal_thread_loop(void *arg);
+__rte_noreturn void *eal_thread_loop(void *arg);
/**
* Init per-lcore info for master thread
}
/* main loop of threads */
-__attribute__((noreturn)) void *
+__rte_noreturn void *
eal_thread_loop(__rte_unused void *arg)
{
char c;
#define RTE_FINI(func) \
RTE_FINI_PRIO(func, LAST)
+/**
+ * Hint never returning function
+ */
+#define __rte_noreturn __attribute__((noreturn))
+
/**
* Force a function to be inlined
*/
* printf format characters which will be expanded using any further parameters
* to the function.
*/
-void
+__rte_noreturn void
rte_exit(int exit_code, const char *format, ...)
- __attribute__((noreturn))
__rte_format_printf(2, 3);
#ifdef __cplusplus
__rte_cold
#endif
#endif
- __attribute__((noreturn))
+ __rte_noreturn
__rte_format_printf(2, 3);
#ifdef __cplusplus
* @return
* never return;
*/
-static __attribute__((noreturn)) void *
+static __rte_noreturn void *
eal_intr_thread_main(__rte_unused void *arg)
{
/* host thread, never break out */
}
/* main loop of threads */
-__attribute__((noreturn)) void *
+__rte_noreturn void *
eal_thread_loop(__rte_unused void *arg)
{
char c;