DPDK  17.11.10
rte_service.h
Go to the documentation of this file.
1 /*
2  * BSD LICENSE
3  *
4  * Copyright(c) 2017 Intel Corporation. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of Intel Corporation nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef _RTE_SERVICE_H_
34 #define _RTE_SERVICE_H_
35 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #include<stdio.h>
59 #include <stdint.h>
60 #include <sys/queue.h>
61 
62 #include <rte_config.h>
63 #include <rte_lcore.h>
64 
65 #define RTE_SERVICE_NAME_MAX 32
66 
67 /* Capabilities of a service.
68  *
69  * Use the *rte_service_probe_capability* function to check if a service is
70  * capable of a specific capability.
71  */
75 #define RTE_SERVICE_CAP_MT_SAFE (1 << 0)
76 
88 uint32_t rte_service_get_count(void);
89 
115 int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
116 
126 const char *rte_service_get_name(uint32_t id);
127 
139 int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
140 
163 int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
164  uint32_t enable);
165 
179 int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
180 
196 int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
197 
214 int32_t rte_service_runstate_get(uint32_t id);
215 
230 int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
231 
268 int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
269  uint32_t serialize_multithread_unsafe);
270 
286 int32_t rte_service_lcore_start(uint32_t lcore_id);
287 
305 int32_t rte_service_lcore_stop(uint32_t lcore_id);
306 
321 int32_t rte_service_lcore_add(uint32_t lcore);
322 
335 int32_t rte_service_lcore_del(uint32_t lcore);
336 
352 int32_t rte_service_lcore_count(void);
353 
364 int32_t rte_service_lcore_reset_all(void);
365 
378 int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
379 
399 int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
400 
412 int32_t rte_service_lcore_count_services(uint32_t lcore);
413 
424 int32_t rte_service_dump(FILE *f, uint32_t id);
425 
426 #ifdef __cplusplus
427 }
428 #endif
429 
430 
431 #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_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_set_stats_enable(uint32_t id, int32_t enable)
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_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)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_memzone.h:79
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)