Merge "Rest API: Fix all the bugs in the HWLB, mask issue, etc"
[samplevnf.git] / common / vnf_common / cpu_core_map.h
1 /*
2 // Copyright (c) 2017 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #ifndef __INCLUDE_CPU_CORE_MAP_H__
18 #define __INCLUDE_CPU_CORE_MAP_H__
19
20 #include <stdio.h>
21
22 #include <rte_lcore.h>
23
24 struct cpu_core_map;
25
26 struct cpu_core_map *
27 cpu_core_map_init(uint32_t n_max_sockets,
28         uint32_t n_max_cores_per_socket,
29         uint32_t n_max_ht_per_core,
30         uint32_t eal_initialized);
31
32 uint32_t
33 cpu_core_map_get_n_sockets(struct cpu_core_map *map);
34
35 uint32_t
36 cpu_core_map_get_n_cores_per_socket(struct cpu_core_map *map);
37
38 uint32_t
39 cpu_core_map_get_n_ht_per_core(struct cpu_core_map *map);
40
41 int
42 cpu_core_map_get_lcore_id(struct cpu_core_map *map,
43         uint32_t socket_id,
44         uint32_t core_id,
45         uint32_t ht_id);
46
47 void cpu_core_map_print(struct cpu_core_map *map);
48
49 void
50 cpu_core_map_free(struct cpu_core_map *map);
51
52 #endif