DPDK  24.11.0-rc3
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
29 extern "C" {
30 #endif
31 
56 typedef bool (*rte_dispatcher_match_t)(const struct rte_event *event,
57  void *cb_data);
58 
81 typedef 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 
102 typedef 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;
112  uint64_t ev_batch_count;
116  uint64_t ev_drop_count;
117 };
118 
130 __rte_experimental
131 struct rte_dispatcher *
132 rte_dispatcher_create(uint8_t event_dev_id);
133 
144 __rte_experimental
145 int
146 rte_dispatcher_free(struct rte_dispatcher *dispatcher);
147 
157 __rte_experimental
158 uint32_t
159 rte_dispatcher_service_id_get(const struct rte_dispatcher *dispatcher);
160 
202 __rte_experimental
203 int
204 rte_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
229 int
230 rte_dispatcher_unbind_port_from_lcore(struct rte_dispatcher *dispatcher,
231  uint8_t event_port_id, unsigned int lcore_id);
232 
292 __rte_experimental
293 int
294 rte_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
317 int
318 rte_dispatcher_unregister(struct rte_dispatcher *dispatcher, int handler_id);
319 
358 __rte_experimental
359 int
360 rte_dispatcher_finalize_register(struct rte_dispatcher *dispatcher,
361  rte_dispatcher_finalize_t finalize_fun, void *finalize_data);
362 
381 __rte_experimental
382 int
383 rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, int reg_id);
384 
406 __rte_experimental
407 void
408 rte_dispatcher_start(struct rte_dispatcher *dispatcher);
409 
418 __rte_experimental
419 void
420 rte_dispatcher_stop(struct rte_dispatcher *dispatcher);
421 
433 __rte_experimental
434 void
435 rte_dispatcher_stats_get(const struct rte_dispatcher *dispatcher,
436  struct rte_dispatcher_stats *stats);
437 
448 __rte_experimental
449 void
450 rte_dispatcher_stats_reset(struct rte_dispatcher *dispatcher);
451 
452 #ifdef __cplusplus
453 }
454 #endif
455 
456 #endif /* RTE_DISPATCHER_H */
__rte_experimental int rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher, int reg_id)
__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 void rte_dispatcher_start(struct rte_dispatcher *dispatcher)
__rte_experimental void rte_dispatcher_stats_reset(struct rte_dispatcher *dispatcher)
__rte_experimental struct rte_dispatcher * rte_dispatcher_create(uint8_t event_dev_id)
__rte_experimental void rte_dispatcher_stats_get(const struct rte_dispatcher *dispatcher, struct rte_dispatcher_stats *stats)
__rte_experimental void rte_dispatcher_stop(struct rte_dispatcher *dispatcher)
__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)
__rte_experimental int rte_dispatcher_finalize_register(struct rte_dispatcher *dispatcher, rte_dispatcher_finalize_t finalize_fun, void *finalize_data)
__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_unbind_port_from_lcore(struct rte_dispatcher *dispatcher, uint8_t event_port_id, unsigned int lcore_id)
bool(* rte_dispatcher_match_t)(const struct rte_event *event, void *cb_data)
__rte_experimental int rte_dispatcher_free(struct rte_dispatcher *dispatcher)
__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)