DPDK  17.11.0
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_lcore.h>
63 
64 #define RTE_SERVICE_NAME_MAX 32
65 
66 /* Capabilities of a service.
67  *
68  * Use the *rte_service_probe_capability* function to check if a service is
69  * capable of a specific capability.
70  */
74 #define RTE_SERVICE_CAP_MT_SAFE (1 << 0)
75 
87 uint32_t rte_service_get_count(void);
88 
114 int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
115 
125 const char *rte_service_get_name(uint32_t id);
126 
138 int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
139 
162 int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
163  uint32_t enable);
164 
178 int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
179 
195 int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
196 
213 int32_t rte_service_runstate_get(uint32_t id);
214 
229 int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
230 
267 int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
268  uint32_t serialize_multithread_unsafe);
269 
283 int32_t rte_service_lcore_start(uint32_t lcore_id);
284 
302 int32_t rte_service_lcore_stop(uint32_t lcore_id);
303 
318 int32_t rte_service_lcore_add(uint32_t lcore);
319 
332 int32_t rte_service_lcore_del(uint32_t lcore);
333 
349 int32_t rte_service_lcore_count(void);
350 
361 int32_t rte_service_lcore_reset_all(void);
362 
375 int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
376 
396 int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
397 
409 int32_t rte_service_lcore_count_services(uint32_t lcore);
410 
421 int32_t rte_service_dump(FILE *f, uint32_t id);
422 
423 #ifdef __cplusplus
424 }
425 #endif
426 
427 
428 #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)