API Reference Manual 1.51.0
Loading...
Searching...
No Matches
odp_pipeline_work.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2025 Nokia
3 */
4
7#ifndef ODP_PIPELINE_WORK_H_
8#define ODP_PIPELINE_WORK_H_
9
10#include <inttypes.h>
11#include <stdint.h>
12#include <stdio.h>
13
14#include <libconfig.h>
15#include <odp_api.h>
16
17#define ODP_PL_WORK_CONCAT_HELPER(a, b) a##b
18#define ODP_PL_WORK_CONCAT(a, b) ODP_PL_WORK_CONCAT_HELPER(a, b)
19
20typedef struct {
21 char *queue;
22 char *type;
23 config_setting_t *param;
24} odp_pl_work_param_t;
25
26typedef struct {
27 uint64_t data1;
28 uint64_t data2;
29 uint64_t data3;
30 uint64_t data4;
31} odp_pl_work_stats_t;
32
33typedef int (*odp_pl_work_fn_t)(uintptr_t data, odp_event_t ev[], int num,
34 odp_pl_work_stats_t *stats);
35
36typedef struct {
37 odp_pl_work_fn_t fn;
38 uintptr_t data;
39} odp_pl_work_init_t;
40
41typedef void (*odp_pl_work_init_fn_t)(const odp_pl_work_param_t *param, odp_pl_work_init_t *init);
42typedef void (*odp_pl_work_print_fn_t)(const char *queue, const odp_pl_work_stats_t *stats);
43typedef void (*odp_pl_work_destroy_fn_t)(uintptr_t data);
44
45void odp_pl_work_register_work(const char *name, odp_pl_work_init_fn_t init_fn,
46 odp_pl_work_print_fn_t print_fn,
47 odp_pl_work_destroy_fn_t destroy_fn);
48
49#define ODP_PL_WORK_AUTOREGISTER(name, init, print, destroy) \
50 __attribute__((constructor)) \
51 static void ODP_PL_WORK_CONCAT(autoregister, __LINE__)(void) { \
52 odp_pl_work_register_work(name, init, print, destroy); \
53 }
54
55#endif
The OpenDataPlane API.