DPDK  18.11.11
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 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include<stdio.h>
31 #include <stdint.h>
32 #include <sys/queue.h>
33 
34 #include <rte_config.h>
35 #include <rte_lcore.h>
36 
37 #define RTE_SERVICE_NAME_MAX 32
38 
39 /* Capabilities of a service.
40  *
41  * Use the *rte_service_probe_capability* function to check if a service is
42  * capable of a specific capability.
43  */
47 #define RTE_SERVICE_CAP_MT_SAFE (1 << 0)
48 
57 uint32_t rte_service_get_count(void);
58 
81 int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
82 
89 const char *rte_service_get_name(uint32_t id);
90 
99 int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
100 
124 int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
125  uint32_t enable);
126 
137 int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
138 
151 int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
152 
166 int32_t rte_service_runstate_get(uint32_t id);
167 
185 int32_t __rte_experimental
186 rte_service_may_be_active(uint32_t id);
187 
199 int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
200 
234 int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
235  uint32_t serialize_multithread_unsafe);
236 
249 int32_t rte_service_lcore_start(uint32_t lcore_id);
250 
265 int32_t rte_service_lcore_stop(uint32_t lcore_id);
266 
278 int32_t rte_service_lcore_add(uint32_t lcore);
279 
289 int32_t rte_service_lcore_del(uint32_t lcore);
290 
303 int32_t rte_service_lcore_count(void);
304 
316 int32_t rte_service_lcore_reset_all(void);
317 
327 int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
328 
345 int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
346 
355 int32_t rte_service_lcore_count_services(uint32_t lcore);
356 
364 int32_t rte_service_dump(FILE *f, uint32_t id);
365 
369 #define RTE_SERVICE_ATTR_CYCLES 0
370 
374 #define RTE_SERVICE_ATTR_CALL_COUNT 1
375 
382 int32_t rte_service_attr_get(uint32_t id, uint32_t attr_id,
383  uint32_t *attr_value);
384 
392 int32_t rte_service_attr_reset_all(uint32_t id);
393 
397 #define RTE_SERVICE_LCORE_ATTR_LOOPS 0
398 
412 int32_t __rte_experimental
413 rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id,
414  uint64_t *attr_value);
415 
427 int32_t __rte_experimental
428 rte_service_lcore_attr_reset_all(uint32_t lcore);
429 
430 #ifdef __cplusplus
431 }
432 #endif
433 
434 
435 #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_attr_get(uint32_t id, uint32_t attr_id, uint32_t *attr_value)
int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore, uint32_t enable)
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_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_experimental rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, uint64_t *attr_value)
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_set_runstate_mapped_check(uint32_t id, int32_t enable)
int32_t __rte_experimental rte_service_may_be_active(uint32_t id)
int32_t __rte_experimental rte_service_lcore_attr_reset_all(uint32_t lcore)
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)