DPDK 25.03.0-rc0
rte_dispatcher.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2023 Ericsson AB
3 */
4
5#ifndef RTE_DISPATCHER_H
6#define RTE_DISPATCHER_H
7
22#include <stdbool.h>
23#include <stdint.h>
24
25#include <rte_compat.h>
26#include <rte_eventdev.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
56typedef bool (*rte_dispatcher_match_t)(const struct rte_event *event,
57 void *cb_data);
58
81typedef void (*rte_dispatcher_process_t)(uint8_t event_dev_id,
82 uint8_t event_port_id, struct rte_event *events, uint16_t num,
83 void *cb_data);
84
102typedef void (*rte_dispatcher_finalize_t)(uint8_t event_dev_id,
103 uint8_t event_port_id, void *cb_data);
104
110 uint64_t poll_count;
117};
118
130__rte_experimental
131struct rte_dispatcher *
132rte_dispatcher_create(uint8_t event_dev_id);
133
144__rte_experimental
145int
146rte_dispatcher_free(struct rte_dispatcher *dispatcher);
147
157__rte_experimental
158uint32_t
159rte_dispatcher_service_id_get(const struct rte_dispatcher *dispatcher);
160
202__rte_experimental
203int
204rte_dispatcher_bind_port_to_lcore(struct rte_dispatcher *dispatcher,
205 uint8_t event_port_id, uint16_t batch_size, uint64_t timeout,
206 unsigned int lcore_id);
207
228__rte_experimental
229int
230rte_dispatcher_unbind_port_from_lcore(struct rte_dispatcher *dispatcher,
231 uint8_t event_port_id, unsigned int lcore_id);
232
292__rte_experimental
293int
294rte_dispatcher_register(struct rte_dispatcher *dispatcher,
295 rte_dispatcher_match_t match_fun, void *match_cb_data,
296 rte_dispatcher_process_t process_fun, void *process_cb_data);
297
316__rte_experimental
317int
318rte_dispatcher_unregister(struct rte_dispatcher *dispatcher, int handler_id);
319
358__rte_experimental
359int
360rte_dispatcher_finalize_register(struct rte_dispatcher *dispatcher,
361 rte_dispatcher_finalize_t finalize_fun, void *finalize_data);
362
381__rte_experimental
382int
383rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, int reg_id);
384
406__rte_experimental
407void
408rte_dispatcher_start(struct rte_dispatcher *dispatcher);
409
418__rte_experimental
419void
420rte_dispatcher_stop(struct rte_dispatcher *dispatcher);
421
433__rte_experimental
434void
435rte_dispatcher_stats_get(const struct rte_dispatcher *dispatcher,
436 struct rte_dispatcher_stats *stats);
437
448__rte_experimental
449void
450rte_dispatcher_stats_reset(struct rte_dispatcher *dispatcher);
451
452#ifdef __cplusplus
453}
454#endif
455
456#endif /* RTE_DISPATCHER_H */
__rte_experimental void rte_dispatcher_stats_get(const struct rte_dispatcher *dispatcher, struct rte_dispatcher_stats *stats)
__rte_experimental void rte_dispatcher_start(struct rte_dispatcher *dispatcher)
__rte_experimental int rte_dispatcher_finalize_register(struct rte_dispatcher *dispatcher, rte_dispatcher_finalize_t finalize_fun, void *finalize_data)
__rte_experimental int rte_dispatcher_unregister(struct rte_dispatcher *dispatcher, int handler_id)
void(* rte_dispatcher_process_t)(uint8_t event_dev_id, uint8_t event_port_id, struct rte_event *events, uint16_t num, void *cb_data)
__rte_experimental void rte_dispatcher_stats_reset(struct rte_dispatcher *dispatcher)
__rte_experimental int rte_dispatcher_free(struct rte_dispatcher *dispatcher)
__rte_experimental void rte_dispatcher_stop(struct rte_dispatcher *dispatcher)
__rte_experimental uint32_t rte_dispatcher_service_id_get(const struct rte_dispatcher *dispatcher)
void(* rte_dispatcher_finalize_t)(uint8_t event_dev_id, uint8_t event_port_id, void *cb_data)
__rte_experimental int rte_dispatcher_register(struct rte_dispatcher *dispatcher, rte_dispatcher_match_t match_fun, void *match_cb_data, rte_dispatcher_process_t process_fun, void *process_cb_data)
__rte_experimental int rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, int reg_id)
bool(* rte_dispatcher_match_t)(const struct rte_event *event, void *cb_data)
__rte_experimental int rte_dispatcher_unbind_port_from_lcore(struct rte_dispatcher *dispatcher, uint8_t event_port_id, unsigned int lcore_id)
__rte_experimental struct rte_dispatcher * rte_dispatcher_create(uint8_t event_dev_id)
__rte_experimental int rte_dispatcher_bind_port_to_lcore(struct rte_dispatcher *dispatcher, uint8_t event_port_id, uint16_t batch_size, uint64_t timeout, unsigned int lcore_id)