DPDK  18.02.2
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 
60 uint32_t __rte_experimental rte_service_get_count(void);
61 
87 int32_t __rte_experimental rte_service_get_by_name(const char *name,
88  uint32_t *service_id);
89 
99 const char __rte_experimental *rte_service_get_name(uint32_t id);
100 
112 int32_t __rte_experimental rte_service_probe_capability(uint32_t id,
113  uint32_t capability);
114 
137 int32_t __rte_experimental rte_service_map_lcore_set(uint32_t service_id,
138  uint32_t lcore, uint32_t enable);
139 
153 int32_t __rte_experimental rte_service_map_lcore_get(uint32_t service_id,
154  uint32_t lcore);
155 
171 int32_t __rte_experimental rte_service_runstate_set(uint32_t id, uint32_t runstate);
172 
189 int32_t __rte_experimental rte_service_runstate_get(uint32_t id);
190 
205 int32_t __rte_experimental rte_service_set_runstate_mapped_check(uint32_t id,
206  int32_t enable);
207 
244 int32_t __rte_experimental rte_service_run_iter_on_app_lcore(uint32_t id,
245  uint32_t serialize_multithread_unsafe);
246 
262 int32_t __rte_experimental rte_service_lcore_start(uint32_t lcore_id);
263 
281 int32_t __rte_experimental rte_service_lcore_stop(uint32_t lcore_id);
282 
297 int32_t __rte_experimental rte_service_lcore_add(uint32_t lcore);
298 
311 int32_t __rte_experimental rte_service_lcore_del(uint32_t lcore);
312 
328 int32_t __rte_experimental rte_service_lcore_count(void);
329 
340 int32_t __rte_experimental rte_service_lcore_reset_all(void);
341 
354 int32_t __rte_experimental rte_service_set_stats_enable(uint32_t id,
355  int32_t enable);
356 
376 int32_t __rte_experimental rte_service_lcore_list(uint32_t array[], uint32_t n);
377 
389 int32_t __rte_experimental rte_service_lcore_count_services(uint32_t lcore);
390 
401 int32_t __rte_experimental rte_service_dump(FILE *f, uint32_t id);
402 
406 #define RTE_SERVICE_ATTR_CYCLES 0
407 
411 #define RTE_SERVICE_ATTR_CALL_COUNT 1
412 
422 int32_t __rte_experimental rte_service_attr_get(uint32_t id, uint32_t attr_id,
423  uint32_t *attr_value);
424 
435 int32_t __rte_experimental rte_service_attr_reset_all(uint32_t id);
436 
437 #ifdef __cplusplus
438 }
439 #endif
440 
441 
442 #endif /* _RTE_SERVICE_H_ */