DPDK  24.11.0-rc3
rte_service.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_SERVICE_H_
6 #define _RTE_SERVICE_H_
7 
26 #include<stdio.h>
27 #include <stdint.h>
28 
29 #include <rte_config.h>
30 #include <rte_lcore.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #define RTE_SERVICE_NAME_MAX 32
37 
38 /* Capabilities of a service.
39  *
40  * Use the rte_service_probe_capability() function to check if a service is
41  * capable of a specific capability.
42  */
46 #define RTE_SERVICE_CAP_MT_SAFE (1 << 0)
47 
53 uint32_t rte_service_get_count(void);
54 
77 int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
78 
85 const char *rte_service_get_name(uint32_t id);
86 
95 int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
96 
120 int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
121  uint32_t enable);
122 
133 int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
134 
147 int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
148 
162 int32_t rte_service_runstate_get(uint32_t id);
163 
178 int32_t
179 rte_service_may_be_active(uint32_t id);
180 
192 int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
193 
227 int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
228  uint32_t serialize_multithread_unsafe);
229 
242 int32_t rte_service_lcore_start(uint32_t lcore_id);
243 
262 int32_t rte_service_lcore_stop(uint32_t lcore_id);
263 
277 int32_t rte_service_lcore_may_be_active(uint32_t lcore_id);
278 
290 int32_t rte_service_lcore_add(uint32_t lcore);
291 
301 int32_t rte_service_lcore_del(uint32_t lcore);
302 
315 int32_t rte_service_lcore_count(void);
316 
326 int32_t rte_service_lcore_reset_all(void);
327 
337 int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
338 
355 int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
356 
365 int32_t rte_service_lcore_count_services(uint32_t lcore);
366 
374 int32_t rte_service_dump(FILE *f, uint32_t id);
375 
381 #define RTE_SERVICE_ATTR_CYCLES 0
382 
387 #define RTE_SERVICE_ATTR_CALL_COUNT 1
388 
394 #define RTE_SERVICE_ATTR_IDLE_CALL_COUNT 2
395 
401 #define RTE_SERVICE_ATTR_ERROR_CALL_COUNT 3
402 
409 int32_t rte_service_attr_get(uint32_t id, uint32_t attr_id,
410  uint64_t *attr_value);
411 
419 int32_t rte_service_attr_reset_all(uint32_t id);
420 
424 #define RTE_SERVICE_LCORE_ATTR_LOOPS 0
425 
431 #define RTE_SERVICE_LCORE_ATTR_CYCLES 1
432 
443 int32_t
444 rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id,
445  uint64_t *attr_value);
446 
455 int32_t
456 rte_service_lcore_attr_reset_all(uint32_t lcore);
457 
458 #ifdef __cplusplus
459 }
460 #endif
461 
462 
463 #endif /* _RTE_SERVICE_H_ */
int32_t rte_service_lcore_stop(uint32_t lcore_id)
int32_t rte_service_lcore_list(uint32_t array[], uint32_t n)
int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore, uint32_t enable)
int32_t rte_service_attr_get(uint32_t id, uint32_t attr_id, uint64_t *attr_value)
int32_t rte_service_run_iter_on_app_lcore(uint32_t id, uint32_t serialize_multithread_unsafe)
int32_t rte_service_lcore_add(uint32_t lcore)
int32_t rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, uint64_t *attr_value)
int32_t rte_service_lcore_del(uint32_t lcore)
int32_t rte_service_attr_reset_all(uint32_t id)
int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable)
int32_t rte_service_lcore_attr_reset_all(uint32_t lcore)
int32_t rte_service_may_be_active(uint32_t id)
int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore)
int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate)
int32_t rte_service_lcore_may_be_active(uint32_t lcore_id)
int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable)
int32_t rte_service_lcore_reset_all(void)
int32_t rte_service_probe_capability(uint32_t id, uint32_t capability)
int32_t rte_service_lcore_count(void)
int32_t rte_service_runstate_get(uint32_t id)
uint32_t rte_service_get_count(void)
int32_t rte_service_get_by_name(const char *name, uint32_t *service_id)
int32_t rte_service_lcore_start(uint32_t lcore_id)
const char * rte_service_get_name(uint32_t id)
int32_t rte_service_dump(FILE *f, uint32_t id)
int32_t rte_service_lcore_count_services(uint32_t lcore)